Open oprisnik opened 9 years ago
You could just save the whole XML file you receive from https://api.getlocalization.com/[project-name]/api/translations/file/[master-file-name]/[language-tag]/ instead of parsing the file and only writing the
@oprisnik if you download the file you cannot ensure that apostrophes are properly escaped, this is the reason why i parsed it, does getlocalization now do the sanity checks for android by its own?
Oh, I wasn't aware of this issue. I've just checked some Italian translations and it seems to be fixed.
Example: In GetLocalization the string has been translated with "L'ultimo giocatore". XML from GetLocalization:
<string name="last_player">L\'ultimo giocatore</string>
At least in this case it seems to work - not sure though if this is always the case.
The parser was also converting "..." with the proper xml char as per Android guidelines so not sure if its better too keep it parsed or download the raw
Ah ok, that's nice! Maybe it's better to keep parsing then - and to also parse the plural tags accordingly (and maybe even comments).
This library seems unmaintained so I released my fork to jcenter() which fixes this issue.
https://github.com/step-up-labs/gradle-getlocalization-plugin
You can add it by:
repositories {
jcenter()
}
dependencies {
classpath 'io.stepuplabs.getlocalization.gradle:gradle-getlocalization-plugin:1.2.1'
}
Nice, thanks @davidvavra :)
GetLocalization also supports plurals - but your plugin currently only supports simple string resources.
https://developer.android.com/guide/topics/resources/string-resource.html#Plurals
Example: