內容簡介
更改 WordPress 網站的語言為英語以外的任何語言會減慢頁面生成時間。很多。這是由於文本域加載的方式緩慢和效率低下所引起的。PO 和 MO 文件是設計用於與 PHP Gettext 擴展一起使用。但由於它是一個擴展,它沒有安裝在大多數主機平台上。為了克服這個障礙,WordPress 重新實現了整個 MO 文件解析過程,但 WordPress 的實現方式相當緩慢和消耗內存。
該插件使用另一種比默認更快的 MO 解析實現來替換默認的 MO Reader。僅加載使用的文本域(從版本 4.6 開始,這也是 WordPress 的默認行為)以及從這些文本域中僅加載使用的翻譯。它還利用 mo 文件中包含的哈希表,而這些表在 WordPress 的默認實現中被完全忽略了。為了進一步提高性能,如果安裝了對象緩存,插件還會將翻譯緩存到對象緩存中。為了達到最佳性能,您需要一個快速的對象緩存後端,如 Redis、Memcached 或 APC(u)。
Fast Translate 是 WP Performance Packs 本地化改進的一個極簡分支。 WP Performance Pack 提供了更多的 WordPress 性能控制和優化,例如使用 PHP 的本地化擴展、改進的圖像處理和 CDN 支持。
外掛標籤
開發者團隊
原文外掛簡介
Changing the WordPress site language to any other than English slows down page generation times. A lot. This is caused by the slow and inefficient way of text domain loading. PO and MO files are designed to be used with PHP Gettext-extension. But since it’s an extension, it’s not installed by defalt on very hosting platform. To overcome this barrier, WordPress has re-implemented the whole MO file parsing in PHP, but WordPress’ implementation is quite slow and memory intense.
This plugin replaces the default MO-Reader with another implementation of MO parsing, which is faster than the default one. Only used text domains are loaded (since version 4.6 this is also WordPress’ default behaviour) and from these only used translations are loaded. It also makes use of hash tables included in mo files, which are ignored completely by WordPress’ default implementation. To boost the performance even more, the plugin also caches translations to the object cache, if one is installed. For optimal performance you need a fast object cache backend like Redis, Memcached or APC(u).
Fast Translate is a minimalistic fork of WP Performance Packs localization improvements. WP Performance Pack offers additional control and more optimizations for WordPress performance, e.g. use of PHPs native gettext extension, improved image handling and CDN support.
