Multilingual Switcher (English ver)
This document is a translation of original Japanese document. I am afraid of so much grammatical errors included below. If you could, I would be glad to have pointing out of those or the unclear meanings. (Gmail: uglydog.7bit)
notice
The recent version of Multilingual Switcher 2.00 is quite different from 1.10. The instruction below is obsolete for it. Please read comments in multilingual-router.php.
I am rather busy to translate the Japanese instruction above. Please wait for a while...
Introduction
Multilingual Listing provides two ways for the visitors to jump to alternative language page.
The first method works automatically. The plugin Multilingual Router looks up Accept-Language request header from the browser, and try to find the document in specified language.
The second way is more manual. If the document supports another language, Multilingual Listing snippet (it may be placed in a template or so) list up links to the available alternative language page. This function contradicts to the first one, so if the visitior came from same but written in alternative language document, Multilingual Router does nothing (and he/she will see the actual document as the URL).
Identical document in another languages are recoginzed by the alias. For example, 'doc', 'doc-fr', 'doc-ja', are regarded as the same ones.
Here is a sample case below. (en(English) as the default language)
| Accept-Language | Referer | URL(alias) | The Document to be shown |
|---|---|---|---|
| ja,en | doc-ja | doc | doc |
| doc-ja | doc-ja | ||
| doc | doc | doc | |
| doc-ja | doc-ja | ||
| other, or no referer | doc, doc-ja | doc-ja |
Required Envirionment
- Friendly URL: ON
- Alias Path: OFF (no experience on alias path:ON)
How to Use
Please write site-global inclusive available languages in $available_lang (Snippet, Router).
the first one ($available_lang[0]) will be regarded as the default.
The default setting below is for English, French, Japanese.
$available_lang = array('en', 'fr', 'ja');
$available_lang_name = array('English', 'François', '日本語');
Create Multilingual Router plugin and check to "OnWebPageInit" Event.
Write
[[MultilingualListing]]
at where you would like to show the language switching list.
At here, the snippet searches
some-document (English) some-document-fr (French) some-document-ja (Japanese)and the found ones are constructed to a list. (if you don't want to show links when there are no alternative languages, set ¬hingIfMono as `1`.)
You might notice that the English document has no prefix. This is because the default language ($available_lang[0]) is 'en'.
Download
| バージョン/DL | 日付 | 概要 |
|---|---|---|
| 1.10 | 2007 04/02 | 多言語振り分け/リストアップ |
