Skip Navigation

Resolved

Reported for: WPML String Translation 3.0.7

Resolved in: 3.0.8

Overview of the issue

On saving a page you can have an error like this one:

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

This is something related to WPML String Translation and the scanning of the plugin files.
We are investigating the case and attempting to find a proper fix for this.

Workaround

As a workaround, you can go to wpml-string-translation/classes/translations-file-scan/translations-file/wpml-st-translations-file-locale.php and change the code:

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

to:

			default:
				return: '';

4 Responses to “String translation causes fatal error on saving a post on WordPress dot com”