Translation files not having an effect

Support Forums for LiveMesh Themes & Plugins Forums Invent Theme Support Translation files not having an effect

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #13531
    schercka
    Member

    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.

    #13543
    Raghavendra
    Moderator

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

    #13595
    schercka
    Member

    Thanks – 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?

    #13600
    Veena
    Moderator

    You 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');
    
    #13602
    schercka
    Member

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

    #13632
    Raghavendra
    Moderator

    Looks 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_Developers

    #13633
    Raghavendra
    Moderator

    Also, 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.

    #13638
    schercka
    Member

    Changing to en_US works! Thanks! Resolved!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Translation files not having an effect’ is closed to new replies.