Page MenuHomePhabricator

Translator not recognize keys when contains \n characters
Closed, InvalidPublic

Description

I tried many ways to make it work, but seems is broken somehow.
For example, look this key, copied from generated translation:

'React to branches and tags being pushed to hosted repositories.\\nHook rules can block changes and send push summary mail.' => NULL,

Event Timeline

Zolli raised the priority of this task from to Needs Triage.
Zolli updated the task description. (Show Details)
Zolli added a project: Localization.
Zolli added subscribers: Zolli, epriestley.
chad claimed this task.
chad added a subscriber: chad.

I don't believe we support (take bugs, requests) translating your own instance, though you may if you choose.

I presume your main issue is the use of single quotes over double quotes. "\n" is a character in PHP which needs double quotes.

Yeah, thanks, tha double quote is the answer. The generater tool is broken currently (i18n extract) I submit a patch somtime to fix this.
The generator extracts string in the following version:

'...Hello\\nWolrd...' => NULL,

When the correct format is the following:

"...Hello\nWorld..." => NULL,

OFF:
Although I can not really agree the reason you reject to fix this. I made the translation not for my interest, or for my company. I made this for the community.

We consider the Translation framework to be a "prototype".

https://secure.phabricator.com/book/phabricator/article/prototypes/

Basically, it's know to be incomplete, buggy, and issues will either be resolved or not present in a "final" release.

But we're happy to look at small fixes that seem obvious to fix in this case, if you want to submit a patch. Thanks!