internationalization

EL variable in JSF ResourceBundle

寵の児 提交于 2019-12-07 05:42:06
问题 i read somewhere (don't find it anymore) that i can use EL Expresions in the resource bundle and then use it without changes in *.xhtml files. some.text=#{someBean.stepsLeft} more to switch the position of the variable in different languages. But actually it wont work. I can use Interpolator class to handle the parsing or add some.text.before some.text.after and let one of them empty. I would prefer it to use it without interpolator.interpolate() if possible. 回答1: JSF resourcebundles does by

JSF Internationalization f:loadbundle or through faces-config: Performance point

隐身守侯 提交于 2019-12-07 05:23:55
问题 There are two ways to load the properties file into JSF 2.0. Global Resource Bundle To load the properties file globally, so that all the jsf pages can access the messages. You can create a “faces-config.xml” file and declare the properties file explicitly. faces-config.xml <?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com

Regular expression that allows letters (like “ñ”) from any language

笑着哭i 提交于 2019-12-07 04:46:41
问题 trying to let users use special characters in other languages such as Spanish or French. I originally had this: "/[^A-Za-z0-9\.\_\- ]/i" and then changed it to "/[^\p{L}\p{N}\.\_\-\(\) ]/i" but still doesn't work. letters such as "ñ" should be allowed. Thanks. Revision: I found that adding a (*UTF8) at the beginning helps solve the problem. So I'm using the following code:"/(*UTF8)[^\p{L}A-Za-z0-9._- ]/i" Revision: After looking at the answers I decided to use: "/[^\p{Xwd}. -]/u". Thanks(It

change file encoding

巧了我就是萌 提交于 2019-12-07 04:10:35
问题 I have a problem with character encoding in some HTML pages. It seems that the cause of the problem is that some of the .html files are not saved as UTF-8 encoded files. Even though I have instructed Eclipse to save these files as UTF-8, when I open them in a browser, it indicates that the files are ISO-8859-1. How can I change the encoding of these files to UTF-8? UPDATE: I already have the following included in the section of each webpage <meta http-equiv="Content-Type" content="text/html;

Should perl's File::Glob always be post-filtered through utf8::decode?

落爺英雄遲暮 提交于 2019-12-07 04:02:49
问题 The output of the following minimal example shows that (on my linux machine) File::Glob seems to have the unexpected side-effect of converting a utf8 string to non-utf8: #!/usr/bin/perl use utf8; use strict; my $x = "påminnelser"; my $y = glob $x; print "x=",utf8::is_utf8($x),"=\n"; print "y=",utf8::is_utf8($y),"=\n"; This is causing wrong behavior in my program. On linux, it looks like I can fix it by applying utf8::decode() after File::Glob. Is this the right way to fix this? Is this a bug

How to do extreme branding/internationalization in .NET

随声附和 提交于 2019-12-07 03:02:40
问题 We are planning a pretty big application. -We want to internationalize our application for 30 countries. -In most countries 1 to 6 different brands are available. -Each combination of a certain locale like 'de' and brand like 'XXX' might occur multiple times therefore we need another identifier to get something unique: "locale_brand_siteorigin" Therefore we have .resx file like: Configurations. de.burgerking.px10 .resx The bold printed is the unique identifier. During runtime we create a: var

Internationalization using “i18n-content” in Google Chrome

不想你离开。 提交于 2019-12-07 03:02:27
问题 The official documentation recommends retrieving strings for internationalization like so: document.querySelector("#appname").innerHTML = chrome.i18n.getMessage("appname"); However, the source code for the built-in pages such as the new tab page and the in-tab settings page (an example here) use a different method which doesn't require setting up additional JavaScript commands: <title i18n-content="appname"></title> I've tried to use this in my own web applications and extensions, but I can't

Seeking source for localized Countries, Languages and Region names

不想你离开。 提交于 2019-12-07 02:56:25
问题 I seek a source for the world's main language names, country names, and territory names, localised into a long list of languages. Example of localised names of languages: EN EN English EN ES Inglés ES EN Spanish ES ES Español Example of localised names of a certain country in south-west Europe: ES ES España ES FR Espagne ES EN Spain Any idea where can I take/build that from? 回答1: You can find the information you are looking for in the Unicode Common Locale Data Repository (CLDR) here: http:/

How can I match a Russian word using preg_replace in PHP?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 01:42:24
问题 How do I go about matching a Russian word in a string (also in Russian) in PHP? So for example something like this: $pattern = '/слово/'; preg_replace($pattern, $replacement, $string_in_russian) I tried utf8_encode and htmlentities with UTF-8 flag for $pattern, but it didn't work. Should I also encode $string_in_russian? Update: Suggestion for /u flag didn't work so I'm putting the actual code I need this for. It is from a glossary plugin for Wordpress (my site is properly setup to use

Dynamic language switching in an Eclipse RCP application

心不动则不痛 提交于 2019-12-07 01:40:37
问题 I am working on an Eclipse RCP application with localization. A user should be able to change the language used in the application on the fly. A restart of the application should not take place during this language switch. It should also be possible to switch between languages written from left to right and languages written from right to left. Is there a (good) way to solve this problem? 回答1: According to this thread: Most of the eclipse libraries load up their language info on widget