internationalization

Struts 2 how to get i18n messages from within a custom validator

大憨熊 提交于 2020-01-11 11:05:12
问题 How is it possible to get the message from key in the custom validator ?! As mentioned in Struts 2 - reusing Custom Expression Validator you can get default message as : public void validate(Object o) throws ValidationException { //Do some logic addActionError(getDefaultMessage()); } 回答1: Your custom validator should extend ValidatorSupport class, which has a convenient method getMessage(Object object) to get i18n messages set with key parameter. So inside validate method instead of calling

angular-translate does not display character accent or umlaut correctly

时光怂恿深爱的人放手 提交于 2020-01-11 08:04:08
问题 I started using angular-translate. Works great! But a translated character � is displayed for characters with umlaut or accent or ... (like ü or ú or ñ). These same character values are displayed correctly in HTML text and as AngularJS variables. Here's a sample output. The output for html text and angular variable display correctly. The results from $translate filter and directive don't display the correct umlaut character. html text - Und sie untersützt mehrere Sprachen! angular variable -

Internationalization in SSRS

╄→尐↘猪︶ㄣ 提交于 2020-01-11 05:11:05
问题 What's the best way to handle translations for stock text in a SSRS . For instance - if I have a report that shows a grid of contents what's the best way to have the correct translation for the header of that grid show up, assuming the culture of the report is set correctly. Put another way - is it possible to do resources in a SSRS report, or am I stuck with storing all that text in the database and querying for it? 回答1: AS far as I know, there is no way to localize a report (meaning

Changing Date format to en-us while culture is fr-ca

喜欢而已 提交于 2020-01-11 04:36:26
问题 I'm working on localizing a website in French. However I am not supposed to change the date format to French. It must remain as per en-us format even if the culture is set to fr-ca i.e, when rest of the contents are in French, the date format should still be in English(en-us). 回答1: To change how dates are formatted you could create a custom CultureInfo, based on an existing CultureInfo (in your case "fr-CA"), modifying only the date formats. I don't have any experience in this, but the linked

Getting OS language in java

為{幸葍}努か 提交于 2020-01-11 02:30:31
问题 I'm running into a kind of problem here. I'm French and working on an English version of Windows XP. Therefore, I set the regional options to French, but still have an English language UI. I'm working on a small Java SE application, and decided to internationalize it using resources bundle. To display the proper language, I create the bundle with this function : private static ResourceBundle bundle = ResourceBundle .getBundle("locale.Strings", Locale.getDefault()); But the Locale.getDefault()

How do I use Unicode characters in Pod and perldoc?

三世轮回 提交于 2020-01-10 12:10:32
问题 I need to use utf-8 characters in my perl-documentation. If I use: perldoc MyMod.pm I see strange characters. If I use: pod2text MyMod.pm everything is fine. I use Ubuntu/Debian. $ locale LANG=de_DE.UTF-8 LC_CTYPE="de_DE.UTF-8" LC_NUMERIC="de_DE.UTF-8" LC_TIME="de_DE.UTF-8" LC_COLLATE="de_DE.UTF-8" LC_MONETARY="de_DE.UTF-8" LC_MESSAGES="de_DE.UTF-8" LC_PAPER="de_DE.UTF-8" LC_NAME="de_DE.UTF-8" LC_ADDRESS="de_DE.UTF-8" LC_TELEPHONE="de_DE.UTF-8" LC_MEASUREMENT="de_DE.UTF-8" LC_IDENTIFICATION=

Which Version of StringComparer to use

别等时光非礼了梦想. 提交于 2020-01-10 08:45:42
问题 If I want to have a case-insensitive string-keyed dictionary, which version of StringComparer should I use given these constraints: The keys in the dictionary come from either C# code or config files written in english locale only (either US, or UK) The software is internationalized and will run in different locales I normally use StringComparer.InvariantCultureIgnoreCase but wasn't sure if that is the correct case. Here is example code: Dictionary< string, object> stuff = new Dictionary<

Strange I18n date output with rails

人走茶凉 提交于 2020-01-10 04:55:10
问题 I've got a strange problem with date translations in my Ruby On Rails 3 application, and I really don't understand why... Here are my en.yml and fr.yml : fr: date: formats: default: "%d/%m/%Y" short: "%e %b" long: "%e %B %Y" time: formats: default: "%d %B %Y %H:%M:%S" short: "%d %b %H:%M" long: "%A %d %B %Y %H:%M" am: 'am' pm: 'pm' en: date: formats: default: "%Y-%m-%d" long: "%B %d, %Y" short: "%b %d" time: am: am formats: default: ! '%a, %d %b %Y %H:%M:%S %z' long: ! '%B %d, %Y %H:%M' short

How to quit an iPhone app nicely?

早过忘川 提交于 2020-01-10 03:15:07
问题 or "How to simulate a home button pressed event?" I need to restart my iPhone app, and I want the program to quit, so the user will only have to start it. If I simply use exit(0) some changes won't get saved, as they would if the user quits by pressing the home button. The restart needed for language change. Related code: - (void)onChangeLanguage: (id)sender { NSArray *lang = [NSArray arrayWithObjects:((Whatever *)sender).newLanguage, nil]; [[NSUserDefaults standardUserDefaults] setObject

Credit Card validation: can Card Name contain non-ASCII characters?

社会主义新天地 提交于 2020-01-09 19:06:20
问题 Can the Card Name (i.e. the cardholder name, not the card type) contain non-ASCII characters? Example: "JOSÉ GONZÁLEZ". 回答1: The character set that is used does not allow for diacritics. In brief, it only allows uppercase ASCII characters. The restriction ultimately comes from the historical way in which banking cards encode data onto the magnetic stripe (as defined in ISO 7811). The data is encoded in a 7 bits per character format known as ITU-T.50 The cardholder name is encoded with up to