亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? internationalization.html

?? java good!
?? HTML
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
<html>

<head>
<TITLE>jGuru: Internationalization</TITLE>
<style>
<!--
a{text-decoration:none;}
a:hover{color:6699cc; }
body{background-color:white;}
-->
</style>
</head>

<BODY BACKGROUND="images/watermark.gif" BGCOLOR="#FFFFFF" LINK="#006699" VLINK="#006699">

<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr><td bgcolor="#336699" colspan=2 align=right><img src="images/topbar.gif" width=600 height=14 alt="" border="0"></td></tr>
<tr><td colspan=2>&nbsp;</td></tr>
<tr valign=top>

<td valign="top" width="140"><div align="center"><img src="images/logo.gif" width=78 height=90 alt="" border="0"></div>
<font color="#0000FF" size="1" face="verdana,arial,helvetica"><strong><br>

	<a href="contents.html">COURSE NOTES</a><br><img src="images/spacer.gif" width=1 height=4 alt="" border="0"><br><img src="images/spacer.gif" width=1 height=4 alt="" border="0"><br><a href="index.html">MODULE INTRO</a><br><img src="images/spacer.gif" width=1 height=4 alt="" border="0"><br>
<!-- AFTER GUTTER -->

<img src="images/spacer.gif" width=140 height=1 alt="" border="0">
</strong></font>
</td>

<TD valign=top align=left>

<!-- START CONTENT -->

<H1><strong>Internationalization</strong></H1>
<H2><a name="locIntro">What is Localization?</a></H2>
<p><em>Localization</em> is the ability to customize a program to the user's language (e.g., for prompts and
error messages) and display characteristics (e.g., for how to display times and dates).
The different customizations are defined by individual areas or regions, each called
a <tt><a href="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Locale.html">Locale</a></tt>.</p><p>Before you can localize any programs, you need to isolate the locale dependent pieces. This
isolation process is called <em>internationalization</em>. In the simplest case, this involves the moving of all
<tt>String</tt> constants into something called a
<tt><a href="http://java.sun.com/products/jdk/1.2/docs/api/java/util/ResourceBundle.html">ResourceBundle</a></tt>. However, resource bundles are not
restricted to just text messages and may include images, sounds, and numeric information. And this
isn't the only step involved.</p><H2><a name="locLocale">The Locale Object</a></H2>
<p>A <tt>Locale</tt> is specified by adding a trailing string to an identifier that specifies a <tt>ResourceBundle</tt>. The first three letters are an underscore ('_') and a two character language code (lowercase). The next three are an underscore and
a two character country code (uppercase). This is because not everyone speaking the same language speak the same dialect. For instance, Quebec and France have different variations on the French language. <tt>_fr_FR</tt> is France French, while <tt>_fr_CA</tt> is French Canadian.</p><p>A locale, then, defines a specific local area, without specifying any other details about that area's needs.  The class <tt>Locale</tt> resides in the <tt>java.util</tt> package. 
Several classes provide methods that return instances of <tt>Locale</tt>.</p><p>
To construct a locale manually, use code resembling
</p><pre>
Locale l = 
  new Locale(String lang, String country, 
             String variant);
</pre><p>or</p><pre>
Locale l = 
  new Locale(String lang, String country);
