Android Localization for French and English Strings -
we building product planning push static string server english , french users,for purpose of performance. both strings pushed @ same time.we providing switch on navigation drawer switch between english , language. since these strings keep on changing on time period can't keep them under values , values-fr folders.
now there couple of problems
when device locale changes need switch language of application using these string @ runtime.is there way load string dynamically @ run time values , values-fr folder.
if above not possible planning perform checks on every view each string,which increase complexity of code.
is there alternative or solution above problem can implement.any highly appreciated.
- no it's not possible
- i did similar once. did provide
strings.xml, set of empty items, sake of ids. can use, of course, purpose,ids.xml. when application started, download file contained pairkey, value,keynameattribute used instrings.xml, , put pair inhashmap<string, string>. in end had small manager, made translationidname,retrievedstringhashmap, returned client.
as can image was/is nightmare maintainability point of view. discourage it, understand not possible
Comments
Post a Comment