Preferred Languages

外掛說明

有了語言套件的架構設計,網站管理員及網站使用者要變更網站介面的主要語言比以往簡單的多;但是在某些情況下,網站介面僅顯示單一地區語言並不夠。當 WordPress 無法找到與使用者瀏覽器語言相符的語言套件時,便會以英文顯示網站介面;這對許多非英語使用者而言,並不是良好的使用者體驗。

這個功能專案能讓可登入管理後台的使用者選擇多種語言以顯示 WordPress 的本地化介面。如此一來,這些使用者便能設定後援鍊結順序,讓 WordPress 依照這項順序設定,嘗試依序載入介面語言套件以顯示本地化介面。

請協助我們進行測試,並讓我們了解這個外掛的運作不如預期之處。

鍵盤快速鍵

  • 向上鍵:將選取的語言套件上移一位。
  • 向下鍵:將選取的語言套件下移一位。
  • Home:選取清單中的第一個語言套件。
  • End:選取清單中的最後一個語言套件。
  • Backspace/Delete:從清單中移除選取的語言套件。
  • Alt + A:將下拉式選單中選取的語言套件新增至清單中。

注意事項:Preferred Languages 外掛的介面需要點擊操作才能使用鍵盤快速鍵。

整合語言套件

依照預設,僅會載入已設定的地區語言及範圍的語言套件,但是當語言套件的譯文不完全時,未翻譯的介面字串仍會以英文顯示,而這是不好的使用者體驗。

為了避免發生這種狀況,preferred_languages_merge_translations 可用於整合多個不完整的語言套件,並提供以下 3 個參數:

  1. $merge:決定哪些語言套件應該整合使用。
  2. $domain:Text Domain。
  3. $current_locale:網站目前的地區語言設定。

注意事項:在 WordPress 6.5 或更新版本中,這項功能 (指載入多個語言套件檔案) 會預設啟用,在 WordPress 6.4 或更舊版本中,可能會造成網站緩慢或耗損主機效能,建議審慎使用這項功能,並僅在特定網站中執行。

共同參與

這個外掛的開發工作,目前均於 GitHub 上進行。

如想參與專案,請先查看待解問題,並加入 WordPress 專屬 Slack#core-i18n 頻道。如果尚未註冊 WordPress 專屬 Slack 帳號,請前往 make.wordpress.org/chat/ 完成註冊。

螢幕擷圖

  • 位於 [設定]→[一般] 的網站新語言設定區段
  • 位於使用者個人資料的網站新語言設定區段

使用者評論

2023 年 1 月 18 日 1 則留言
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 存放庫