</pre><p>Every runtime has a default locale, which you can acquire using</p><pre>
Locale l = Locale.getDefault();
</pre><p>You can also set the default locale by setting system properties; however, this is not recommended, since the user may have set his own default <tt>Locale</tt>, and this would override those settings.</p><pre>
// dangerous
Properties p = System.getProperties();
p.put("user.language", "fr");
p.put("user.region", "CA");
System.setProperties(p);
</pre><p>Some objects may set their own locale, which would override the default locale. Those objects (including all AWT Components) implement a <tt>getLocale()</tt> method.
If no locale is set, it returns the default locale.</p><p>To retrieve a list of all the available locales, use
<tt>Locale list[] = DateFormat.getAvailableLocales();</tt>. 
The <tt>locale.toString()</tt> method returns the concatenated locale value, e.g. 
<tt>"_fr_FR"</tt> (French / France),
<tt>"_fr_CA"</tt> (French / Canada), or
<tt>"_en_US"</tt> (English / United States).
To retrieve the individual locale "components" as strings, use
<tt>locale.getLanguage()</tt>,
<tt>locale.getCountry()</tt>, and
<tt>locale.getVariant()</tt>.
</p><H2><a name="locDemo">Why You Need It</a></H2>
<p>
<center><img  src="images/class.gif"/>
</center>
</p><p>Imagine taking this program and trying to run it in Italy and Finland. While it will run, there are a few internationalization issues:</p><ul>
<li>All text labels are in English</li>
<li>The Date display format is specific to the United States</li>
<li>The Money display format is specific to US $</li>
<li>The map image and city listed are in the United States</li>
</ul><p>You'll now see how you can internationalize the application.</p><H2><a name="locResBund">Resource Bundles</a></H2>
<p>In order to localize labels, you need to pull them all out and do lookups at runtime.
The means to do this is through the <tt>ResourceBundle</tt> class. Resource bundles
provide a simple key-value lookup and may be provided via <tt>.class</tt> or <tt>.properties</tt> files.
(Other means can also be provided, however you would have to do all the work yourself.)</p><p>To provide a lookup list via a class, you subclass 
<tt><a href="http://java.sun.com/products/jdk/1.2/docs/api/java/util/ListResourceBundle.html">ListResourceBundle</a></tt> and override the
<tt>getContents</tt> method to return an <tt>Object[][]</tt>. For each pair of elements in the array, the first would be the lookup key and the second the value for the key for the given <tt>Locale</tt>.</p><pre>
import java.util.ListResourceBundle;
public class training-labels-bundle
    extends ListResourceBundle {
  static final Object[][] contents = {
    { "Date",     "Date: " },
    { "Cost",     "Cost: " }, 
    { "Location", "Location: " },
    { "Title",    "Training" }
  };
  protected Object[][] getContents() {
    return contents;
  }
}
</pre><p>In the <tt>training-labels-bundle</tt> defined above, four lookup labels define four properties:</p><ul>
<li>Date</li>
<li>Cost</li>
<li>Location</li>
<li>Title</li>
</ul><p>You would then use this bundle to lookup resources in a two step process: load the resource list and search it. To load the list, use <tt>ResourceBundle.getBundle()</tt>. This will load the bundle for the appropriate <tt>Locale</tt>. Since there is only one so far, and it is the default, the <tt>training-labels-bundle</tt> one is what is loaded.</p><pre>
Locale locale = getLocale();
ResourceBundle labels = ResourceBundle.getBundle (
    "training-labels-bundle", locale);
</pre><p>Once you have a bundle, you lookup entries via its <tt>getString()</tt> method:</p><pre>
p.add (new Label (labels.getString("Date")));
</pre><p>The program for the figure shown above can now include the following:</p><pre>
ResourceBundle labels = ResourceBundle.getBundle (
    "training-labels-bundle", locale);
