{"id":9277,"date":"2016-10-03T03:00:29","date_gmt":"2016-10-03T03:00:29","guid":{"rendered":"https:\/\/wpopal.com\/?p=9277"},"modified":"2016-10-03T03:00:29","modified_gmt":"2016-10-03T03:00:29","slug":"how-to-translate-language-in-wordpress-theme","status":"publish","type":"post","link":"http:\/\/dev.wpopal.com\/wpopal\/how-to-translate-language-in-wordpress-theme\/","title":{"rendered":"How to translate language in wordpress theme"},"content":{"rendered":"<p>Dear all customer&#8217;s<br \/>\nToday , Opal Team will guide with you how to translate language in your theme.<br \/>\nIn our guide has guided you translate language by <a href=\"https:\/\/wpml.org\/?\" rel=\"nofollow noopener\" target=\"_blank\">WPML<\/a> , now we will show you a way translate language by Loco Translate.<br \/>\n<strong>1.Check you can switch language<\/strong><br \/>\nPlease go to Dashboard-&gt;&gt; Setting-&gt;&gt; General Setting and choose language that you want to translate.<br \/>\n<img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-9281\" src=\"https:\/\/wpopal.com\/wp-content\/uploads\/2016\/10\/language.jpg\" alt=\"language\" width=\"846\" height=\"589\" title=\"\"><br \/>\n<strong>2.Set up the folders<\/strong><br \/>\nBefore you do any translating, make sure the following folder exists on your site, and is <strong>writeable by the web server<\/strong>:<\/p>\n<pre><code class=\"hljs\">wp-content\/languages\/loco\/themes\n<\/code><\/pre>\n<p>If you have automatic updates enabled then the <code>\"wp-content\/languages\"<\/code> folder probably exists already. The <code>\"loco\"<\/code> subfolder is there to protect your custom translations from automatic translation updates. This is critical if you want to avoid your files being deleted behind your back.<br \/>\nLoco Translate also lets you save translations inside the theme&#8217;s own folder, but this is provided for theme developers only. Files inside the theme folder will get deleted by WordPress updates, so don&#8217;t save anything in there unless you know what you&#8217;re doing.<br \/>\nIf you&#8217;re not familiar with changing file permissions see our guide to <a href=\"https:\/\/localise.biz\/wordpress\/plugin\/manual\/filesystem\" rel=\"nofollow noopener\" target=\"_blank\">filesystem access<\/a>, and ask your hosting provider or system administrator if you have any doubts.<br \/>\n<strong>3. Install plugin<\/strong><br \/>\nGo to Plugin-&gt;&gt; Add New-&gt;&gt; and enter name of plugin : Loco Translate , install and active this plugin<br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-9282\" src=\"https:\/\/wpopal.com\/wp-content\/uploads\/2016\/10\/add_plugin.jpg\" alt=\"add_plugin\" width=\"1000\" height=\"338\" title=\"\"><br \/>\n<strong>4.Find the theme in the translation dashboard<\/strong><br \/>\nPlease go to <strong>Loco\u00a0 Translate<\/strong> in left sidebar, and choose Theme sub tab, choose name of theme and you will see form -&gt;&gt; click to &#8220;<em>New Language<\/em>&#8221;<br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-9286\" src=\"https:\/\/wpopal.com\/wp-content\/uploads\/2016\/10\/translate.jpg\" alt=\"translate\" width=\"1000\" height=\"270\" title=\"\"><br \/>\nTo start translating the theme into another language click this button and you&#8217;ll be taken to a new screen where you can choose the language you want.<br \/>\nSelect a language from the dropdown list of common languages. In this example we&#8217;ll select &#8216;Russian&#8217;. You could achieve the same result by entering <code>\"RU\"<\/code> into the text field instead, but we won&#8217;t talk about language codes right now.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9289\" src=\"https:\/\/wpopal.com\/wp-content\/uploads\/2016\/10\/new_language.jpg\" alt=\"new_language\" width=\"1000\" height=\"467\" title=\"\"><br \/>\nIf you&#8217;ve set up your folders correctly you should see a location marked as &#8220;Custom&#8221;. You should select this so you new translations are safe from automatic updates.<br \/>\nWith the language and folder location selected, click the &#8220;Start translating&#8221; button and you&#8217;ll be taken to the <strong>editor<\/strong> screen for translating the theme.<br \/>\n<strong>Then translate language:<\/strong><br \/>\nOnce on the editor screen you&#8217;ll see all the strings the theme has defined in its template file. Untranslated strings are shown in bold blue. To start with they will all be untranslated.<br \/>\nThe basics of the editor should be fairly intuitive. Select the English string at the top and enter your translation in the pane at the bottom. You can ignore most of the editor buttons for now. We&#8217;re just going to enter a translation and save it.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9294\" src=\"https:\/\/wpopal.com\/wp-content\/uploads\/2016\/10\/create.jpg\" alt=\"create\" width=\"1000\" height=\"473\" title=\"\"><br \/>\n<strong>5.Check the files exist<\/strong><br \/>\nIf everything has gone well, you now have Greek translation files on your server for the Omega theme. Take a look in the folder you set up earlier and you should see two new files:<\/p>\n<pre><code class=\"hljs\">wp-content\/languages\/loco\/themes\/shu-ru_RU.po\nwp-content\/languages\/loco\/themes\/shu-ru_RU.mo\n<\/code><\/pre>\n<p>Checking they exist is good for our sanity and helps you see how it all works. The <strong>PO file<\/strong> is a human-readable source file. The <strong>MO file<\/strong> is the binary file that the Shu theme will ask WordPress to load.<br \/>\nLoco Translate has now completed its job. It has compiled a MO file and saved it to disk with the correct name. <strong>This is all it does<\/strong>. What happens next is down to WordPress and the theme.<br \/>\n<strong>6.Viewing the translated theme<\/strong><br \/>\nGo to Front-end you will se result when you finish translate language:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9302\" src=\"https:\/\/wpopal.com\/wp-content\/uploads\/2016\/10\/view.jpg\" alt=\"view\" width=\"1000\" height=\"502\" title=\"\"><br \/>\nThanks for joining with us.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dear all customer&#8217;s Today , Opal Team will guide with you how to translate language in your theme. In our guide has guided you translate language by WPML , now we will show you a way translate language by Loco Translate. 1.Check you can switch language Please go to Dashboard-&gt;&gt; Setting-&gt;&gt; General Setting and choose [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":30787,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[27],"tags":[],"class_list":["post-9277","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"_links":{"self":[{"href":"http:\/\/dev.wpopal.com\/wpopal\/wp-json\/wp\/v2\/posts\/9277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/dev.wpopal.com\/wpopal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dev.wpopal.com\/wpopal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dev.wpopal.com\/wpopal\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"http:\/\/dev.wpopal.com\/wpopal\/wp-json\/wp\/v2\/comments?post=9277"}],"version-history":[{"count":0,"href":"http:\/\/dev.wpopal.com\/wpopal\/wp-json\/wp\/v2\/posts\/9277\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/dev.wpopal.com\/wpopal\/wp-json\/wp\/v2\/media\/30787"}],"wp:attachment":[{"href":"http:\/\/dev.wpopal.com\/wpopal\/wp-json\/wp\/v2\/media?parent=9277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dev.wpopal.com\/wpopal\/wp-json\/wp\/v2\/categories?post=9277"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dev.wpopal.com\/wpopal\/wp-json\/wp\/v2\/tags?post=9277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}