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
-
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/languagesDo 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).
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.
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.
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
twentytentextdomain 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…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 ?Yes – I assume so. I’ve double-checked the parent theme and those phrases are correctly identified with the
twentytentextdomain 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…
The topic ‘Change text’ is closed to new replies.