p.add (new Label (labels.getString("Date")));
p.add (new Label (labels.getString ("Cost")));
p.add (new Label (labels.getString ("Location")));
add (new Label (labels.getString ("Title"),
    Label.CENTER), BorderLayout.NORTH);
}
</pre><p>Then, if you want the program to support Italy and Finland locales to display localized labels, you would have to create two new classes: <tt>training-labels-bundle-it</tt> and <tt>training-labels-bundle-fi</tt>. In these classes, only those entries that were different
in the new locale would need to be specified in the bundle. Now that three bundles are defined, based on the current locale setting, the <tt>getBundle()</tt> method would fetch and load the appropriate class.</p><p>For Finland, the appropriate bundle would be:</p><pre>
public class training-labels-bundle-fi 
          extends ListResourceBundle {
  static final Object[][] contents = {
    { "Date",     "P&auml;iv&auml;m&auml;&auml;r&auml;: " },
    { "Cost",     "Hinta: " }, 
    { "Location", "Sijainti: " },
    { "Title",    "Koulutus" }
  };
  protected Object[][] getContents() {
    return contents;
  }
}
</pre><p>For Italy, the appropriate bundle would be:</p><pre>
public class training-labels-bundle-it extends ListResourceBundle {
  static final Object[][] contents = {
    { "Date",     "Data: " },
    { "Cost",     "Costo: " }, 
    { "Location", "Posto: " }
  };
  // The Training title remains the same (or addestramento)
  protected Object[][] getContents() {
    return contents;
  }
}
</pre><H3><a name="locPropRes">Property Resource Bundles</a></H3>
<p>In addition to providing resource bundles as <tt>ListResourceBundle</tt> classes, you can provide <tt><a href="http://java.sun.com/products/jdk/1.2/docs/api/java/util/PropertyResourceBundle.html">PropertyResourceBundle</a></tt>s. These are property files where each resource is specified on its own line as text, as in <tt>Date=June 3, 2000</tt>. Property resource bundle files are named <tt>Bundlename</tt><i>_Localization</i><tt>.properties</tt>.</p><p>The previously described program requires three properties for the actual date, cost, and location map. You can create another bundle in filename <tt>training-settings-bundle.properties</tt> for this information. Since this information is likely to change more frequently, it makes sense to be editable by a human, without requiring recompilation.</p><pre>
Date=June 3, 2000
Cost=1200.00
Map=SMarea.gif
</pre><p>For Finland, the appropriate bundle file would be named <tt>training-settings-bundle-fi.properties</tt> and may include:</p><pre>
Cost=6240
Map=ilmakuva.gif
</pre><p>For Italy, the appropriate bundle file would be named <tt>training-settings-bundle-it.properties</tt> and may include:</p><pre>
Cost=2168400.00
Map=Milan.gif
</pre><p>This assumes the date for all three classes would be the same at the different locations.</p><p>Access to <tt>PropertyResourceBundle</tt> members is identical to <tt>ListResourceBundle</tt>:</p><pre>
ResourceBundle settings = ResourceBundle.getBundle(
    "training-settings-bundle", locale);
