Tagged: language, translation
- This topic has 6 replies, 4 voices, and was last updated 6 years, 5 months ago by Mahesh.
-
AuthorPosts
-
February 23, 2016 at 11:59 pm #86141hugodebeParticipant
Hi there, I am pretty new to WordPress and development but I read and test a lot. However this time I didn’t get how to add the missing translations in pt_BR for the “Leave a comment” and the “% Comments” links that appears on the top of posts on the post pages, but also on the home page, the archive pages, etc.
I modified comments.php from the Clean Box folder for few other missing translations and I worked. But I am sure this is not the correct method, as I will lost my translations when I will update the theme.
Hereafter the complete list of missing translations on my site http://www.montoeu.com (those translations do exist on the WordPress page for “Translation of Clean Box: Brazilian Portuguese”):
– One thought on “%2$s”
– % thoughts on “%2$s”
– % Comments
– Leave a comment
– Newer Comments →
– 1 Comment
– ← Older Comments
– % CommentsFebruary 24, 2016 at 11:44 am #86178MaheshKeymasterHi @hugodebe,
I recommend you to use other method than to change the theme’s core code for translation. You will need to create
pt_BR.po
andpt_BR.mo
file fromclean-box.pot
. I downloaded thept_BR.po
file from the link you’ve provided and made it work as per theclean-box.pot
file by copying the header inpt_BR.po
file fromclean-box.pot
file. Then selected Brazilian language in Dashboard=> Settings=> Site Language, and all of the above strings is being translated to Brazilian. You can use poedit for editing .po files and .mo file will be automatically generated.
Let me know if any problem.Regards,
MaheshFebruary 24, 2016 at 11:34 pm #86253hugodebeParticipantThanks @manesh, I finally managed to install the translations! I spent more than an hours trying to setup the pt_BR.mo and pt_BR.po by different ways but the translation files weren’t working on the Clean Box theme on my site http://www.montoeu.com. Then I updated the theme from 0.5 to the new 1.0 version and it works. This new version comes with the da_DK included.
For people that aren’t familiar with Theme Translations, find hereafter the few steps to install a new language file to your WordPress:
First of all, update your Clean Box theme to the last version (1.0 or higher).
1- I found the Brazilian Portuguese language file for this theme at https://translate.wordpress.org/projects/wp-themes/clean-box. There are a lot of translations from the community.
2- On the language page, at the end of the table, you can “Export” (“All current” in .po format).
3- I opened the downloaded file (wp-themes-clean-box-pt-br.po
) with Notepad++.
4- From the FTP folder/wp-content/themes/clean-box/languages
I downloaded/opened theda_DK.po
file with Notepad++ to have a look to the header.
5- I completed the header of mywp-themes-clean-box-pt-br.po
with the following missing lines:“Language: pt_BR\n”
“X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;esc_attr_e;esc_attr__;_nx:1,2,4c;esc_html__;esc_attr_x:1,2c\n”
“X-Poedit-Basepath: .\n”
“X-Poedit-SearchPath-0: ..\n”6- I downloaded the Poedit software and used it to edit few translations on my
wp-themes-clean-box-pt-br.po
. It’s very easy to use.
7- With Poedit, I saved my file topt_BR.po
andCompile to MO...
to get the correspondingpt_BR.mo
file.Note: I don’t know if the file name of the
.po
and.mo
files are case sensitive. I mean, ispt_BR.po
the same aspt_br.po
? By the way, the standard looks to bept_BR.po
.8- I uploaded both
pt_BR.po
andpt_BR.mo
to the FTP folder/wp-content/themes/clean-box/languages
, where you will seeclean-box.pot
,da_DK.mo
andda_DK.po
(Clean Box v1.0).Reload your web site. Ta da!
February 25, 2016 at 12:07 pm #86291MaheshKeymasterHi @hugodebe,
Glad you made it work. And the above one the the great step by step tutorial for creating
.po
,.mo
files for translation.
And yes the.po
and.mo
files are case sensitive.
Thank you for the above.
Have a nice day!Regards,
MaheshFebruary 28, 2016 at 4:47 am #86424rockyvMemberJune 27, 2017 at 1:08 am #118172fadaaeParticipantGreat effort really appreciate. Finally got the answer…….thank you
June 27, 2017 at 11:22 pm #118229 -
AuthorPosts
- The topic ‘Add translation for "Leave a comment" and "% Comments" links on top of posts’ is closed to new replies.