locale

Activity is blinking after locale change in Android 4.1+

坚强是说给别人听的谎言 提交于 2019-12-19 03:37:17
问题 I have implemented custom locale selection about a year ago but after 4.1 release users start to complain on constant activity blinking. Here is code I'm using (compiled from different SO answers): public final class TestApplication extends Application { private Locale desiredLocale = new Locale("ru-RU"); @Override public void onCreate() { super.onCreate(); updateLocale(new Configuration()); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged

Unable to change language in Oreo

点点圈 提交于 2019-12-19 02:42:12
问题 I'm trying to use Arabic and English in my app. Its working fine on devices running on android Nougat or below. But it's not working on oreo devices. Is there some new code requirement in API 26? I am using the code below. public void changeLanguage(Context context, String language) { Locale locale = new Locale(language); Locale.setDefault(locale); Configuration config = context.getResources().getConfiguration(); config.setLocale(locale); context.createConfigurationContext(config); context

GWT Dynamic Locale

独自空忆成欢 提交于 2019-12-18 18:36:01
问题 I want to set gwt-locale taking user chosen locale with the help of Spring LocaleContextHolder . public static final String getCurrentLocale() { return LocaleContextHolder.getLocale().getLanguage(); } I actually have login interface in Spring MVC and inner Dashboard in gwtp . The same locale user chooses in outer interface before login has to be passed to gwt as well. Unfortunately, I don't see any gwt inbuilt Locale setters. My X.gwt.xml with default locale as kh is : <inherits name="com

How to detect language preference in Laravel 5

馋奶兔 提交于 2019-12-18 16:29:07
问题 I want to detect my client language by getting the browser recommended language. For Example, if you open the browser in Japan it will give me country code or country name current user opened like "en-jp" or "japan". I try this code but it seems to display the language that I previously selected and by default it's English. I set a Middleware and I need to exclude the api part because I have some routers pinging this address and router browser does not have language information which brick

onConfigurationChange not called after changing locale

為{幸葍}努か 提交于 2019-12-18 14:58:32
问题 I have to refresh the fragments contents on change of language from one fragment. So I thought of using onConfigurationChange method which is in my Main activity (this activity controls all the fragments) and recreate all the fragments on change of locale. But this method is not being called on change of locale. I have included locale under the activity tag of manifest file. onConfigurationChange is being called on change of orientation. i am changing language as given in this link Change

How do you get System default font settings in Qt?

泪湿孤枕 提交于 2019-12-18 14:15:26
问题 I am building a desktop app using Qt, my dev machine is win 7 x64 with japanese locale, standard system font is Meiryo. Most of win 7 UI is in this font, though classic/older programs such as ui font customization window itself uses different font which is MS UI Gothic. This doesn't bother me until I found that QtCreator builds my app with MS UI Gothic in one place, and Meiryo in the other. For example, qlabels, qlineedits, qcombobox all uses MS UI Gothic, but a custom completer with a

How to detect current locale in Mac OS X from the shell

大兔子大兔子 提交于 2019-12-18 13:21:14
问题 I need to detect the current locale in OS X from the command line. On Linux/Unix I can rely on LANG, but it is not always set: http://henrik.nyh.se/2007/10/displaying-utf-8-correctly-in-leopard-terminal I am looking for command line utilities or AppleScript code that allows me to find that information. Ideally they would work from 10.2 onwards The closest I have found so far is defaults read -g AppleLocale which works on 10.3 onwards 回答1: apropos yeilds the command locale 10.4 and later

English Error Messages in German Visual Studio 2008 / ASP.NET

為{幸葍}努か 提交于 2019-12-18 12:28:22
问题 This might be a bit weird question, but I'll give it a shot: HELP, my Visual Studio 2008 / ASP.NET is giving me GERMAN error messages. Besides the fact that translations tend to be not as good as the original text, I can't search for those and find relevant answers to my problems on the internet. So: How do I switch my German Visual Studio 2008 Standard Edition to English locals? Update - Just to make it clear: I am a German developer, working with a German Windows Vista... I also have a

change locale symfony 2.3

旧城冷巷雨未停 提交于 2019-12-18 12:03:15
问题 I just began with symfony I'm trying to build a multilang website but I have a problem to change the locale I read some posts and I read the documentation about this but the locale don't change, I try: public function indexAction() { $this->get('session')->set('_locale', 'fr'); $request = $this->getRequest(); $locale = $request->getLocale(); return $this->render('PhoneMainBundle:Default:index.html.twig',array('locale'=>$locale)); } but the value in $locale is always 'en' (my default locale) I

Valid Locale Names

谁都会走 提交于 2019-12-18 11:48:53
问题 How do you find valid locale names? I am currently using MAC OS X. But information about other platforms would also be useful. #include <fstream> #include <iostream> int main(int argc,char* argv[]) { try { std::wifstream data; data.imbue(std::locale("en_US.UTF-16")); data.open("Plop"); } catch(std::exception const& e) { std::cout << "Exception: " << e.what() << "\n"; throw; } } % g++ main.cpp % ./a.out Exception: locale::facet::_S_create_c_locale name not valid Abort 回答1: This page says: The