Open
Reported for: WPML Multilingual CMS 4.5.0
Overview of the issue
In the past, WordPress and WPML always assumed the default language of strings was English.
Though it is now possible to change the default language of strings with WPML (and therefore translate strings from another language into English), you still cannot import or export strings in English in the Import / export .po section.
Workaround
You can follow the following steps to solve the problem, while we work on a permanent solution:
- Make sure that you have the latest WPML version
- Open …/wp-content/plugins/wpml-string-translation/menu/string-translation.php file.
You will need to modify in 3 different locations - First, look for lines 640 and 748 and replace this line:
<?php foreach($active_languages as $al): if($al['code']==$string_settings['strings_language']) continue; ?>
- With:
<?php foreach($active_languages as $al): ?>
- Then, look for line 655 and remove this code:
if ( $al['code'] == $string_settings['strings_language'] ) { continue;}
- Finally, Go to WPML > String Translation and please select Also create translations according to the .po file and choose English from the dropdown, (it should appear after the code changing), then import them.
This issue goes waaaaayyyyyy back… but there actually is a solution: https://wpml.org/forums/topic/string-translation-export-problem/#post-1184692
But important tip: You have to remove the mentioned code twice (for export AND import):
if ( $al['code'] == $string_settings['strings_language'] ) {
continue;}
Thank you!
Yes, indeed this is a valid solution for the issue described here.
Hello.
The link doesn’t work.
Can you post it again please?
Hey there,
The link is not longer needed, the errata was updated a while ago.
Regards
So, can we use the original instructions from this post?
Thank you.
Yes, please. If that does not help, don’t hesitate to open a ticket in our support forum.
Regards