Internationalization, English is called internationalization word too long, and is referred to as i18n (take the head to take the middle of the tail 18 letters) without shouting, this is OK! Then look at internationalization, which means that the
Original article: Workshop.
Use j2se API to read properties files1. Use the load () method of Java. util. properties classExample: inputstream in = lnew bufferedinputstream (New fileinputstream (name ));Properties P = new properties ();P. Load (in )
1. Introduction
1.1 Model-View-controller (MVC) Design Mode
Fixme-a general introduction to this mode is required. For more information, see design patterns of the Mechanical Industry Press.
1.2 map MVC concepts to struts Components
The struts
1. The getresourceasstream () method of javax. servlet. servletcontext can be used in servlet.Example: inputstream in = context. getresourceasstream (PATH );Properties P = new properties ();P. Load (in );
2. Use the load () method of Java. util.
Use J2SE API to read Properties files1. Use the load () method of java. util. Properties classExample: InputStream in = lnew BufferedInputStream (new FileInputStream (name ));Properties p = new Properties ();P. load (in );2. Use the getBundle ()
20145301 "Java Program design" Eighth Week study summary textbook Learning content Summary 15th part-General API Common API
LOG: Log information security is significant, audit, forensics, intrusion detection, etc. will use the log message
Not only the famous Struts2, even a small Java program can be internationalized, it is not as much as the internet said, non-western characters, such as our Chinese, island of Japanese and so on, must use Native2ascii transcoding, Frank,
In Java development, some of the variable configuration parameters need to be placed in the XML configuration file or in the properties configuration file. XML configuration files, however, need to be parsed by DOM or SAX, and it is easier to read
JSTL Fmt:formatnumber Date, number, currency format
Use tags should be imported first
Its URI can be under the Fmt.tld file
1. Date format
Value: Date to format
Pattern: Format of date formatting
2 Number Format
In the development of the Android project, the resources that need to be used in the Assets resource folder can be written in the form of a file that will be used for the convenience of public resources. Properties or. json, and read. In the hybrid
The LogRecord class wraps the messages logged to a Logger . You can either logs a LogRecord directly to a Logger , or has the Logger wrap what's logged in a LogRecord . That's, all logging methods on the that does not take Logger a would LogRecord
Method for obtaining the current path in Java
1. system. getproperty ("user. dir") Relative Path of the current user directory.
2. This. getclass (). getresource ("") is also the absolute URI path of the current classpath.
3. classloader.
The internationalization of software is also called
I18nQuestion: Let's look at two cases.
Case 1: Google
First, let's take a look at Google's homepage.
As we all know, Google pages can be switched between Simplified Chinese, traditional Chinese,
Use j2se API to read properties files
1. Use the load () method of Java. util. properties classExample: inputstream in = lnew bufferedinputstream (New fileinputstream (name ));Properties P = new properties ();P. Load (in );
2. Use the getbundle ()
Internationalization is mainly the introduction of Messagesource, we simply look at how to use, and its principle.1.1 Setting Up resource filesCreate a new i18n directory in propertiesCreate a new message file:Messages.propertieserror.title=Your
1. Locale IntroductionLocale says the region. Each of the locale objects represents a specific geographical, political and cultural area.This is often used when manipulating dates, calendar, and other objects that represent date/time, because
Note 1. Related knowledge
The 1.1 Java programming language is the first programming language to support software localization from the outset.
All strings use Unicode
1.2 Content to localize:
Number 123,456.78 England; 123.456,78
Generally speaking, the content of the home page is more, but most of the content also has repeated places, for example, a few pieces of content are articles, only the article categories, or a few pieces are goods, but the classification of goods is
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.