-
-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix escaped characters in translations #569
Conversation
A tonne of erroneous translations. For now I have adjusted the xml resources as well, but we should probably tweak the conversion script later to handle all the edge cases (some translators add xml tags inside the resources, such as |
<string name="welcome_intro4_headline">Güçlü</string> | ||
<string name="welcome_intro4_message">Sınırsız sohbetler, görüntüler, videolar, sesli iletiler ve daha fazlası. Çoklu istemci yetenekli.</string> | ||
<!-- Translators: "free" as in freedom here, not "free" as in "free beer" --> | ||
<string name="welcome_intro5_headline">Özgür</string> | ||
<!-- Translators: "free" as in freedom here, not "free" as in "free beer" --> | ||
<string name="welcome_intro5_message">Delta Chat sonsuza dek özgürdür.<br/>Açık kaynaklı. Reklâm yok. Abonelik yok. Satıcı kilidi yok.</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't have a new line in the original
json = require(file) | ||
} catch (e) { | ||
console.error(e.message) | ||
return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First test makes sure the file is valid json.
console.error(e.message) | ||
return false | ||
} | ||
return Object.keys(json).every(k1 => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For every resource ..
} | ||
return Object.keys(json).every(k1 => { | ||
const v1 = json[k1] | ||
return Object.keys(v1).every(k2 => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. every key of that resource (e.g. "message"
etc) ..
) | ||
return false | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be a string ..
if (!testString('\\\\n')) return false | ||
if (!testString("\\\\'")) return false | ||
if (!testString('\\\\\\"')) return false | ||
if (!testString('\\\\')) return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it shouldn't contain these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably refactor this into one return
statement. Up to you guys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine with multiple returns to me
It would be nice to merge this today. It kills two bugs. |
i just pulled new translations from transifex - are these already the changes from this pr? just asking because it is a bit dangerous to push sources to transifex as this will always overwrite all work of the translators (transifex is not line bases afaik) since the last pull (16 hours ago in this case). for android, therefore, i never edit the strings-LANG.xml files locally but do this always in the web-frontend. |
@r10s I didn't push these to Transifex. I edited them on Transifex and pulled them. |
Closes #544, closes #515