{"id":158,"date":"2017-12-11T10:11:43","date_gmt":"2017-12-11T10:11:43","guid":{"rendered":"http:\/\/rifetheme.com\/docs\/docs\/miscellaneous\/translating-theme\/"},"modified":"2018-07-26T08:52:20","modified_gmt":"2018-07-26T08:52:20","slug":"translating-theme","status":"publish","type":"docs","link":"https:\/\/rifetheme.com\/apollo13-framework\/docs\/translations\/translating-theme\/","title":{"rendered":"Translating theme to your language"},"content":{"rendered":"<h2>Ready for translations<\/h2>\n<p>The theme is prepared for translation, so it will just require some time for you to see our theme in your language(if it isn&#8217;t translated to it yet).<\/p>\n<p>If you are not using any plugin for translations like WPML, then keep on reading.<\/p>\n<h2>I want to change 1 theme string<\/h2>\n<p>Sometimes, you may find your self in need to change one of the theme strings to be presented in a different way. For example &#8220;Read more&#8221; on the blog.<\/p>\n<p>In this case, you should follow the below process as well, but translate only strings that you are interested in. In this case, your entered translation will be more of a replacement.<\/p>\n<p>So when instead of &#8220;Read more&#8221; you want to have &#8220;Continue this interesting story&#8221;, then you enter this as a translation for &#8220;Read more&#8221; and create files for your WordPress language.<\/p>\n<h2>How to prepare a translation file<\/h2>\n<p>Translation file(.pot file) you can find in the main theme directory in\u00a0<code>languages\/<\/code><\/p>\n<p>This file should be opened in a program like\u00a0<a href=\"http:\/\/www.poedit.net\/\">Poedit<\/a>\u00a0and translated.<\/p>\n<p>After everything is done you have to save your translation with a proper name.<\/p>\n<p>Names for each country can be found on\u00a0<a href=\"https:\/\/codex.wordpress.org\/WordPress_in_Your_Language\">https:\/\/codex.wordpress.org\/WordPress_in_Your_Language<\/a>\u00a0(column WP Locale).<\/p>\n<p>So for example for German &#8211; Deutsch you should save files as\u00a0<strong>de_DE<\/strong>\u00a0and get 2 files:\u00a0<strong>de_DE.po<\/strong>\u00a0and\u00a0<strong>de_DE.mo<\/strong>.<\/p>\n<p>Copy these files to theme directory to\u00a0<code>languages\/<\/code><\/p>\n<hr \/>\n<p>In every update,\u00a0the <strong>.pot<\/strong>\u00a0file may change as we may add some new functions or fix some spelling, but you can use your old translation to get most of the work done.<\/p>\n<p class=\"info\">If you don&#8217;t want to lose your translation on each theme update, then you should put your translation in the <a href=\"https:\/\/rifetheme.com\/apollo13-framework\/docs\/installation-updating\/installing-child-theme\/\">child theme<\/a>, instead of the main theme. Just create <code>languages\/<\/code> directory in the child theme and put your translation there.<\/p>\n<p>If you have already created translations in the main theme, then just copy the whole <code>languages\/<\/code> directory to the child theme, so you will have a structure <code>themename-child-theme\/languages\/de_DE.po<\/code> for example.<\/p>\n<h2>Change your language in WordPress<\/h2>\n<p>At the end you have to go to your Admin Panel,\u00a0<strong>Settings\u00a0\u2192\u00a0General\u00a0\u2192\u00a0Site Language<\/strong>\u00a0and set your language.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-368\" src=\"https:\/\/rifetheme.com\/wp-content\/uploads\/2017\/12\/admin_language.png\" alt=\"\" width=\"653\" height=\"337\" \/><\/p>\n<p>After that, if everything went fine, you will see the theme strings in your language:-)<\/p>\n<h2>How to use Poedit to translate strings<\/h2>\n<p>On below image, you can see where to type translated texts in Poedit, as not everyone gets it right away.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-369\" src=\"https:\/\/rifetheme.com\/wp-content\/uploads\/2017\/12\/poedit.png\" alt=\"\" width=\"569\" height=\"461\" \/><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":157,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_tag":[],"class_list":["post-158","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/rifetheme.com\/apollo13-framework\/wp-json\/wp\/v2\/docs\/158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rifetheme.com\/apollo13-framework\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/rifetheme.com\/apollo13-framework\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/rifetheme.com\/apollo13-framework\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rifetheme.com\/apollo13-framework\/wp-json\/wp\/v2\/comments?post=158"}],"version-history":[{"count":5,"href":"https:\/\/rifetheme.com\/apollo13-framework\/wp-json\/wp\/v2\/docs\/158\/revisions"}],"predecessor-version":[{"id":9086,"href":"https:\/\/rifetheme.com\/apollo13-framework\/wp-json\/wp\/v2\/docs\/158\/revisions\/9086"}],"up":[{"embeddable":true,"href":"https:\/\/rifetheme.com\/apollo13-framework\/wp-json\/wp\/v2\/docs\/157"}],"next":[{"title":"Translating site to many languages with WPML","link":"https:\/\/rifetheme.com\/apollo13-framework\/docs\/translations\/translating-site-with-wpml\/","href":"https:\/\/rifetheme.com\/apollo13-framework\/wp-json\/wp\/v2\/docs\/159"}],"wp:attachment":[{"href":"https:\/\/rifetheme.com\/apollo13-framework\/wp-json\/wp\/v2\/media?parent=158"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/rifetheme.com\/apollo13-framework\/wp-json\/wp\/v2\/doc_tag?post=158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}