最近の更新

関連


その他いろいろ

多機能フィードリーダSynapse製作中

2月までは目が回るほど忙しい

MODxでつくる! 最強のCMSサイト カバー
MODxでつくる! 最強のCMSサイト

Multilingual Switcher (English ver)

Switch (automatically) among prepared sub-language documents/templates
初出:2007年04/04 更新:2007年04/22

この文書のキーワード: なし

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-LanguageRefererURL(alias)The Document to be shown
ja,endoc-jadocdoc
doc-jadoc-ja
docdocdoc
doc-jadoc-ja
other, or no refererdoc, doc-jadoc-ja

Required Envirionment

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 &nothingIfMono 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 DL2007 04/02多言語振り分け/リストアップ