• Resolved guigro

    (@guigro)


    Hello !

    First thanks for this amazing template ! I juste love it, it is exactly what I needed. Clean, fast and reliable.

    I just have a problem with translating it.

    I followed what is explained on this page : https://thematosoup.com/translating-wordpress-themes-plugins/

    I use a child theme but I tried by using the main theme : nothing change.

    I have the folder with
    /languages/pho.pot
    /languages/pho.mo
    /languages/pho-fr_FR.po
    /languages/pho-fr_FR.mo

    And I can’t see any change (I cleaned the cache and did everything that I think can be done).
    Do you have any hint on what I could do to solve this ?
    Thanks a lot !
    Regards,
    Guillaume

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hi,

    Sorry to hear about this.

    I know you followed the guide, but I have to check, have you changed the language in wp-config.php?

    Another thing that could cause this is that language selection has been updated in 4.0, check this post:

    https://code.tutsplus.com/articles/a-guide-to-wordpress-40–cms-21906

    Thread Starter guigro

    (@guigro)

    Thanks for your answer,

    As you can see on the following screenshots :

    – My WP Admin panel with language (WordPress 4.0) :
    https://hpics.li/d0d02b4

    – My config.php file :
    https://hpics.li/95be298

    – My two pho.pot and pho-fr_FR.po files :
    https://hpics.li/0f002c7

    – And the structure of my folder (I did the same in my original pho folder and in my child theme folder) :
    https://hpics.li/e5e5c80

    I’m sure it must be a dumb things -_- but I feel like I tried everything ??

    Thanks a lot for your help !

    Regards,
    Guillaume

    Can you try renaming pho.pot to pho.po? Described here in more detail

    https://www.appthemes.com/blog/how-to-translate-a-wordpress-theme/

    Thread Starter guigro

    (@guigro)

    Sorry but it still don’t work :/
    I also tried to upload all of these files with no success.

    And tried to desactivate all plugins and still the same issue.

    Oh and at the very beginning I tried to name my file fr_FR.po and fr_FR.mo

    So weird it don’t work :/
    And the less I fond a clue the more I think I’m really gonna look dumb when we’ll find out :p

    And I just tried from scratch (I unzipped the theme, changed the name from pho.pot to pho.po and made the translation again) : not working :'(

    Of course, once it will work I will give you the translation to implement in next updates ??

    Thread Starter guigro

    (@guigro)

    Thread Starter guigro

    (@guigro)

    Dying with that.

    I tried to have the same process to translate TwentyFourteen theme, and it worked like a charm ! :/

    In pho.pot file, the name of the project is Fanciest Author Box, but I don’t think at all it’s the issue.

    Will continue my investigation…

    Thread Starter guigro

    (@guigro)

    I tried today to install it on another WordPress install I have on another server…

    Sorry but still the same issue. It’s not working, like if my translation didn’t exists.

    Thread Starter guigro

    (@guigro)

    I MADE IT !

    Ok so there are the steps :

    In functions.php change this line (33) :
    load_theme_textdomain( 'pho', get_template_directory() . '/languages' );

    To :
    load_theme_textdomain( 'pho', get_stylesheet_directory() . '/languages' );

    This will tell your theme to search in the template folder you’re using to check for the file in your language (useful if you use a child theme).

    Then in you theme (or child theme), put your translations in the /languages/ directory.
    And name them with the default localization system, ie :
    en_US.po & en_US.mo
    fr_FR.po & fr_FR.mo

    or whatever your language is.

    Be careful ! If you think it doesn’t work, it’s because the “Posted on” and “by” from the mansory meta tags are not translated.

    I found that what is not translated is :
    _x( 'Posted on %s', 'post date', '_s' ),
    and things like that.

    I’ll continue to resolve this last issue !

    Thread Starter guigro

    (@guigro)

    DONE !

    To apply the changes to “Posted on %s” and “by %s” you made in your translation files, go to the inc/template-tags.php file and change :

    Line 96 :
    _x( 'Posted on %s', 'post date', '_s' ),

    To : __( 'Posted on %s', 'pho' ),

    And line 101 :
    _x( 'by %s', 'post author', '_s' ),

    To : __( 'by %s', 'pho' ),

    Thanks Guirgo, that worked!

    Have you also had troubles translating “One thought on…” and “XY thoughts on…” and do you have any idea how to fix this?

    Thanks a lot,

    Trajan

    Thread Starter guigro

    (@guigro)

    Hello Trajan,

    Sorry I use a plugin for comments so I don’t have this issue.

    I noticed that in comments.php file on line 29 you have those strings :
    printf( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'pho' ),

    So if you translated the whole file, it should work.
    If not, may you send me the address of the website so I can check it ?

    Thanks,

    Hi Guirgo,

    thank you very much for your reply. I eventually got it translated, using the CodeStyling Localization Plugin.

    Cheers!
    Trajan

    Hi, Guigro,
    I think you are the person who could help me translate my own words in Pho theme.

    For example at some point of the code I want to echo out

    Published by:

    Following your example above I write:

    <p><?php __( 'Published by', 'pho' ); ?></p>

    Now what should happen? Should a line Published by appear in the pho/language/pho.pot file where I will be able to translate it in other languages?

    Well it does not appear there. I guess there are more stuff that need to be done. Do you may be know which?

    Thread Starter guigro

    (@guigro)

    Hi m4j4,

    in my opinion, if there is no “Published by” in the pho.pot file, then you have to add it at the end, be sure to write exactly what’s in your code (‘Published by’) and then translate it.

    This should work.

    If not, please provide me a link and admin access so I can check it out.

    Regards,
    Guillaume

    okay, but how do you add a new entry to a Poedit file?
    There is no New entry button or something like that. At least I do not see it.
    Thanks for help.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Problem translating the theme’ is closed to new replies.