locale

How to make Wordpress permalinks ignore custom url rewrite

不问归期 提交于 2019-12-10 14:44:55
问题 i'm currently working on a wordpress site that needs to have the option to be offered in french. i've found a way to make the theme work with the fr_FR po and mo files when i add a querystring variable l . i.e. site.tld will yield the vanilla english site, while site.tld/?l=fr will activate the following code in my functions.php to serve the french translation: <?php // http://codex.wordpress.org/Plugin_API/Filter_Reference/locale add_filter( 'locale', 'set_my_locale' ); function set_my

PHP setlocale doesn't work

半城伤御伤魂 提交于 2019-12-10 14:44:00
问题 This question was migrated from Server Fault because it can be answered on Stack Overflow. Migrated 6 years ago . I try to set the locale from fr_FR to us_US in PHP (php-fpm) with nginX on my raspberry-pi. Here is my code: <?php system('locale -a'); /* C POSIX en_US.utf8 fr_FR fr_FR.iso88591 fr_FR.iso885915@euro fr_FR.utf8 So the en_US locale is well installed */ echo locale_get_default(); /* fr_FR */ echo setlocale(LC_ALL, '0'); /* LC_CTYPE=fr_FR.UTF-8;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC

How to get equivalent of printf_l on Linux?

夙愿已清 提交于 2019-12-10 14:34:43
问题 This function exists on OS X and allows you to pass custom local to the function. setlocale is not thread-safe, and passing locale as parameter is. If there is no equivalent, any way of locale-independent printf, or printf just for doubles (%g) will be ok. 回答1: You might try uselocale, which sets the thread locale (rather than the process locale) before calling printf . 回答2: There are locale-independent double to string convertion routines at http://www.netlib.org/fp/. String to double

Localizing the JFileChooser “All Files” string

ぐ巨炮叔叔 提交于 2019-12-10 14:31:16
问题 I am working on a java application with a JFileChooser and the user is able to switch languages. Locale.setDefault( Locale.ENGLISH ); JFileChooser chooser = new JFileChooser(); chooser.showOpenDialog( null ); Locale.setDefault( Locale.CHINA ); JFileChooser.setDefaultLocale( Locale.CHINA ); JFileChooser chinese_chooser = new JFileChooser(); chinese_chooser.showOpenDialog( null ); The second file chooser to appear is in Chinese except for the "All Files" string in the drop down box. If I

/bin/bash printf does not work with other LANG than C

六眼飞鱼酱① 提交于 2019-12-10 13:56:19
问题 I have a really weird problem with /bin/bash and a script that uses printf to format a string. My script looks like this rt=$(printf "%.3f" 13.234324245) with the difference, that i compute the number 13.23... above. When i use /usr/bin/zsh that works great! Even /bin/sh can do it (but it cant do the if stuff...) The biggest problem ist that /bin/bash seems to does not understand printf or does have another formating way when i dont use LANG=C . My LANG Variable is set to de_AT.UTF-8 and then

Change language to Bootstrap Datetimepicker

僤鯓⒐⒋嵵緔 提交于 2019-12-10 13:54:35
问题 I'm using the datetimepicker of Bootstrap, it's working pretty well. The thing is that it's in english, and I need it in spanish, I had read some post but nothing works to me. my HTML is defined as: <div class="form-group"> <div class='input-group date datepicker' data-date-startdate="{{$student->middle}}" name="datepicker" > <input type='text' class="form-control placementT" id="fecha"> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div>

Java: what's the difference between the sv and sv_SE locale?

社会主义新天地 提交于 2019-12-10 13:22:44
问题 I tried to parse a string (-0,3) to a double in java using Swedish locale using this code: String DoubleString = "-0,3" NumberFormat swedishNumberFormat = NumberFormat.getInstance(new Locale("sv")); System.out.println(swedishNumberFormat.parse(doubleString).doubleValue()); When I tried with the sv_SE locale the result was -3.0, which, obviously, is incorrect. I then, after a lot of headache changed the locale to sv (as in the example above) and then the result was correct, -0,3. According to

How to detemine the current direction of a View (RTL/LTR)?

百般思念 提交于 2019-12-10 13:19:04
问题 Background It's possible to get the current locale direction, using this: val isRtl=TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_RTL It's also possible to get the layout direction of a view, if the developer has set it: val layoutDirection = ViewCompat.getLayoutDirection(someView) The problem The default layoutDirection of a view isn't based on its locale. It's actually LAYOUT_DIRECTION_LTR . When you change the locale of the device from LTR

I cannot remove the Japanese IME from my Android emulator

戏子无情 提交于 2019-12-10 12:48:13
问题 I've seen this question many times but the answer is always "uncheck the IME from the 'Language & Keyboard Settings' menu. The problem is that there's NO checkbox there. Menu - Custom Locale - en_US is selected. Menu - Settings - Language & Keyboard - Select Language - 'English (United States)' is selected. Menu - Settings - Language & Keyboard - Japanese IME is the only IME and there is no check box to remove it. I've also put a cursor into an editview and tried messing with the keyboard

Output one character per two keys in Android Keyboard

扶醉桌前 提交于 2019-12-10 12:42:14
问题 I am designing a custom keyboard for Amharic language in Android, but the following is applicable to many other non-English languages. Two or more combination of keys translate to one character. So, if the user types 'S', the keyboard will output 'ሰ'... and if they follow it with the letter 'A', the 'ሰ' is replaced with 'ሳ'. I managed to get a solution, as below, working by looking at the character before the cursor and checking it against a Map. However, I was wondering whether there is a