?? i18n.htm
字號(hào):
<html>
<head>
<title>i18n tutorial</title>
<link href="style-1.0/css/tigris.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="app">
<h3>Localization and internationalization</h3>
<p>Although all themes coming with CalendarXP are in English, it's very easy
to localize them into your own language. Moreover it's quite simple to setup
an i18n framework with your cgi server to provide multi-language support of
your website. This tutorial will help you deal with them fast.</p>
<div class="app">
<h4>How to localize a theme?</h4>
<p>Pick up any theme at hand and take a look at the source, you'll find all
text strings in the calendar are externalized here. So what's next? Just
translate the English strings to your own language strings and modify the
theme css to use corresponding font family. </p>
<p>Certain languages may need a charset different than the default one, in which case you just need to set the <strong>6th parameter of the name & id of iframe calendar tag</strong> with the correct charset - please refer to helloworld the beginner's tutorial for details. e.g.</p>
<div class="app">
<div class="dottedBox">
<p><code><iframe name="gToday:normal:agenda.js:::<strong>utf-8</strong>" id="gToday:normal:agenda.js:::<strong>utf-8</strong>" src=...></code></p>
</div>
</div>
<p> </p>
</div>
<div class="app">
<h4>How to get i18n work on the page?</h4>
<p>I18n, a.k.a internationalization, is to make your page available in different
languages at the same time. You'll be preparing resources in different language
and feeding the browser with the one chosen by the end user.</p>
<p>First, you need to localize the theme you choose into different languages
and name them with specific suffixes. e.g. For mini theme localized in French,
we can have mini_fr.css and mini_fr.js. If you were to use any strings in
plugins or agendas, you may either create plugins_fr.js and agenda_fr.js
accordingly, or externalize the text strings into an array and append it
to mini_fr.js.</p>
<p>Next, you need to create server-side wrappers for the engine files so that
a correct charset encoding header will be sent to the browser. The wrapper
is nothing but a file with a http charset setting and an "include"
tag in the syntax of the cgi tech your server employed. Taking ASP as example,
we need to create the <em>iflateng.asp</em> as following: (You may need to do same thing for nflateng.asp if you need to support Netscape 4.x)</p>
</div>
<blockquote>
<div class="app">
<div class="dottedBox">
<p><code><%<br>
</code><code> Response.Charset=Request.QueryString("sel_charset")<br>
%><br>
<!-- #include file="iflateng.htm" --></code></p>
</div>
</div>
</blockquote>
<div class="app">
<div class="app">
<p>Copy the file into the same directory where the iflateng.htm engine file is located, then modify the calendar tag to use the wrapper file as the
code source accordingly. e.g.</p>
</div>
<blockquote>
<div class="app">
<div class="dottedBox">
<p><code><iframe name="gToday:mini:agenda.js" id="gToday:mini:agenda.js"<br>
src="iflateng.asp" ...><br>
</iframe></code></p>
</div>
</div>
</blockquote>
<p></p>
<p>Finally, dynamically generate the theme name and <code>sel_charset</code>
according to the language/charset used in your page.</p>
<blockquote>
<div class="dottedBox">
<p><code><iframe name="gToday:mini_<%=selected_language%>:agenda.js"
id="gToday:mini_<%=selected_language%>:agenda.js"<br>
src="iflateng.asp?sel_charset=<%=selected_charset%>"
...><br>
</iframe></code></p>
</div>
</blockquote>
<p>The <code>selected_language</code> can be "fr", "cn"
or any language code used by your localized theme. The <code>selected_charset</code>
can be "iso-8859-1", "gb2312" or any charset employed
by your theme correspondingly.</p>
<p> </p>
<p>Note: the server-side wrappers approach can also be replaced by setting the 6th parameter of the name & id to the correct charset. e.g.</p>
<blockquote>
<div class="app">
<div class="dottedBox">
<p><code><iframe name="gToday:normal:agenda.js:::<%=selected_charset%>" id="gToday:normal:agenda.js:::<%=selected_charset%>" src=...></code></p>
</div>
</div>
</blockquote>
<div class="app">
<div class="app">
<p></p>
</div>
</div>
<p></p>
<hr size="1">
<div align="right"><font size=-2><em>Copyright© 2003-2007 Idemfactor Solutions,
Inc. All rights reserved.</em></font></div>
<p> </p>
<p> </p>
<p> </p>
</div>
</div>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -