1

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

1
  • 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. Commented Jun 28, 2013 at 2:30

2 Answers 2

4

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.

1
  • 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. Commented Jun 28, 2013 at 2:21
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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