Preferred Languages

説明

言語パックの導入により今までよりも格段に簡単にサイトの言語が変更できるようになりました。しかし一つのロケールだけでは事足りない場合もあります。WordPress は有効なロケール用の翻訳を見つけられなかった場合、自動的に原文の英語の文字列を使用しますが、これはたくさんの非ネイティブな英語話者にとってはあまりフレンドリーではありません。

この機能の目的はユーザーに複数個の表示させる言語を選択させることにより、その問題を解決することです。これにより「フォールバックチェイン」を作成することが出来、WordPress が翻訳を読み込む際に好きな順番に設定した言語からロードさせることが可能になります。

このプラグインをテストして、うまく動作しない点があればお知らせください。

キーボードショートカット

  • カーソルキー上: 選択したロケールを1つ上に移動します。
  • カーソルキー下: 選択したロケールを1つ下に移動します。
  • Home: リストの最初のロケールを選択します。
  • End: リストの最後のロケールを選択します。
  • Backspace / Delete: 選択したロケールをリストから削除します。
  • Alt+A: ドロップダウンで選択したロケールをリストに追加します。

: キーボードショートカットを使用するには、プラグインの UI にフォーカスが当たっている必要があります。

翻訳のマージ

デフォルトでは、ドメインに対し、リスト内で利用可能な優先ロケールが見つかれば、その翻訳ファイルのみを読み込みます。
ところがこの方法では、翻訳ファイルが不完全だった場合、文字列の一部が英語のまま表示されてしまいます。
これはユーザー体験として好ましくありません。

これを防ぐには、preferred_languages_merge_translations フィルターを使用して、不完全な翻訳をマージすることができます。
3つのパラメータが利用できます:

  1. $merge – 翻訳をマージするかどうか。
  2. $domain – テキストドメイン。
  3. $current_locale – 現在のロケール。

注: 本機能は WordPress 6.5以降、デフォルトで利用可能になります。以前のバージョンの WordPress では、本機能により低速化、高負荷が発生する可能性があります。そのため、特定のサイトでのみ、慎重にご利用ください。

貢献する

開発は現在 GitHub で行われています。

開発に協力したい方は、イシューをチェックして、Slack#core-i18n チャンネルに参加してください。Slack アカウントをまだ持っていなければ、make.wordpress.org/chat/ から登録できます。

スクリーンショット

  • '設定' -> '一般' 内の新しい言語セクション
  • プロファイル内の新しい言語セクション

評価

2023年1月18日 1 reply
I honestly think that this should be a core feature of WP. The only thing wrong I notice is that when you are looking at the front end... The language of the admin bar changes into the site language but that's the only issue I have with this plugin at the time of writing. For the rest, it's a dream plugin.
2021年3月20日
a very cool plugin. this is a truely great plugin, You can use it for many purposes. It works great right out of the box, but is very easy to customize to suit your needs. my current use-case: i use this plugin to power up my page - which has visitors from several european Countries. I’m using this plugin to manage a small job-site: And i have to say: I love this plugin. And if it comes to support: it is so awesome to see that all is documented so well and good: You can do so much with this plugin: if you need to customize it towards your special use-case: just look at the documentation (and again have a look at the docs) Read those instructions – they are written so well, people. There’s a lot of detail there and alltogehter i have to say: it’s super well documented! Amazing job: i love this plugin, from me 5 stars - (i would give even more if it would be possible) keep up this awesome and outstanding job - it rocks!!!
2022年1月17日
I think this should be in Core for websites with several possible languages. I like it very much! Specially I appreciate that each user can also choose languages from the selected languages. (I am developing a translation plugin for my own needs to use Google Translate to translate posts/pages and complement it.)
2020年8月26日
An indispensable plugin for sites that use a language with formal/non-formal variant. This should become a WordPress core functionality!
17件のレビューをすべて表示

貢献者と開発者

Preferred Languages はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献しています。

貢献者

“Preferred Languages” は31ロケールに翻訳されています。 翻訳者のみなさん、翻訳へのご協力ありがとうございます。

“Preferred Languages” をあなたの言語に翻訳しましょう。

開発に興味がありますか ?

コードを閲覧するか、SVN リポジトリをチェックするか、開発ログRSS で購読してみてください。

変更履歴

プラグインの変更履歴については、GitHub リポジトリにアクセスしてください。