Get string from default locale using string in specific locale

后端 未结 8 984
温柔的废话
温柔的废话 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();
    

提交回复
热议问题