ARC中文动保小百科(APpedia)国际水准的动物保护百科全书 - Internationalizations
主页/关于APpedia - 编辑方法 - 小百科最近更新 - 站内搜索 - 关于动物权利的条目 - 在线咨询

 

ARC中文动保小百科(APpedia)是第一本中文的动物保护百科全书,编辑研究员团队包括海内外杰出的动物保护专家和个人。百科主要以在线方式发布(电子书)并长期扩充改进,是希望成为专业动保工作者、动保学者的朋友的必读材料。百科条目覆盖范围广,学术水平一流,核心条目由编辑团队按重要性选择,并征集研究员编写相应的初稿。所有核心条目发表前均通过质量审核程序,内容以介绍国际最前沿的动物保护知识研究为目标。读者可以自由改进和扩充百科内容。

精彩推荐

以下为主要条目

Share |

Internationalizations

阅读[Internationalizations]最新版本请访问:http://APpedia.arc.capn-online.info Copyright © ARC中文动保小百科
版权说明(转载条目必读) ARC中文动保小百科邮件地址:
APpedia@arc.capn-online.info
分类 浏览全部完成的百科条目:http://APpedia.arc.capn-online.info/all

PmWiki supports internationalization (internationalisation) of web pages, allowing accented characters to appear in page names and almost complete customization of PmWiki's prompts. Most customization is provided via the XLPage() function in PmWiki, which loads a set of translation variables from a wiki page (typically named XLPage, but it can be named anything you wish).

Loading Translation Pages

Pages for many languages such as French, German, Dutch, and Spanish have already been created and maintained at the pmichaud.com site. You can download an archive of these translations from http://www.pmichaud.com/pub/pmwiki/i18n.tgz. Simply unpack the archive into the directory containing your pmwiki.php installation. The archive contains a number of page files that are placed in your wikilib.d/ directory, and some special scripts for translations that use a character set other than iso-8859-1 (PmWiki's default).

Once the translation pages are installed, you enable a language by adding a call to XLPage() in your config.php file. For example, to select French language prompts, one would specify

XLPage('fr','PmWikiFr.XLPage');

which says to load the translations for French ('fr') from the page PmWikiFr.XLPage. It's perfectly okay to load multiple pages; so if you want to create your own local translations without changing the ones you got from i18n.tgz, just create another page (see below) and load it on top. Be sure that you load first the page with your local chances:

XLPage('fr','PmWikiFr.XLPageLocal');  # my local translations
XLPage('fr','PmWikiFr.XLPage');       # from i18n.tgz

If your intention is to offer multiple languages on your site, and use WikiGroups as language selectors, you may want to place this code in local customizations files (see PerGroupCustomizations?). For example, if your site is published in French and English, and the French pages are in a group called Fr, you could create a file named Fr.php in the local/ directory which contains:

<?php if (!defined('PmWiki')) exit();
##change to French language
XLPage('fr','PmWikiFr.XLPage');

You may wish to create a page called PmwikiFr.php with the same content to access the French documentation in the PmwikiFr group. En.php is not necessary in this case since English is the default language.

An alternative to the above would be to add to config.php the following, which tests if there is an XLPage in a group, and if it finds one it gets loaded:

    
$xlpage = FmtPageName('$Group.XLPage', $pagename);
if (PageExists($xlpage)) XLPage($xlpage, $xlpage);

With this method you would need to copy any relevant XLPage into any group which needs the different language support.

Creating New Translations

If language pages don't exist for your desired language, it's easy to create one! An XLPage translation file simply contains lines of the form

'phrase' => 'translated phrase',

where "phrase" is an internationalized phrase (denoted by ...) in PmWiki's $...Fmt variables, and "translated phrase" is what should be printed in your particular language. For example, the line (in PmWikiFr.XLPage)

'SearchWiki' => 'Rechercher',

converts "SearchWiki" to "Rechercher" on output. The file PmWiki:XLPageTemplate is a good starting point for creating a new XLPage and has most of PmWiki's key phrases already listed in it. Note that the translation mechanism only converts phrases that have been listed as translatable in $...Fmt strings--it won't translate things that appear in wiki markup.

If you create new versions of PmWiki pages in other languages, please consider adding them to the main PmWiki site so that they can be made available to others in the i18n.tgz archive!

The term "i18n" is commonly used as an abbreviation for the English word "internationalization". The abbreviation is derived from the fact that there are 18 letters between the "i" and the final "n" and few people want to type them all out.

Tools for PmWiki Localization

You can help to localize PmWiki in your language in the original site:

<< Uploads administration | DocumentationIndex | Wiki Farms >>

If my wiki is internationalized by config.php, how do I revert a specific group to English?

Use $XLLangs = array('en'); in the group.php configuration file.

主页(关于ARC中文动保小百科) - 编辑使用手册 - 小百科最近更新 - 在小百科内搜索(使用Google)
本文最后更新于 2006 年 08 月 06 日, 03:47 下午

Animal Rights, New Welfarism, Reverence for Animals, Animal Welfare, Naturalness, Autonomy of Animals, Animal Experimentation, Wildlife Protection, Spiritual Power of Animals, and more...

free stats