Last modified: 2014-03-07 10:55:55 UTC
Android XML string resources can contain string array declarations (with multiple translatable strings within) in addition to single strings. The current Android FFF read/writer doesn't support these - they're just skipped over. I've implemented support for this on my installation - not especially elegantly, but it works. Patch to be attached...
Created attachment 13608 [details] Patch to implement this
On a quick look looks okay. Example (preferably in format of unit tests) would be nice.
Created attachment 13610 [details] Proposed unit test Ok, so I'm not set up to run these unit tests (in other words, I haven't tested it at all!) but it should look something like this patch.
Change 98706 had a related patch set uploaded by Siebrand: Add support for string arrays in AndroidXmlFFS https://gerrit.wikimedia.org/r/98706
I've created Gerrit change #98706 out of this. Unit tests, etc, should be run automatically, so you can observe how it's doing...
In code review, I left a concern about what will happen with a partial translation of the string array elements. I think the code does not handle that correctly, and there's no test for it.
Ciaran, can you please reply to the open question? Otherwise we are not going to make progress here unfortunately...
Apologies, I missed the notification on that one. Yes, you're right, if only some elements in an array are translated in a particular language, you end up with an array that's not of the right length. You spotted it in code review, we spotted it when our app crashed trying to use a truncated array. ;) The code we're running currently deals with this by keeping the translated elements and using the originals for the others. I can submit a new patch for the updated code we're using now, but I guess I will need to add tests for it as well.
Change 98706 abandoned by Siebrand: Add support for string arrays in AndroidXmlFFS https://gerrit.wikimedia.org/r/98706