Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a client with a wordpress theme, Nevada, and we are having trouble making the built in translations work for it. The theme contains .mo files for English, German, and Slovenian, and appear to be found by our WPML plugin. However, they are not translating any of the template text inside the theme. Translations of content we have created is working fine.

Following the instructions here: http://wpml.org/documentation/getting-started-guide/theme-localization/ , looking at section "Option 2: Using a .mo file for theme localization", it sounds like all I need to do is enter the textdomain for the theme.

Problem is, I don't know what it is, or how to find it. I tried digging through the theme files themselves but any text output is abstracted away behind many many layers of functions. To make matters worse, neither I or my client have a support account with the theme providers (but we do have a valid license!) and they are not being helpful at all.

How can I find the text domain to make WPML work with this theme?

Update

When I open one of the .po files I see lines like:

#: template-part-teaser.php:41
#@ Nevada
msgid "404 Error"
msgstr "404 Error"

So I tried entering "Nevada" as the textdomain in the WPML plugin, but this did not change anything for me

share|improve this question
    
I didn't want to distract from the content of either answer, but I must mention that "Nevada" was the proper text-domain, but the piece of text I wanted to be translated wasn't configured for localization. Instead of mucking with the .po files, I used the transposh plugin to do the translation. –  parker.sikand Jun 28 '13 at 2:30
add comment

3 Answers

Within the code, can you see any syntax like either of the following?

__( 'Hello, dear user!', 'my-text-domain' )

_e( 'Your Ad here', 'my-text-domain' )

That is, strings starting with __ (double underscores) or _e. If so, where the above says my-text-domain, you should find the name of your text domain.

share|improve this answer
    
Looking through many of the theme files, I did not find these particular functions. Like I said, they are abstracted way away somewhere deep in the code. However, in my case, the text domain was defined in the themes functions.php file. I found the load_theme_textdomain() call. –  parker.sikand Jun 28 '13 at 2:21
add comment

In most cases, @vancoder's answer is absolutely correct. My situation appears to be fairly unique, but I want to share my experience so it may help someone else.

In the case of this Nevada theme, the standard functions are not used in the template files. Apparently, Nevada uses the Lambda framework (something totally foreign to me) and so any text output occurs with a lambda_translate function call. After digging and digging, I gave up on trying to trace these functions back to a __() or _e() call.

Instead, to find the text domain, I put on my Linux hat and entered this command in the Nevada theme folder.

grep -r "load_theme_textdomain" .

Sure enough, in the functions.php file, the load_theme_textdomain function was there with the text-domain.

share|improve this answer
add comment

I agree that @vancoder's answer is correct.

What I don't understand though is why you don't let WPML take care of the translations in addition to whatever is found in the .mo file(s)?

See screenshot below of Theme and plugins localization submenu of WPML.

Cannot attach image here, screenshot: https://www.evernote.com/shard/s19/sh/b72eb4b3-93e0-4384-90cd-bdc18e975307/e97f149bfa2a535fda940dee46030c45

share|improve this answer
    
Like I mentioned in my comment, the piece of text that I wanted translated wasn't configured for WPML and the .po/.mo files. I didn't feel like editing the theme files and translating this text by hand, so I decided to use the Transposh plugin, which worked quite nicely for me. –  parker.sikand Jun 28 '13 at 16:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.