Manual:$wgLanguageCode/ja

From MediaWiki.org
Jump to: navigation, search
ローカライゼーション: $wgLanguageCode
サイトの言語コード。
導入されたバージョン: pre 1.1.0
削除されたバージョン: 使用中
可能な値: (string)
デフォルトの値: 'en'

他の設定: アルファベット順 | 機能順


Contents

詳細 [edit]

サイトの言語コードです。./language/Language(.*).phpファイルの中の一つでなければなりません。The code should be in lower case and use hyphen as separator. Examples: en, ku-latn, de-formal, mai.

この指定によってページの内容がある言語を指定して、またwikiのインターフェイスのためのデフォルトの言語も規定します。ユーザーがプリファレンスでインターフェイスメッセージの言語を繰り替えることが出来る一方で、匿名の訪問者は内容の言語、すなわちで$wgLanguageCodeによって指定された言語でwikiインターフェイスで見ることになります。Language selector extension provides way to autodetect the language of anonymous users and let them choose their interface language without logging in.

注 : If you change this after installation, in MediaWiki 1.18 and above you can clear the message cache by running echo 'MessageCache::singleton()->clear()' | php maintenance/eval.php. Be prepared to update all messages you have customized in your wiki, move your main page and other broken things before and after all caches has been regenerated.

注 : MediaWikiのバージョンが1.8もしくはそれより古く、インストレーションの後でこれを変更する場合、ユーザーインターフェイス(MediaWikiの名前空間)をリビルドするためにmaintenance/rebuildMessages.phpスクリプトを実行しなければなりません。さもなければ、新しい言語でインターフェイスが見つからないか、古い言語と新しい言語が混ざることになります。スクリプトを実行することで以前作成したかもしれないカスタムのインターフェイスメッセージが上書きされることがあります。

注 : $wgContLanguageCode gives the same value as $wgLanguageCode, but is deprecated in favor of $wgLanguageCode.

利用者の既存の言語設定の変更 [edit]

You can change existing users' language settings with the userOptions.php maintenance script. They will still be able to change their settings back unless you disable that option (see below).

php userOptions.php language --old en --new cs

利用者の言語選択の無効化 [edit]

MediaWiki バージョン: 1.16

If you want to have your wiki in a certain language and not allow users to change this setting, there is a new variable in 1.16 and above, $wgHiddenPrefs:

// disable language selection
$wgHiddenPrefs[] = 'language';
// if you want to disable variants as well
$wgHiddenPrefs[] = 'variant';
$wgHiddenPrefs[] = 'noconvertlink';
$wgLanguageCode[] = 'pt-br';

関連項目 [edit]

言語: English  • Deutsch • français • 日本語 • polski