Hello!
I would like to know, is it possible to translate Focus theme texts? For example, “Post Comment” button, “Recent posts” etc. How I can translate it in my native language?
Thank You!
Focus Premium theme translation
This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.
Hi
We’ll hopefully have documentation on this soon.
1. Find the .pot file in the languages folder with Focus at wp-content/themes/focus
2.Use http://www.poedit.net/ to create a .mo and .po file. These files must be named as follows:
de_DE.mo and de_DE.po
The above is an example using German.
3. Place these files back in your languages folder in wp-content/themes/focus
4. In your WordPress root find wp-config.php and change WPLANG to your language. E.g: define( ‘WPLANG’, ‘de_DE’ );
http://codex.wordpress.org/Editing_wp-config.php#Language_and_Language_Directory
The above however won’t survive an upgrade of Focus. To do this properly create a Focus child theme: https://codex.wordpress.org/Child_Themes.
Within your child theme create a functions.php file and place the following in that file:
Then place your .po and .mo files in a languages folder in your child theme.
Your changes will now be upgrade safe.
Thank You very much, so far done.
But how can I translate, for exaple, these values:
http://postimg.org/image/v218etgfz/
http://postimg.org/image/6mt0drhj3/ ?
I tried to add in my language .po file “Leave a Reply” and translate it, but no changes in page…
Recent Posts is possibly the title of a widget so you should check under Appearance > Widgets for that. Leave a reply is by default part of
to edit it you’ll need to insert the comments.php file into your child theme and change
to:
And change my Leave a Comment to whatever you’d like that to read.
Sorry, didn’t notice widget title.
Thank You, that’s clear about “Leave a reply”.
Embarrassed to ask more, but also how I can translate:
“Your email address will not be published. Required fields are marked *”
“Name, Email, Website” and “Post Comment” button in comment form. http://postimg.org/image/cvx7x6k1x/
And last, “Search Results” and “Search” button. http://postimg.org/image/sgc4pihs3/
I hope this isn’t annoying… but I don’t have any coding skills, so I can’t do this by myslef.
No problem. Try this instead, to get to all those strings:
If you take a look at search.php you’ll see everything within the form is translatable so you should be able to translate the Search button. To sort out the page title please drop search.php into your child theme and try replacing line 15 with your own title.
I insert
‘Sūtīt’,
// change the title of the reply section
‘title_reply’ => ‘Komentēt’,
//
‘title_reply_to’ => __(‘Atbildēt %s’),
//
‘cancel_reply_link’ => __(‘Atcelt’),
// remove “Text or HTML to be displayed after the set of comment fields”
‘comment_notes_after’ => ”,
// redefine your own textarea (the comment body)
‘comment_field’ => ” . _x(‘Comment’, ‘noun’) . ”,
//
‘author’ => ” . ” . __(‘Vārds’, ‘domainreference’) . ‘ ‘ . ($req ? ‘*’ : ”) . ”,
//
’email’ => ” . __(‘E-pasts’, ‘domainreference’) . ‘ ‘ . ($req ? ‘*’ : ”) . ”,
//
‘comment_notes_before’ => ” . __(‘E-pasts nebūs redzams citiem’) . ($req ? $required_text : ”) . ”,
//
‘url’ => ” . __(‘Website’, ‘domainreference’) . ” . ”,
//
‘comment_notes_before’ => ” . __(‘E-pasts nebūs redzams citiem’) . ($req ? $required_text : ”) . ”,
//
‘label_submit’ => __(‘Apstiprināt’)
);
comment_form($comments_args);
?>
in child theme comments.php, but some fields doesn’t change: http://postimg.org/image/w1ejf87nr/
I do something wrong?
http://postimg.org/image/gwqljlkul/full/ – that’s what I translated in code
You’ll need to insert exactly what I pasted so originally you had:
you’ll need to replace that with the entire function and array I provided above.
I did all like you said. Maybe you can take a look at that comments file: http://www.speedyshare.com/GVGdH/comments.php
And here is result: http://postimg.org/image/4na3r5gjj/ Name, e-mail and website names doesn’t change.
Greg has shown me the correct way we should be doing this. Please revert comments.php back to
then create a file for your child theme called functions.php and place in it the following:
If the site is live send me a link for where you after that and I’ll assist further if required.
We’ll hopefully have these items in the Focus pot file in a near future update.
Thank you, now it works. I would be very grateful if you could help with all those translations.
Here is site: http://test.tutv.lv/kas-jauns-tukuma-03-04-2014/
Include this in update would be good. :)
Hello Andrew,
I have no such file (.po file in the languages folder with Focus at wp-content/themes/focus).
Where can I find it? My order number is: 57342674546062222
Regards
Hi Plamen
Within the languages folder you’ll find a .pot file. You’ll need to use a program like Poedit to create the .po and .mo files.
Here is a tutorial you might take a look at: http://premium.wpmudev.org/blog/how-to-translate-a-wordpress-theme/.
For further assistance, please open a new support thread:
Page: New Thread
Thanks