We need proper support for plurals in some string translations on the Wikipedia native mobile apps; I'm currently looking at the AndroidFFS import/export module and trying to figure out how ready that is, and looking into how to improve the AppleFFS import/export module for iOS/OSX projects.
Android has native plural strings support allowing for a separate complete string for each plural form. AndroidXmlFFS in Translate has some sort of import/export conversion into something like '{{PLURAL|one=foo|others=bar}}' in the messages exposed to translators, but plurals are not used in the new Wikipedia Android app yet so I see no live examples. There are a few plural strings in the Android version of the Commons app we did last year, but those strings do not appear in any of the localizations and I can't find them in TWN, so I'm worried that the import of plural strings from the 'strings.xml' doesn't actually work.
Also, the format the AndroidXmlFFS module uses doesn't quite seem the same as what MediaWiki uses ('{{PLURAL:$1|foo|bar}}'). Is that going to be confusing for translators, or should we change it to look more like the MediaWiki form? (Does this require mapping positional parameters to plural form names, or are they always in a known order?)
iOS 7/OS X 10.9 also has a 'native' way of handling plurals which requires a second '.stringdict' output file alongside the '.strings' file; or there are CLDR-powered compatibility libraries like https://github.com/Smartling/ios-i18n which embed multiple message alternates in the main '.strings' file.
I could rig up an import/export filter similar to the Android one (or maybe share the actual list<->parser function conversion code), but first I want to check if it works and if it's what the translators expect to work with...
-- brion
Forwarding message which didn't reach the list
-------- Messaggio originale -------- Oggetto: [WikimediaMobile] Translate FFS support for plurals on Android, iOS? Data: Tue, 1 Jul 2014 09:01:26 -0700 Mittente: Brion Vibber A: MediaWiki internationalisation mediawiki-i18n@lists.wikimedia.org, mobile-l mobile-l@lists.wikimedia.org
We need proper support for plurals in some string translations on the Wikipedia native mobile apps; I'm currently looking at the AndroidFFS import/export module and trying to figure out how ready that is, and looking into how to improve the AppleFFS import/export module for iOS/OSX projects.
Android has native plural strings support allowing for a separate complete string for each plural form. AndroidXmlFFS in Translate has some sort of import/export conversion into something like '{{PLURAL|one=foo|others=bar}}' in the messages exposed to translators, but plurals are not used in the new Wikipedia Android app yet so I see no live examples. There are a few plural strings in the Android version of the Commons app we did last year, but those strings do not appear in any of the localizations and I can't find them in TWN, so I'm worried that the import of plural strings from the 'strings.xml' doesn't actually work.
Also, the format the AndroidXmlFFS module uses doesn't quite seem the same as what MediaWiki uses ('{{PLURAL:$1|foo|bar}}'). Is that going to be confusing for translators, or should we change it to look more like the MediaWiki form? (Does this require mapping positional parameters to plural form names, or are they always in a known order?)
iOS 7/OS X 10.9 also has a 'native' way of handling plurals which requires a second '.stringdict' output file alongside the '.strings' file; or there are CLDR-powered compatibility libraries like https://github.com/Smartling/ios-i18n which embed multiple message alternates in the main '.strings' file.
I could rig up an import/export filter similar to the Android one (or maybe share the actual list<->parser function conversion code), but first I want to check if it works and if it's what the translators expect to work with...
-- brion
Brion Vibber, 01/07/2014 18:01:
iOS 7/OS X 10.9 also has a 'native' way of handling plurals which requires a second '.stringdict' output file alongside the '.strings' file; or there are CLDR-powered compatibility libraries like https://github.com/Smartling/ios-i18n which embed multiple message alternates in the main '.strings' file.
Needing multiple messages sounds like a substandard gettext-like implementation. Translators certainly expect to be able to use the MediaWiki syntax, normally; they're likely to make mistakes or skip the messages with unknown syntax. So if you add a new syntax you should * at the very least document it on https://translatewiki.net/wiki/Translating:WikimediaMobile and https://translatewiki.net/wiki/Plural , * probably implement a checker to warn translators when they make mistakes, see https://www.mediawiki.org/wiki/Help:Extension:Translate/Group_configuration#... and examples in the repo.
Nemo
On Tue, Jul 1, 2014 at 9:27 AM, Federico Leva (Nemo) nemowiki@gmail.com wrote:
Brion Vibber, 01/07/2014 18:01:
iOS 7/OS X 10.9 also has a 'native' way of handling plurals which requires a second '.stringdict' output file alongside the '.strings' file; or there are CLDR-powered compatibility libraries like https://github.com/Smartling/ios-i18n which embed multiple message alternates in the main '.strings' file.
Needing multiple messages sounds like a substandard gettext-like implementation.
That'd be how it's handled internally in the file, but we'd want to expose it to translators in one combined converted message yes.
Translators certainly expect to be able to use the MediaWiki syntax, normally; they're likely to make mistakes or skip the messages with unknown syntax. So if you add a new syntax you should
- at the very least document it on
https://translatewiki.net/wiki/Translating:WikimediaMobile and https://translatewiki.net/wiki/Plural ,
^ aha -- it looks like the conversion that (may or may not work yet) in AndroidXmlFFS is for the 'Ruby on Rails style', so as long as it's documented.... hopefully not too confusing.
- probably implement a checker to warn translators when they make
mistakes, see
https://www.mediawiki.org/wiki/Help:Extension:Translate/Group_configuration#... and examples in the repo.
Oooh that sounds handy.
Thanks for the links!
-- brion
mediawiki-i18n@lists.wikimedia.org