String date = settings.getString("Date");
String cost = settings.getString("Cost");
String filename = settings.getString("Map");
</pre><H2><a name="locFormats">Locale-Specific Formats</a></H2>
<p>Once you've pulled all your string constants into resource bundles, its not time to figure out how to display that information. For instance, dates, numbers, and messages may be displayed differently based upon where one is located.</p><H3><a name="locDate">Date Formatting</a></H3>
<p>Display formats of dates are not universal. Is "1/2/99" January 2nd or February 1st? It depends.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看视频91| av影院午夜一区| 国产福利91精品| 色呦呦一区二区三区| 7777精品伊人久久久大香线蕉最新版| 欧美精品一区视频| 亚洲一级二级三级| 国产毛片精品一区| 欧美一区二区三区性视频| 亚洲特级片在线| 国产剧情一区在线| 日韩欧美第一区| 亚洲美女免费在线| 国产美女在线精品| 日韩欧美在线不卡| 午夜亚洲国产au精品一区二区| 不卡视频在线看| 中文字幕欧美日韩一区| 国产一区 二区| 欧美成人video| 美女视频一区在线观看| 欧美日韩在线亚洲一区蜜芽| 综合色中文字幕| 国产成人在线色| 久久综合一区二区| 久久成人免费日本黄色| 欧美一区二区三区免费视频| 午夜精品在线看| 欧美日韩视频一区二区| 亚洲伊人伊色伊影伊综合网| 日本精品一区二区三区四区的功能| 中文在线一区二区| 成人综合激情网| 亚洲欧洲精品天堂一级| 国产jizzjizz一区二区| 国产欧美一二三区| 成人午夜电影网站| 国产精品久久久久永久免费观看 | 国产精品乱人伦一区二区| 国内精品伊人久久久久影院对白| 欧美不卡一区二区三区四区| 免费视频最近日韩| 26uuu久久天堂性欧美| 国产乱妇无码大片在线观看| 国产精品网站一区| 99精品黄色片免费大全| 亚洲免费看黄网站| 欧美日韩一本到| 青青国产91久久久久久| 久久精品一区二区| av中文字幕亚洲| 亚洲综合一区二区| 91精品国产综合久久精品| 久久99国内精品| 欧美国产日本视频| 色婷婷综合激情| 日韩有码一区二区三区| 久久新电视剧免费观看| av在线不卡电影| 午夜久久久影院| 久久久久久久久久看片| 色综合天天天天做夜夜夜夜做| 亚洲成人你懂的| 久久影院午夜论| 91色porny在线视频| 五月激情丁香一区二区三区| 精品sm在线观看| 99国产精品久久久久| 日韩专区欧美专区| 中文字幕乱码亚洲精品一区 | 国产中文一区二区三区| 国产精品视频麻豆| 欧美日韩久久久久久| 久久精品国产网站| 最新久久zyz资源站| 日韩久久久精品| 色综合久久久久| 激情综合色播激情啊| 亚洲综合一二区| 久久影院电视剧免费观看| 欧美无砖砖区免费| 懂色av中文字幕一区二区三区| 石原莉奈一区二区三区在线观看 | 日韩一区二区在线看片| 99久久精品国产观看| 日韩av不卡在线观看| 亚洲欧洲日本在线| 欧美精品一区二区高清在线观看| 91福利资源站| 91一区在线观看| 青青草国产成人av片免费 | 精品999久久久| 欧美日韩精品一区二区在线播放 | 欧美三级视频在线| 风流少妇一区二区| 激情文学综合插| 日韩在线播放一区二区| 一区二区三区免费在线观看| 欧美激情一区三区| 日韩欧美中文字幕一区| 欧美巨大另类极品videosbest| 一本色道久久综合狠狠躁的推荐| 欧美性受xxxx黑人xyx性爽| 国产在线看一区| 美女视频黄免费的久久| 亚洲成a人片在线不卡一二三区| 亚洲视频小说图片| 国产精品久久久久久户外露出| 日韩美女一区二区三区四区| 欧美日韩中文字幕一区二区| 91啦中文在线观看| 91碰在线视频| 91香蕉国产在线观看软件| 成人ar影院免费观看视频| av中文字幕在线不卡| 不卡大黄网站免费看| youjizz久久| www.日韩av| 99国产精品一区| 在线观看国产一区二区| 一本久久综合亚洲鲁鲁五月天| 成人aaaa免费全部观看| 97se亚洲国产综合自在线观| 色婷婷av一区二区三区大白胸 | 久久99在线观看| 久久99精品国产.久久久久久| 另类专区欧美蜜桃臀第一页| 蜜桃在线一区二区三区| 激情欧美一区二区三区在线观看| 国产乱码精品一区二区三区五月婷| 国产精品自拍一区| 成人黄页毛片网站| 欧美午夜一区二区| 欧美一级黄色录像| 欧美激情一区二区| 一区二区三区四区国产精品| 婷婷久久综合九色国产成人| 麻豆成人久久精品二区三区红 | 欧美一区日韩一区| 日韩欧美色综合网站| 国产日韩精品一区二区浪潮av| 亚洲日本在线观看| 日韩综合一区二区| 成人美女视频在线观看18| 一本色道久久综合精品竹菊| 欧美精品乱码久久久久久| www亚洲一区| 亚洲人成网站在线| 国产在线观看免费一区| 久久66热re国产| 成人小视频在线观看| 在线视频国内自拍亚洲视频| 精品理论电影在线观看| 中文字幕亚洲不卡| 日韩精品欧美精品| 丁香啪啪综合成人亚洲小说 | a级精品国产片在线观看| 欧美性高清videossexo| 欧美精品一区视频| 一区二区三区精品视频| 国产一区二区三区在线观看免费视频| av资源站一区| 日韩精品最新网址| 亚洲va国产天堂va久久en| 国产精品18久久久| 欧美巨大另类极品videosbest | 精品一区二区三区日韩| 91免费版在线看| 精品国产髙清在线看国产毛片 | 一区二区三区四区高清精品免费观看| 免费观看一级特黄欧美大片| 色婷婷综合五月| 久久免费看少妇高潮| 亚洲国产成人av网| 成人va在线观看| 久久免费视频色| 青椒成人免费视频| 欧美日韩中文另类| 中文字幕精品三区| 国产精品乡下勾搭老头1| 3atv一区二区三区| 一区二区三区产品免费精品久久75| 国产精品一区二区男女羞羞无遮挡| 欧美日韩视频在线观看一区二区三区| 亚洲欧洲在线观看av| 国产成人亚洲综合a∨猫咪| 日韩网站在线看片你懂的| 亚洲激情综合网| 91网站最新地址| 日本一区二区免费在线| 九九精品一区二区| 亚洲精品一区二区三区影院 | 成人午夜短视频| 久久精品视频网| 国产激情视频一区二区三区欧美| 精品欧美久久久| 日韩av电影天堂| 91精品福利在线一区二区三区 | 国产不卡视频一区| 国产亚洲一区二区三区四区|