internationalization

How do I get localized date pattern string?

怎甘沉沦 提交于 2019-12-17 07:15:05
问题 It is quite easy to format and parse Java Date (or Calendar) classes using instance of DateFormat, i.e. I could format current date into short localize date like this: DateFormat formatter = DateFormat.getDateInstance(DateFormat.SHORT, Locale.getDefault()); String today = formatter.format(new Date()); My problem is: I need to obtain this localized pattern string (i.e. something like "MM/dd/yy" ). This should be a trivial task, but I just couldn't find the provider... 回答1: For SimpleDateFormat

How do I get localized date pattern string?

╄→гoц情女王★ 提交于 2019-12-17 07:14:08
问题 It is quite easy to format and parse Java Date (or Calendar) classes using instance of DateFormat, i.e. I could format current date into short localize date like this: DateFormat formatter = DateFormat.getDateInstance(DateFormat.SHORT, Locale.getDefault()); String today = formatter.format(new Date()); My problem is: I need to obtain this localized pattern string (i.e. something like "MM/dd/yy" ). This should be a trivial task, but I just couldn't find the provider... 回答1: For SimpleDateFormat

Date formatting based on user locale on android

梦想的初衷 提交于 2019-12-17 06:36:17
问题 I want to display a date of birth based on the user locale. In my application, one of my fields is the date of birth, which is currently in the format dd/mm/yyyy . So if the user changes his locale, the date format should also change accordingly. Any pointers or code samples would really help me to overcome the problem. 回答1: You can use the DateFormat class that formats a date according to the user locale. Example: String dateOfBirth = "26/02/1974"; SimpleDateFormat sdf = new SimpleDateFormat

Date formatting based on user locale on android

て烟熏妆下的殇ゞ 提交于 2019-12-17 06:36:03
问题 I want to display a date of birth based on the user locale. In my application, one of my fields is the date of birth, which is currently in the format dd/mm/yyyy . So if the user changes his locale, the date format should also change accordingly. Any pointers or code samples would really help me to overcome the problem. 回答1: You can use the DateFormat class that formats a date according to the user locale. Example: String dateOfBirth = "26/02/1974"; SimpleDateFormat sdf = new SimpleDateFormat

How to change iPhone app language during runtime?

纵然是瞬间 提交于 2019-12-17 06:09:57
问题 Is there a way to change the application language during runtime? So, after the change NSLocalizedString immediately returns the string for the new language. What I'm doing now is changing the language using the code below: - (void)onChangeLanguage: (id)sender { NSArray *lang = [NSArray arrayWithObjects:((InfoWhatever *)sender).language, nil]; [[NSUserDefaults standardUserDefaults] setObject:lang forKey:@"AppleLanguages"]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

With a browser, how do I know which decimal separator does the operating system use?

守給你的承諾、 提交于 2019-12-17 04:58:20
问题 I'm developing a web application. I need to display some decimal data correctly so that it can be copied and pasted into a certain GUI application that is not under my control. The GUI application is locale sensitive and it accepts only the correct decimal separator which is set in the system. I can guess the decimal separator from Accept-Language and the guess will be correct in 95% cases, but sometimes it fails. Is there any way to do it on server side (preferably, so that I can collect

i18n with UTF-8 encoded properties files in JSF 2.0 application

一笑奈何 提交于 2019-12-17 03:17:40
问题 I am using jsf-ri 2.0.3 where Hebrew and Russian support is needed. The problem is that I see gibberish on the screen instead of the correct text. First of all I have defined bundles (*_locale.properties) for each language. The files is in UTF-8 encoding. Secondly, I've defined the default and supported locales in faces-config.xml <locale-config> <default-locale>iw</default-locale> <supported-locale>en</supported-locale> <supported-locale>ru</supported-locale> </locale-config> Than I've added

What's “wrong” with C++ wchar_t and wstrings? What are some alternatives to wide characters?

筅森魡賤 提交于 2019-12-17 01:41:46
问题 I have seen a lot of people in the C++ community(particularly ##c++ on freenode) resent the use of wstrings and wchar_t , and their use in the windows api. What is exactly "wrong" with wchar_t and wstring , and if I want to support internationalization, what are some alternatives to wide characters? 回答1: What is wchar_t? wchar_t is defined such that any locale's char encoding can be converted to a wchar_t representation where every wchar_t represents exactly one codepoint: Type wchar_t is a

Android: how to get the current day of the week (Monday, etc…) in the user's language?

穿精又带淫゛_ 提交于 2019-12-16 23:57:33
问题 I want to know what the current day of the week is (Monday, Tuesday...) in the user's local language. For example, "Lundi" "Mardi" etc... if the user is French. I have read this post, it but it only returns an int, not a string with the day in the user's language: What is the easiest way to get the current day of the week in Android? More generally, how do you get all the days of the week and all the months of the year written in the user's language ? I think that this is possible, as for

Are named entities in HTML still necessary in the age of Unicode aware browsers?

岁酱吖の 提交于 2019-12-14 04:27:04
问题 I did a lot of PHP programming in the last years and one thing that keeps annoying me is the weak support for Unicode and multibyte strings (to be sure, natively there is none). For example, "htmlentities" seems to be a much used function in the PHP world and I found it to be absolutely annoying when you've put an effort into keeping every string localizable, only store UTF-8 in your database, only deliver UTF-8 webpages etc. Suddenly, somewhere between your database and the browser there's