WPML
Status
Resolvido
Relatado para
WPML String Translation 3.0.7
Resolvido em
3.0.8

Visão geral do problema

Ao salvar uma página, você pode encontrar um erro como este:

An error of type E_ERROR was caused in line 57 of the file /srv/htdocs/wp-content/plugins/wpml-string-translation/classes/translations-file-scan/translations-file/wpml-st-translations-file-locale.php. Error message: Uncaught RuntimeException: Unable to parse the language from the translations file /srv/htdocs/wp-content/languages/plugins/ in /srv/htdocs/wp-content/plugins/wpml-string-translation/classes/translations-file-scan/translations-file/wpml-st-translations-file-locale.php:57 

Stack trace: 

#0 /srv/htdocs/wp-content/plugins/wpml-string-translation/classes/translation-files/jed/wpml-st-script-translations-hooks.php(72): WPML_ST_Translations_File_Locale->get() 

#1 /srv/htdocs/wp-content/plugins/wpml-string-translation/classes/translation-files/jed/wpml-st-script-translations-hooks.php(40): WPML_ST_Script_Translations_Hooks->get_file_locale('/srv/htdocs/wp-...', 'jetpack') 

#2 /wordpress/core/5.3.2/wp-includes/class-wp-hook.php(288): WPML_ST_Script_Translations_Hooks->override_jed_file('/srv/htdocs/wp-...', 'jetpack-blocks-...', 'jetpack') 

#3 /wordpress/core/5.3.2/wp-includes/plugin.php(206): WP_Hook->apply_filters('/srv/htdocs/wp-...', Array) 

#4 /wordpress/core/5.3.2/wp-includes/l10n.php(1076): apply_filters('load_script_tra...', false, 'jetpack-blocks-...', 'jetpack') 

#5 /wordpress/core/5.3.2/wp-includes/l10n.php(1035): load_script_translations(false, 'jetpack-blocks-...', 'jetpack') 

#6 /wordpress/core/5.3.2/wp-includes/class.wp-scripts.php(574): load_script_textdomain('jetpack-blocks-...', 'jetpack', '') 

#7 /wordpress/core/5.3.2/wp-includes/class.wp-scripts.php(363): WP_Scripts->print_translations('jetpack-blocks-...', false) 

#8 /wordpress/core/5.3.2/wp-includes/class.wp-dependencies.php(106): WP_Scripts->do_item('jetpack-blocks-...', 0) 

#9 /wordpress/core/5.3.2/wp-includes/class.wp-scripts.php(633): WP_Dependencies->do_items(Array, 0) 

#10 /wordpress/core/5.3.2/wp-includes/script-loader.php(2510): WP_Scripts->do_head_items() 

#11 /wordpress/core/5.3.2/wp-includes/class-wp-hook.php(288): print_head_scripts('') 

#12 /wordpress/core/5.3.2/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array) 

#13 /wordpress/core/5.3.2/wp-includes/plugin.php(478): WP_Hook->do_action(Array) 

#14 /wordpress/core/5.3.2/wp-admin/admin-header.php(132): do_action('admin_print_scr...') 

#15 /wordpress/core/5.3.2/wp-admin/edit-form-blocks.php(402): require_once('/wordpress/core...') 

#16 /wordpress/core/5.3.2/wp-admin/post.php(179): include('/wordpress/core...') 

#17 {main} thrown

Isso é algo relacionado ao WPML Tradução de Strings e à análise dos arquivos do plugin.

Estamos investigando o caso e tentando encontrar uma correção adequada para isso.

Solução alternativa

Como solução alternativa, você pode acessar wpml-string-translation/classes/translations-file-scan/translations-file/wpml-st-translations-file-locale.php e alterar o código:

			default:
				throw new RuntimeException( 'Unable to parse the language from the translations file ' . $this->filepath );

para:

			default:
				return: '';

Todos os problemas conhecidos →