Get string from default locale using string in specific locale

后端 未结 8 980
温柔的废话
温柔的废话 2020-12-06 09:58

Ok, I know title sound crazy :)

Here is what I want. My app is localized for device user but information I send back to server need to be all English. My default app

相关标签:
8条回答
  • 2020-12-06 10:49

    This one has no side effects: API17 and higher

    Configuration config = new Configuration(context.getResources().getConfiguration()); 
    config.setLocale(locale);   
    return context.createConfigurationContext(config).getResources();
    
    0 讨论(0)
  • 2020-12-06 10:49

    I combined the two approaches necessary to work on all Android versions. See my answer here.

    0 讨论(0)
提交回复
热议问题