Android dynamically create String Array from XML string resources, without XML string array

StackOverflow https://stackoverflow.com/questions/8924312

  •  30-10-2019
  •  | 
  •  

سؤال

Ok, so this question is a bit weird, and kinda rubs me the wrong to even ask, but since I probably don't have a choice I want to see what you guys think. I'm still a novice at Java and Android.

The case is as follows: We are trying to automate the building of our strings.xml for localisation. A parser has been made to convert a csv-file to xml. For regular strings it's not a real problem, that works fine. But the parser that was built, doesn't take string arrays into account and there is little chance that someone will modify it.

Is there an "easy" way to work with the strings and create an string array programmatically based on parts the name attributes?

If not, then I would have to hard code the arrays and that leaves the creator (client) of the language files unable to add items to something that should be a dynamic list.

I know modifying the strings.xml manually might be an option, but because our management wants to automate stuff like that, it's not much of a choice I have.

Probably I will hard code the stuff and say they can't dynamically fill the lists, but still (also for my personal education) I wanna know what you guys think.

Thanks for your opinions or solutions. :)

Cheers!

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top