• Hello,
    my blog with a theme I am adjusting (Twenty Ten) is here
    I wonder how to change few text like “Laisser un commentaire” (Post a comment), “Une réponse” (1 comment) and so on.
    Is it in fr_FR.po file ?
    Thank you !
    Samuel

Viewing 15 replies - 1 through 15 (of 24 total)
  • Yes, it should be in your fr_FR.po file, assuming that is the same as twentyten.pot.

    Sorry I can’t be of much more help than this!

    Thread Starter ehquionest

    (@ehquionest)

    I just realized now that there are 2 versions of this file :

    – one is in wp-content/languages
    – the other one is in wp-content/themes/twentyten/languages

    Do you know wich one is used by wordpress ?

    I’m not too familiar with translations, but I would guess at it using the theme specific translation file then the WordPress one.

    You should be looking at wp-content/themes/twentyten/languages.

    Never, ever, edit WordPress core scripts (ie anything outside the wp-content folder).

    Thread Starter ehquionest

    (@ehquionest)

    Ok so I am gona change fr_FR.po to generate a fr_FR.mo and upload this two files again to replace the two previous. But how to call this two files if they will be in a child theme (/twentyten_enfant/languages) ? With this code in my functions.php

    <?php
    add_action('after_setup_theme', 'my_twentyten_enfant_setup');
    function my_twentyten_enfant_setup(){
        load_theme_textdomain('twentyten_enfant', get_template_directory() . '/languages/');
    }
    ?>

    In a languages subfolder of your child theme.

    Thread Starter ehquionest

    (@ehquionest)

    Not sure to understand you esmi regarding my functions.php file … ??

    Oh sorry. You shouldn’t need to do anything more, The function is called by the after_setup_theme action.

    Thread Starter ehquionest

    (@ehquionest)

    So according to you, with this code my functions.php is correct ?

    Yes – with one possible exception that I’ve only just noticed. Try changing:

    load_theme_textdomain('twentyten_enfant', get_template_directory() . '/languages/');

    to:

    load_theme_textdomain('twentyten', get_template_directory() . '/languages/');

    Otherwise, none of the strings with the twentyten textdomain name will be translated in the parent or child..

    Thread Starter ehquionest

    (@ehquionest)

    Ok I didi it.
    Now it’s still strange cause in my “twentyten_enfant” (child theme) /languages folder, I have two files fr_FR.po and .mo
    In the fr_FR.po I changed all “Laisser un commentaire” by “Publier un commentaire” and updated .mo file
    When I look on my blog, it’s still written “Laisser un commentaire” nothing has changed. So now I am not sure it’s in the .po and .mo that I have to change this translation…

    Ah – just noticed something else! You’re calling the languages file from the parent theme. Try:

    load_theme_textdomain('twentyten', get_stylesheet_directory() . '/languages/');

    Thread Starter ehquionest

    (@ehquionest)

    So now it works for sure cause I change something in my fr_FR files and it has been updated on the blog ! Great thanks !
    However there is still something strange : if you look here https://test.sblanc.com/blog/ just bellow the volcano picture “Posted in….” and “Edit” are still in English. Does it mean that in my fr_FR.po file, this element is missing ?

    Yes – I assume so. I’ve double-checked the parent theme and those phrases are correctly identified with the twentyten textdomain name in the parent’s functions.php file.

    Thread Starter ehquionest

    (@ehquionest)

    So I have to add them in my child languages files I guess ? I know how to modify an existing one, but not how to add a new one…

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘Change text’ is closed to new replies.