When translating strings, Node Gallery escapes quotes. Best practice is to combine single & double quotes to avoid escaping. See t() function doc

Comments

crea’s picture

Title: Not using translation best practices » Quote escaping in t(): not using translation best practices
dddave’s picture

Would this break existing translations if changed?

crea’s picture

Yes, but since 3.x is not stable yet, I thought it would be ok
It is acceptable practice that strings can change during development before stable releases.

dddave’s picture

Basically I agree yet I am not motivated to work on the German translation again. On the other hand this affects no THAT many strings.

dddave’s picture

From all the new issues I think this is the only one which can be considered a release blocker for a final full release as it affects translations in a possibly big way. I don't think we want to break translations in such a way after 3.0 is out.
@justintime
Do you agree?
I think the rest of crea's input can be dealt with after 3.0 is shipped. The priority should be to crown all your hard work with a full release (which most likely will raise the usage numbers even more). Don't shy away from breaking my translation as I knew the risk when I started working on this.

justintime’s picture

Status: Active » Needs review
StatusFileSize
new27.89 KB

Attached patch is actually two commits. The first is coder recommendations, the second address the t() calls with backslashes.

dddave’s picture

I cannot get this patch applied using cygwin. Is this drushyfied?

justintime’s picture

StatusFileSize
new26.01 KB

It's a git format-patch, and I doubt cygwin's patch command works with those. I created a diff style one that should work for you and attached it to this issue.

dddave’s picture

Thanks. Shouldn't this replace certain strings? I extracted a .po file and only the new og-related strings are added while the rest seems intact...

Maybe I am doing something wrong here. I am tired anyways. Will look into this tomorrow.

justintime’s picture

Status: Needs review » Fixed

@dddave, I wondered whether or not that would impact your translation or not. The only thing that I changed was removing some backslashes, and changed a couple single quotes to double quotes and vice versa. I would've thought you'd have reported seeing backslashes in your .po file.

In light of this, I'm just committing it. I'm guessing there's little to no work for you to do there.

dddave’s picture

To be honest I was wondering about those backslashes and quotes. However the translation worked fine and I didn't bother. I never cared about the coding side in this respect and a lot of modules I worked on ignored the 100% correct usage of t() anyways.

edit: You got mail.

Automatically closed -- issue fixed for 2 weeks with no activity.