WPML
Status
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:



    1. Make sure that you have the latest WPML version

    2. Open …/wp-content/plugins/wpml-string-translation/menu/string-translation.php file. You will need to modify in 3 different locations

 

  1. First, look for lines 640 and 748 and replace this line:
    <span class="token delimiter important"><?php</span> <span class="token keyword">foreach</span> <span class="token punctuation">(</span> <span class="token variable">$active_languages</span> <span class="token keyword">as</span> <span class="token variable">$al</span> <span class="token punctuation">)</span> <span class="token punctuation">:</span> <span class="token keyword">if</span> <span class="token punctuation">(</span> <span class="token variable">$al</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'code'</span><span class="token punctuation">]</span> <span class="token operator">==</span> <span class="token variable">$string_settings</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'strings_language'</span><span class="token punctuation">]</span> <span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">continue</span><span class="token punctuation">;</span><span class="token punctuation">}</span> <span class="token delimiter important">?></span>


  2. With:
    <?php foreach($active_languages as $al):  ?>  


  3. Then, look for line 655 and remove this code:
    											if ( $al['code'] == $string_settings['strings_language'] ) {
    												continue;}


  4. 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.

All known issues →