Last modified: 2014-03-07 10:55:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58276, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56276 - Android FFS doesn't support string-array
Android FFS doesn't support string-array
Status: PATCH_TO_REVIEW
Product: MediaWiki extensions
Classification: Unclassified
Translate (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-28 20:54 UTC by Ciaran Gultnieks
Modified: 2014-03-07 10:55 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch to implement this (3.21 KB, patch)
2013-10-28 21:07 UTC, Ciaran Gultnieks
Details
Proposed unit test (1.61 KB, patch)
2013-10-28 22:29 UTC, Ciaran Gultnieks
Details

Description Ciaran Gultnieks 2013-10-28 20:54:47 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...
Comment 1 Ciaran Gultnieks 2013-10-28 21:07:23 UTC
Created attachment 13608 [details]
Patch to implement this
Comment 2 Niklas Laxström 2013-10-28 21:52:55 UTC
On a quick look looks okay. Example (preferably in format of unit tests) would be nice.
Comment 3 Ciaran Gultnieks 2013-10-28 22:29:25 UTC
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.
Comment 4 Gerrit Notification Bot 2013-12-02 22:06:02 UTC
Change 98706 had a related patch set uploaded by Siebrand:
Add support for string arrays in AndroidXmlFFS

https://gerrit.wikimedia.org/r/98706
Comment 5 Siebrand Mazeland 2013-12-02 22:07:22 UTC
I've created Gerrit change #98706 out of this. Unit tests, etc, should be run automatically, so you can observe how it's doing...
Comment 6 Siebrand Mazeland 2013-12-02 22:27:27 UTC
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.
Comment 7 Siebrand Mazeland 2014-01-31 10:56:41 UTC
Ciaran, can you please reply to the open question? Otherwise we are not going to make progress here unfortunately...
Comment 8 Ciaran Gultnieks 2014-01-31 11:06:36 UTC
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.
Comment 9 Gerrit Notification Bot 2014-03-07 10:55:55 UTC
Change 98706 abandoned by Siebrand:
Add support for string arrays in AndroidXmlFFS

https://gerrit.wikimedia.org/r/98706

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links