{"id":2156,"date":"2018-12-07T12:25:03","date_gmt":"2018-12-07T12:25:03","guid":{"rendered":"http:\/\/docs.zozothemes.com\/wordpress\/faq-copy\/"},"modified":"2018-12-07T12:26:57","modified_gmt":"2018-12-07T12:26:57","slug":"magazine-language-translation","status":"publish","type":"page","link":"https:\/\/docs.zozothemes.com\/wordpress\/magazine-language-translation\/","title":{"rendered":"Magazine Language Translation"},"content":{"rendered":"<h3><span style=\"text-decoration: underline;\">Translate Your Theme &#8211; Basics<\/span><\/h3>\n<div class=\"divider-bottom\">\n<ul>\n<li>Login to your FTP account and edit the wp-config.php file.<\/li>\n<li>In the wp-config.php file, look for WPLANG constant which looks like: <strong><span class=\"highlight\">define(&#8216;WPLANG&#8217;,&#8221;);<\/span><\/strong> or that constant is not available in the wp-config.php file, you need to add it anywhere in a new line in this file.<\/li>\n<li>Define the WPLANG constructor by adding the ISO Language code of your language. The names consist of locals, a combination of language and regional dialect. For example, if you were translating to Deutsch language, change the WPLANG constant to look like the following code: <strong><span class=\"highlight\">define(&#8216;WPLANG&#8217;, &#8216;de_DE&#8217;);<\/span><\/strong><\/li>\n<li>After the wp-config.php file is edited, login to WP-admin dashboard and navigate to the Settings tab, then to the General Settings page.<\/li>\n<li>In the General Settings page, make sure the Site Language field is set to your desired language.<\/li>\n<li><strong><span class=\"highlight\">Note:<\/span><\/strong> First 2 characters of a language code define the Language, the last 2 characters define the Country. <a href=\"http:\/\/www.w3schools.com\/tags\/ref_country_codes.asp\">Click here<\/a> for more information on the ISO Language Codes.<\/li>\n<\/ul>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"http:\/\/zozothemes.com\/wp\/mist\/Documentation\/image\/language1.png\" alt=\"\" width=\"1349\" height=\"631\" \/><\/p>\n<h3><span style=\"text-decoration: underline;\">Storing Translation Files<\/span><\/h3>\n<div class=\"divider-bottom\"><\/div>\n<p>Storing translation files in the right directory is very important to make sure the translations you\u2019ve downloaded, created or edited. The best way to do this is store it inside the Languages folder located inside the wp-content folder.<\/p>\n<div class=\"divider-bottom\"><\/div>\n<h4><span style=\"text-decoration: underline;\">To Store Theme Translation Files<\/span><\/h4>\n<div class=\"divider-bottom\"><\/div>\n<ul>\n<li>Place your theme translation files inside <span class=\"highlight\"><strong>wp-content\/languages\/themes<\/strong> folder.<\/span> If you don\u2019t have the languages and themes folder, simply create the languages folder, and the themes folder inside it.<\/li>\n<li>Updating the theme will not overwrite the wp-content folder. Storing your translation files here will ensure they stay intact during updates.<\/li>\n<li>When storing your language files, remember that the file structure is different and must include the theme name, as well. For example, if the language files are in the Deutsch language, the file names would be<strong> <span class=\"highlight\">de_DE.mo<\/span><\/strong> and <span class=\"highlight\"><strong>de_DE.po<\/strong>.<\/span><\/li>\n<\/ul>\n<h3><span style=\"text-decoration: underline;\">The Translation Process<\/span><\/h3>\n<div class=\"divider-bottom\"><\/div>\n<p>This section will explain where you can find the files needed for translation and what these files are for. Inside Our Main Theme folder, you will find a folder called Languages. If you have downloaded the Installable WordPress Package file, you will find these files in the Languages folder:<\/p>\n<ul>\n<li><strong><span class=\"highlight\">independent.pot<\/span><\/strong> \u2013 A list of all the text strings used in the Theme files. These text strings are in the English language, and can contain a translation for each text string.<\/li>\n<li>If your language is not already included, you need to<strong> <span class=\"highlight\">create a new .po<\/span><\/strong> file from the original <strong><span class=\"highlight\">independent.pot<\/span><\/strong> located in the Languages folder, translate all text strings, then <strong><span class=\"highlight\">save the .po<\/span><\/strong> file with your language code.<\/li>\n<li>Either you are setting up a completely <strong><span class=\"highlight\">new language file<\/span><\/strong> or you just want to edit translated pre-built language files, follow the steps to make easy.<\/li>\n<li>The language files can also be used if you only want to translate a small portion of the theme, or one specific area. You do not have to translate the entire theme, you can choose what you translate inside the <span class=\"highlight\"><strong>independent.pot<\/strong> file<\/span>. This is the preferred method for translation.<\/li>\n<\/ul>\n<h3><span style=\"text-decoration: underline;\">Edit The .pot file Using POEdit Software<\/span><\/h3>\n<div class=\"divider-bottom\"><\/div>\n<p>To edit the .pot files, you need to download the POEdit software. Click on this link to download <a href=\"http:\/\/poedit.net\/\" target=\"_blank\">poedit.net<\/a>. There are different editors for editing .po files, but POEdit is easy to use, it is available for all platforms and it is freeware.<\/p>\n<ul>\n<li>Open <strong><span class=\"highlight\">POEdit<\/span><\/strong> and select the <strong><span class=\"highlight\">Create New Translation<\/span><\/strong> button to open the independent.pot.<\/li>\n<li>Once it has loaded, You will find all English text strings in the left column called Source Text. Once you add translations, they will show up in the right column under Translation.<\/li>\n<li>Choose the line you want to translate. In the lower right section of the <strong><span class=\"highlight\">POEdit window<\/span><\/strong>, you will find a text area where you can add the correct translation.<\/li>\n<li>When you are <strong><span class=\"highlight\">done translating<\/span><\/strong> all the needed text strings into your desired language, <strong><span class=\"highlight\">save the file<\/span><\/strong> with the theme name and your language code.<\/li>\n<li>For example, if you were translating to the Deutsch language, you would save it as <strong><span class=\"highlight\">de_DE.po<\/span><\/strong>. The corresponding<strong> <span class=\"highlight\">.mo file<\/span><\/strong> will be auto created.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"http:\/\/zozothemes.com\/wp\/mist\/Documentation\/image\/poedit1.png\" alt=\"\" width=\"587\" height=\"444\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"http:\/\/zozothemes.com\/wp\/mist\/Documentation\/image\/poedit2.png\" alt=\"\" width=\"1361\" height=\"727\" \/><\/p>\n<h3><span style=\"text-decoration: underline;\">To Edit A Pre-Built Language File<\/span><\/h3>\n<div class=\"divider-bottom\"><\/div>\n<p>Everytime you update the<strong> <span class=\"highlight\">.pot file<\/span><\/strong>, make sure to upload both .po and the compiled .mo file as correct file name. The correct file name is the theme name and your language code. For example, de_DE.po.<\/p>\n<ul>\n<li>Open the <strong><span class=\"highlight\">.pot<\/span> file<\/strong> of your preferred language in POEdit and search for the line you want to change. Select the Edit button to change, then select the Find option.<\/li>\n<li>In the Search Window, <strong><span class=\"highlight\">type the text<\/span><\/strong> string you are searching. Once it is selected, replace the text in the Translation text area in the lower part of the window with your prefered translation.<\/li>\n<li>Repeat the steps to <strong><span class=\"highlight\">edit another text<\/span><\/strong>.<\/li>\n<li>Once done with your translations, Save the file and <strong><span class=\"highlight\">.mo file<\/span><\/strong> will be auto created with updated.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"http:\/\/zozothemes.com\/wp\/mist\/Documentation\/image\/poedit3.png\" alt=\"\" width=\"685\" height=\"704\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Translate Your Theme &#8211; Basics Login to your FTP account and edit the wp-config.php file. In the wp-config.php file, look for WPLANG constant which looks like: define(&#8216;WPLANG&#8217;,&#8221;); or that constant is not available in the wp-config.php file, you need to add it anywhere in a new line in this file. Define the WPLANG constructor by<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2156","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/docs.zozothemes.com\/wordpress\/wp-json\/wp\/v2\/pages\/2156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.zozothemes.com\/wordpress\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.zozothemes.com\/wordpress\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.zozothemes.com\/wordpress\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.zozothemes.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2156"}],"version-history":[{"count":3,"href":"https:\/\/docs.zozothemes.com\/wordpress\/wp-json\/wp\/v2\/pages\/2156\/revisions"}],"predecessor-version":[{"id":2159,"href":"https:\/\/docs.zozothemes.com\/wordpress\/wp-json\/wp\/v2\/pages\/2156\/revisions\/2159"}],"wp:attachment":[{"href":"https:\/\/docs.zozothemes.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}