Skip to content

String Arrays #9

GammaDraconis opened this Issue Mar 30, 2012 · 3 comments

2 participants


Is there any support for string arrays on the Android side? On the Apple side I can have the following:
"list_titles" = "Item One, Item Two";
"list_items" = "item_one, item_two";
"item_one" = "This is the content of item 1.";
"item_two" = "This is the content of item 2.";

On the Android side this would need to be a set of two string-arrays:
<string-array name="list_titles">
<item>Item One</item>
<item>Item Two</item>
<string-array name="list_items">
<item>This is the content of item 1.</item>
<item>This is the content of item 2.</item>

If I consume an Apple .strings file and then generate an Android .xml file from the .txt, I just get <string></string> representations of the 4 lines.

scelis commented Mar 30, 2012

So I had a chat with our resident Android expert, and he recommends defining the Android string-array in a separate resource file. It can still reference the strings in your twine-generated file, but putting them in the same XML resource file might not make a lot of sense.

Overall, what you are doing for iOS is a little weird, anyway. You are defining strings that are lists of string keys, so if you wanted to do anything with them you would have to parse that string into an array (in code) and call NSLocalizedString on each? That's definitely strange.

Overall, Twine is a tool for managing string keys and their translations. It isn't a tool for managing relationships between these strings or groupings of strings. That should probably be done outside of Twine (and using Twine should definitely not prohibit that or make it harder in any way).

@scelis scelis closed this Mar 30, 2012

Thanks for the reply. My comment was based on what my developers have been doing. I'll direct your comments to them and see if they can't take a more rational approach on both sides.

Thanks for providing the tool though. It looks like it will go a long way to solving the cross-platform maintenance issues that were beginning to be a big headache.

scelis commented Mar 30, 2012

Great. If I misunderstood anything about what you guys are trying to do, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.