Discover javascript internationalization, include the articles, news, trends, analysis and practical advice about javascript internationalization on alibabacloud.com
"Spring" Internationalization support
first, the overall structure:Content in two international resources:Second, the procedure2.1 Configuring the Spring context Beans.xml file
xml version="1.0" encoding="GBK"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spri
The ZF2 site language configuration item is the "translator" item in MODULE.CONFIG.HP:where "locale" specifies which language the project uses, and then ' pattern ' = '%s.mo ' in ' translation_file_patterns ', automatically maps to ' pattern ' = ' zh_cn.mo '. The file is saved/under the module/application/language/directory. At the same time, it can be seen that the directory also contains other national language files, for example, "En_us.mo", "Zh_tw.mo" and so on. In addition, you can see that
Most of the spring framework supports internationalization, just like SPRINGMVC. Dispatcherservlet enables you to dynamically configure in the local language of the client. This is done through the localeresolver.When a request arrives, Dispatcherservlet will look for Localeresolver and will attempt to localize it if found. Using the Requestcontext.getlocale () method we can get the localized language of locale resolver interpretation.Locale resolvers
The Java programming language was the first to be designed as a fully internationalized language, and from the outset he had an attribute necessary for effective internationalization: Using Unicode to process all strings. Support for Unicode makes it very convenient to write programs to manipulate strings in multiple languages under the Java programming language. Now the emergence of NetBeans again helps us to reduce the international workload is real
Last time I said the internationalization process, now look at the specific internationalization of the relevant code.
In the code, we use TR () to mark the strings that need to be translated. The Lupdate tool is to extract the relevant strings from the TR () function. The TR () function is a static function of the Qobject class, and its signature is as follows:
Static QString tr (const char *sourcetext,
the output of exception information
about the internationalization of struts2
Internationalization Configuration
Configure the following information in the total file to represent the read configuration information for the internationalized resource bundle
preparing internationalized Resource Files
Under the SRC and the path. Create an internationalized resource properties file (res_zh_cn.properties,
Internationalization Overview
To enable Web projects to support internationalization, you need to identify each user's preferred region and display content based on that region. In a spring MVC application, the user's region is identified by a zone parser, which must implement the Localeresolver interface.Spring MVC provides several localeresolver implementations where we can parse the region according to
Data | Database Database character internationalization is the most questions you ask, such as MySQL database you may add USEUNICODE=TRUEAMP;CHARACTERENCODING=GBK as a basic condition for Chinese support in Jdbc-url. But this sometimes destroys the integrity of the data, if some people are careless, it will lead to data coding errors, generated garbled. Therefore, we need some means of coding within the program. It is generally easy to use string enco
Description: Qt provides an international solution that enables dynamic language switching without restarting the application during program use.
1. Steps to achieve language internationalization
To achieve language internationalization, you need to perform the following steps:
A. All text information visible to the user is encapsulated using TR ()
Note: The source code with the Utf-8 character set, the
of the picture, point them separately, and then go to the relevant files on the hook. The next three pictures are the same operation.After the build, you can see the following file on the left column.Let's test how to configure the static text.First, drag a lable control onto the storyboard, and then name the lab.Let it relate to ViewController.h.Write the relevant international information in Localizable.string's Chinese and English documents respectively. The most thing to note here is the di
controlled by expression: "This is controlled through expression." Of course, the premise is that language is Java, if it's groovy or something else that doesn't have the Equals method;(3) The form of resource bundle is implemented : This method needs to set the properties of the resource bundle on the report, the property value is the name of the i18n file to be read, then the corresponding internationalized file needs to be added under Classpath. Then right-click the element, Edit expression,
Cocos2d-x 3.2 Monopoly game project development-Part 1 internationalization-Solving Chinese Garbled text
Solve the Chinese Garbled text first. cheyiliu, a netizen, provides a simple solution as follows. If you have a better solution, please provide it.
1. Compile the plist file string_zh.plist to display Chinese characters in the file:
Single_game
Single Player
Multi_game
Mult
Ruby on Rails internationalization, rubyrails
Language-related settings and strings should not be used in views, models, and controllers. The text should be moved to the language file under config/locales.
When the tags of the ActiveRecord model need to be translated, the scope of activerecord is used:
en: activerecord: models: user: Member attributes: user: name: "Full name"
Then User. model_name.human will return "Member", and User. human_a
(messagesourceresolvable resolvable, locale locale) throws nosuchmessageexception;
For example, we define the following message in the property file[Java]View PlainCopy
userdetails.islocked= user has been locked
userdetails.usernotfound= user {0} does not exist
Then use the GetMessage methodGetMessage ("userdetails.islocked", null,null)//user has been lockedGetMessage ("userdetails.islocked", New object[]{"admin"},null)//user admin does not existUsercache configuration, i
A spring-supported general TAG LIBRARY1.Second, to achieve internationalization with 1. Configure Reloadableresourcebundlemessagesource, which can it has the ability to reload Mes Sage Properties without recompiling or restarting the application.1 PackageSpittr.web;2 3 ImportOrg.springframework.context.MessageSource;4 ImportOrg.springframework.context.annotation.Bean;5 ImportOrg.springframework.context.annotation.ComponentScan;6 Importorg.springframe
Windows Client development-Preparing for internationalization
A good windows client, of course, must be internationalized.
Today, we will introduce several functions to obtain the language used in the windows operating system.
GetSystemDefaultLCID FunctionThis function is very simple and has no parameters. Only the returned values are:Returns the locale identifier for the system locale
GetSystemDefaultUILanguage
Retrieves the language identifier for t
IOS internationalization. Automatic switching based on different languages of the system.First of all. Select Project Add new file-->ios-->resource-->strings file. Named Localizable.stringsOpen localizable.strings. It's formatted like this."KEY" = "CONTENT";Please write in this format, for example I am here to define"TestKey" = "qingjoin_english";And then. We return to the corresponding code.NSString *str2 =nslocalizedstring (@ "TestKey", nil);NSLog (
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.