This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 13 replies, has 2 voices.

Last updated by Bruno 4 years, 8 months ago.

Assigned support staff: Bruno.

Author Posts
December 9, 2014 at 3:31 pm #525652

edwardL-3

I am trying to: Add Chinese and Japanese translation to my Theme. The site has already been translated to Chinese, and we've been running this site for a year already. Right now we're trying to translate it to Japanese.

For now, my theme (Truepixel by MyThemeShop) seems to be putting the translated strings in the database. (Screenshot attached)

WPML Does scan the strings, but when I say add or change a translation in the string translation page, the front end doesn't change, the string is still the same string from Truepixel.

Is WPML able to override Truepixel's built-in translation panel?

And just wondering if this is the proper way to go about translating the theme into Chinese/Japanese?

Edward

December 9, 2014 at 6:05 pm #525765

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Yes, this should be possible, since the WPML is finding strings.

I'll ask for some information so I can verify the problem. The fields for you to insert the credentials will be below its comment field.

Please let me know exactly what steps should I follow to see the problem.

Note: Please make a full backup of your site.

Thank you.

December 10, 2014 at 2:38 am #525915

edwardL-3

Actually, now I'm encountering another issue, all of my media are not connected to my posts anymore.

I will create an account for you, need to get these issues fixed asap.

But is there any way you can test these fixes without having the readers see it?

Edward

December 11, 2014 at 1:02 am #526601

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Are you using any plugin cache or your server is using a caching system?

Also, may I kindly ask you please to open a new ticket for your new question? This will also help other users with similar problems find solutions when searching the forum.

Thank you.

December 11, 2014 at 4:28 am #526626

edwardL-3

Hi Bruno,

There is a cache layer, but I connect straight to the specific server, and hard refresh. It's always worked for everything else, including editing file templates live.

Edward

December 12, 2014 at 1:45 am #527322

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Maybe you can remove that string and scan your theme again. This can solve the problem.

To remove, just select the checkbox next to the string and then click on the "Delete selected strings" button.

To scan the theme, please click on the WPML > Theme and plugins localization. Be sure that the 'Translate by WPML.' option is selected. Scroll down the page and look for the "Strings in the theme" option. Click on the "Scan the theme for strings" button. This will scan the theme to find the strings.

Please in WPML > String Translation, check if the strings are available for translation. Translate the strings and check if the frontend is working properly.

Please, before you follow the steps above, make a full backup of your database.

Please let me know if this solves the problem and if I can help with anything else.

Thank you.

December 14, 2014 at 11:58 am #528119

edwardL-3

Yup, I've just tried that, doesn't work. I've also tried .po .mo files, doesn't work either.

December 14, 2014 at 12:27 pm #528124

edwardL-3

I've added zh_TW.po and .mo files manually, and have set textdomain to WPML, and it's working.

However, I cannot get ja.po and .mo working. I've added the wp-content/languages .po .mo, and have placed the files in the theme location. Everything looks good as it displays the files exist. however, when i'm under mydomain.com/jp (i've set it to jp), the text shown are still from zh_TW.po.

December 16, 2014 at 2:45 am #529032

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

I'll ask for some information so I can verify the problem. The fields for you to insert the credentials will be below its comment field.

Please let me know exactly what steps should I follow to see the problem.

Note: Please make a full backup of your site.

Thank you.

December 17, 2014 at 3:04 pm #530315

edwardL-3

Hi,

Let me show you this screenshot. zh_TW.mo works. ja.mo is detected, but anything changed in ja.mo doesn't make a diff, and even in japanese subdomain teepr.com/jp (I manually created jp instead of ja)
, it does not use the ja.mo file.

December 17, 2014 at 3:25 pm #530336

edwardL-3

Could it be this code here:

if (!empty($mts_options['translate'])) {
    $mts_translations = get_option('mts_translations_'.'truepixel');//$mts_options['translations'];
    function mts_custom_translate( $translated_text, $text, $domain ) {
        if ($domain == 'mythemeshop' || $domain == 'nhp-opts') {
        	// get options['translations'][$text] and return value
            global $mts_translations;
            
            if (!empty($mts_translations[$text])) {
                $translated_text = $mts_translations[$text];
            }
        }
    	return $translated_text;
        
    }
    add_filter( 'gettext', 'mts_custom_translate', 20, 3 );
}
December 17, 2014 at 3:55 pm #530365

edwardL-3

BTW, Bruno, is there a way to reach you like on live chat or something? much easier to communicate that way.

December 17, 2014 at 4:31 pm #530389

edwardL-3

Solved it, via a re-scan using string translation.

December 17, 2014 at 4:36 pm #530396

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

I'm glad you solved the problem. As I suggested above, you could re scan the theme.

Thank you.