Support Forums for LiveMesh Themes & Plugins › Forums › Invent Theme Support › Translation files not having an effect
- This topic has 7 replies, 3 voices, and was last updated 9 years ago by schercka.
-
AuthorPosts
-
April 18, 2015 at 7:22 am #13531scherckaMember
Hi I cannot get mo and po files to kick in.
I edit the invent.pot file in poedit, save it and compile an mo file. But when I go to my site and for example look at staff members, the filter still says ‘Specializations’ in the link, even though I’ve changed it.
What am I missing. Do I need to create an en_EN.po to use in english or does the theme use the invent.mo as standard??? No changes I make are having an effect, so I must be missing something very basic about editing and publishing translations. Seems simple enough in poedit, but its not being used in the site.
April 18, 2015 at 12:27 pm #13543RaghavendraModeratorYou need to create en_EN.po file to see the translation. The invent.pot file is just a template to start with and cannot be used directly for translation without renaming.
April 21, 2015 at 6:34 am #13595scherckaMemberThanks – I realize this is not support specific to the template, but I am really having a hard time with it. I appreciate your support.
So it’s still not working. Here’s what I’ve done:
1) I’ve opened invent.pot and saved it as en_EN.po.
2) I’ve made a translation in Poedit to the 404 error page message “The page you requested…”
3) I’ve chosen ‘Compile to MO’ and saved a en_EN.mo file.
4) I’ve placed both the en_EN.mo and en_EN.po in the invent/languages folder.And it’s still not having an effect? It still shows the default 404 text. What am I missing?
And a secondary question. What specifies which language file is in use: Is it the language setting in WordPress Settings -> General, where I have English (US), or is it the user’s OS language?
April 21, 2015 at 10:10 am #13600VeenaModeratorYou need to do an update in POEdit to see all the strings.
To specify which .mo file WordPress should use for translations, open wp-config.php file from WordPress root directory. Search for the following definition:
define ('WPLANG', '');
Replace it with:
define ('WPLANG', 'filename-without-extension');
eg:
define ('WPLANG', 'fr_FR');
April 21, 2015 at 10:49 am #13602scherckaMemberSo is my flow step 1-4 correct otherwise?
What do you mean I ‘need to do an update in poedit?’ Is that a step I’m missing in my workflow? Is it the same as ‘Compile to mo’, which is my step3?
I added
define (‘WPLANG’, ‘en_EN’);
to wp-config.php and still nothing.
April 22, 2015 at 1:21 pm #13632RaghavendraModeratorLooks like you are doing everything right to make it translatable. You do not need the entry in the wp-config.php in your case since you are translating within US English. Only reason why I would think things are not reflecting – if the string itself is not translatable. We do not have a 404 page in Invent, and hence I am wondering where did you get the string from which you are trying to translate.
Have you tried translating other strings which are part of the theme itself like the ones which show up on the blog page (Comments etc.), staff page (Department, Campus Address etc.). Pls try changing these and see if they get changed.
In order to make a string translatable in your application you have to just wrap the original string in a __() function call as explained here –
https://codex.wordpress.org/I18n_for_WordPress_DevelopersApril 22, 2015 at 1:23 pm #13633RaghavendraModeratorAlso, can you pls change the name of the file to en_US.po and en_US.mo and see if that makes a difference? You will need to make the appropriate change in wp-config.php as well or remove the current entry.
April 22, 2015 at 2:24 pm #13638scherckaMemberChanging to en_US works! Thanks! Resolved!
-
AuthorPosts
- The topic ‘Translation files not having an effect’ is closed to new replies.