Tagged: x
-
AuthorPosts
-
January 17, 2017 at 2:44 am #1333195
Hi
I have carefully read all the related documentation (https://community.theme.co/kb/translation/), but I haven’t understood which is best practice in order to proceed in a “child environment”:
Method A. – Translation in Parent Theme
Upload translation files (both .po and .mo files )to /wp-content/themes/x/framework/langMethod B. – Translation in Child Theme, changing function.php
Create a “languages” folder in your child theme, for example /wp-content/themes/x-child/languages and upload your translations to that file (maybe folder?), changing child themes functions.php as follow:add_action( 'after_setup_theme', 'load_child_language' ); function load_child_language() { load_child_theme_textdomain( '__x__', get_stylesheet_directory() . '/languages' ); }
Method C. – Alternative Upload Method
Rather than using a child theme, you could upload your translation to /wp-content/langauges/themes, the main difference being if you upload that way, you’ll need to use the text domain of the theme/plugin you are translating in the naming of the file. For example, for this article we’d use the X text domain which is __x__ and then with the language code like this: __x__-de_DE.po and __x__-de_DE.moMethod D. – Plugins
- qTranslate X – A free alternative to WPML, offering the ability to translate WordPress themes and plugins from the WordPress admin.
- loco-translate – Loco Translate provides in-browser editing of WordPress translation files
Thank You
January 17, 2017 at 5:31 am #1333341Hey there,
Please choose Method B as that is for the child theme.
Thanks.
-
AuthorPosts