- ステータス
- 解決済み
- 解決されたバージョン
- 3.0.3
問題の概要
WPML > 言語で、言語(または追加したカスタム言語)に誤ったロケールを設定した場合、その言語にアクセスした際に次のような致命的なエラーが発生することがあります:
Fatal error: Uncaught RuntimeException: Language of .../wp-content/languages/plugins/sitepress-ar3.mo cannot be recognized in ...wp-contentpluginswpml-string-translationclassestranslations-file-scantranslations-filewpml-st-translations-file-locale.php on line 65
( ! ) RuntimeException: Language of .../wp-content/languages/plugins/sitepress-ar3.mo cannot be recognized in ...wp-contentpluginswpml-string-translationclassestranslations-file-scantranslations-filewpml-st-translations-file-locale.php on line 65
Call Stack
# Time Memory Function Location
1 0.4015 410016 {main}( ) ...index.php:0
2 0.4017 410296 require( '...wp-blog-header.php' ) ...index.php:17
3 0.4017 410840 require_once( ...wp-load.php' ) ...wp-blog-header.php:13
4 0.4019 411368 require_once( '...wp-config.php' ) ...wp-load.php:37
5 0.4019 416200 require_once( '...wp-settings.php' ) ...wp-config.php:97
6 0.4676 3677216 do_action( ) ...wp-settings.php:394
7 0.4676 3677592 WP_Hook->do_action( ) ...plugin.php:465
8 0.4676 3677592 WP_Hook->apply_filters( ) ...class-wp-hook.php:310
9 0.4923 3975520 SitePress->plugin_localization( ) ...class-wp-hook.php:286
10 0.4923 3975584 load_plugin_textdomain( ) ...sitepress.class.php:3350
11 0.4923 3975728 load_textdomain( ) ...l10n.php:791
12 0.4923 3975728 apply_filters( ) ...l10n.php:621
13 0.4923 3976128 WP_Hook->apply_filters( ) ...plugin.php:208
14 0.4923 3977632 WPMLSTMOHooksLoadTextDomain->overrideLoadTextDomain( ) ...class-wp-hook.php:286
15 0.4923 3978112 WPML_ST_Translations_File_Locale->get( ) ...LoadTextDomain.php:59
回避策
現在、このエラーの修正に取り組んでいます。
WPML > 言語 > 言語を編集でロケールを修正することをお勧めします。
管理画面にアクセスできない場合は、WPML 文字列翻訳を一時的に無効にしてください。最適な方法は、FTPで/wp-content/plugins/フォルダーにアクセスし、フォルダー名を別の名前に変更することです。
一時的なパッチとして、ファイルwpml-string-translation/classes/translations-file-scan/translations-file/wpml-st-translations-file-locale.phpの65行目を編集し、以下を置き換えます:
throw new RuntimeException( 'Language of ' . $this->filepath. ' cannot be recognized' );
変更後:
return '';