Open jekader opened 9 years ago
Any example about applying that in Android apps? Our translations are supported by the resource system in Android, that automatically loads the correct set of values according to a chosen locale. Right now I'm not sure if it's feasable to have arrays of string resources with different size depending of the locale.
Android supports plurals out-of-the-box, see for example: http://www.grokkingandroid.com/wrapping-your-head-around-androids-plurals/
Problem is... the translator would need to know which of the plurals the respective language supports in order to add a translation for them (German and English only support the plurals one and other) . Besides it can't be done like the GNU way. It has to be done based on the ICU / Unicode rules which are taken into account by Android's plurals system.
From what I understand in this project's description: https://code.google.com/p/android-i18n-plurals/ android 3.0 and above will have correct handling of "one/few/many/other" values according to this table: http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
So it may just be enough to add strings for these values and Android will handle the rest. As you see from the table, the formula fro Russian and other Slavic languages is not that trivial. It's even more complicated for Arabic.
Awesome!
Besides, seems that Transifex also supports the plurals
element, so the circle seams closed: http://docs.transifex.com/formats/android/
That means...
@tobiasKaminsky , @AndyScherzinger , @LukeOwncloud and whoever feels like, contributions are wellcome here :)
How do we handle the change in Transifex? I don't really know how to use it, but I'm pretty sure there's no automatic way to keep our current translations when some strings are replaced by one plural. Do we have to report every changed string in every language?
@Kernald , sorry for answering so late.
Just don't care about Transifex. Make the changes only in res/values/strings.xml
and the translations will be available "when-it's-done".
At the moment, strings for files/folders have hardcoded plurals: https://github.com/owncloud/android/blob/master/res/values/strings.xml#L350-L357
This works for English however for other languages plurals can have several forms ("2 folders" and "5 folders" will have different translations)
I suggest fixing these strings according to make existing translation processes work: https://www.gnu.org/software/gettext/manual/html_node/Translating-plural-forms.html