-
AuthorPosts
-
February 6, 2015 at 5:09 am #200387
Hi,
Thank you for an absolutely rocking theme π The only thing that rocks even more are the knowledge base and these forums, I’ve solved and learned a lot by reading those πThe web I’m working on: http://prufa.andartak.is/
My problem: is making everything in the web in Icelandic. What I’ve done so far:
1. Make a child theme
2. Put the Icelandic language files in wp-content>languages and choose Icelandic in WP settings.
3. Put this code in child theme’s functions.php:
add_action( ‘after_setup_theme’, ‘my_child_theme_lang’ );
function my_child_theme_lang() {
load_child_theme_textdomain(‘x’, dirname(__FILE__) . ‘/x-child-integrity-light/framework/lang/’);
}
add_filter(‘x_option_x_integrity_portfolio_archive_sort_button_text’, ‘x_sort_translate’, 20);
function x_sort_translate ( $string ) {
return __( $string, ‘__x__’ );
}4. Change to this in the config.php: define(‘WPLANG’, ‘is_IS’);
5. Put default po and mo in the child theme’s Framework/Lang.
6. Download /install Poedit change language strings in default.po and then upload the changed po and mo into child theme’s Lang folder. This does not seam to change anything π
My best,
KrisFebruary 6, 2015 at 6:16 am #200405Hi,
I might be doing something wrong with Poedit. So feel free to ignore this request until and if I contact again.Best,
KrisFebruary 6, 2015 at 2:08 pm #200680Hi there,
Thanks for writing in! Best way is to use a 3rd party plugin like WPML in case you donβt want to do it manually. The plugins will pickup the strings loaded from your language files.
Let us know how it goes.
February 10, 2015 at 2:28 pm #203444Hi and thanks for this tip.
I was just thinking about this but was hesitating in getting a multi language plugin as I only need to translate a few sentences. The website is only going to be in one language, Icelandic.
Would you still recommend WPML?
February 11, 2015 at 1:28 am #203784Hi,
Upon checking your site, I can see it is already ni Icelandic language.
Have you figured it out? Can you please confirm.
Thanks
February 11, 2015 at 2:15 pm #204257Hi and thank you,
I put two filters in the child theme functions.php file to translate “Read more” and “Search” but the file I made in Poedit does not work. I checked on the file by downloading it and opening again in Poedit and my changes were there although they are not visible in the website.
Best,
KrisFebruary 12, 2015 at 1:06 pm #205167Hi again,
I have not figured it out.
I still need to translate some language strings in the front end for example “Type and press “Enter” to search”.At the top here I describe what I did in regard to translating the site. Is it possible you can see from that what I did wrong?
I really want to be able to translate language strings that are still in English, preferably without a plugin.
I suspect this is probably not something you are supposed to help with but still hoping for some clue :-/
Best,
KrisFebruary 12, 2015 at 1:22 pm #205177Yesss! Victory!
I saw in some post here that .po and .mo should go in the parent theme’s lang folder but not in the child themes as I had done (and read somewhere) – now it’s working π
February 12, 2015 at 1:32 pm #205187Cool, good job! π
February 17, 2015 at 12:54 pm #208710Hi again.
It wasn’t so cool after all. when I updated X the .po and .mo language files with all my strings were deleted π They were in Framework > Lang (parent theme).
I have put the files back but how can I tell WordPress to use the language files in the child theme? (or isn’t that the correct way??).
You can see here at the top how I did this. In item 6 I forgot to mention that I renamed the .po and .mo is_IS.po and is_IS.mo instead of default.Migh the functions.php be wrong?
Best,
KrisFebruary 18, 2015 at 1:16 am #209001Hi Kris,
The best way to have your language files in WordPress is to place the files in its own directory. On your site server, create a new folder in your /wp-content/ directory called /languages.The language directory might be present already since you are using Icelandic. Inside that languages folder, you will see is_IS.mo which is the translation files of WordPress into your language. You also need to create another folder ‘themes’. What you would probably do is to rename default.po to x-is_IS.po. If you already have your translation, is_IS.po and is_IS.mo files ready, you can rename it to x-is_IS.po and x-is_IS.mo and upload the files to the /wp-content/languages/themes/ folder you just created.
By having it this way, your language translation files will not be overwritten when you do updates to WordPress, X themes and plugins you have translated.
Note: If you have plugins that you’ve translated to your language, you can rename your translation files to plugin_name-is_IS.po and upload it to /wp-content/languages/plugins/.
Please let me know if this works for you.
February 25, 2015 at 9:11 am #214964Thank you very much. This seems to be working fine.
Kris
February 25, 2015 at 12:01 pm #215103You’re welcome! π
August 3, 2015 at 2:41 pm #348832Hi Staff,
It would be super nice if I could get this to work as well!
I’ve been reading many, many posts all day and nothing seems to work.
(I’m trying to make the translation work from the child theme)The solution offered in this thread looked like it was THE answer to my challenge, …but still no luck.
I’ve performed all necessary steps to direct to the child theme’s language files. Placing the files in the /language/themes folder didn’t do anything. Do I have to make extra adjustments to make this solution work?
August 3, 2015 at 5:53 pm #348994Hello Ruben,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
-
AuthorPosts