Support » Themes and Templates » Change text

  • 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!

    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.

    esmi

    (@esmi)

    Forum Moderator

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

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

    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/');
    }
    ?>
    esmi

    (@esmi)

    Forum Moderator

    In a languages subfolder of your child theme.

    Not sure to understand you esmi regarding my functions.php file … đŸ˜‰

    esmi

    (@esmi)

    Forum Moderator

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

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

    esmi

    (@esmi)

    Forum Moderator

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

    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…

    esmi

    (@esmi)

    Forum Moderator

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

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

    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 http://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 ?

    esmi

    (@esmi)

    Forum Moderator

    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.

    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.