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

  1. 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.

  2. 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.

  1. no it's not possible
  2. 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 pair key, value, key name attribute used in strings.xml, , put pair in hashmap<string, string>. in end had small manager, made translation id name, retrieved string hashmap , returned client.

as can image was/is nightmare maintainability point of view. discourage it, understand not possible


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -