{"id":96,"date":"2019-01-26T23:12:21","date_gmt":"2019-01-26T23:12:21","guid":{"rendered":"http:\/\/tamer-az.com\/?p=96"},"modified":"2019-01-26T23:12:21","modified_gmt":"2019-01-26T23:12:21","slug":"a-translatable-wordpress-theme","status":"publish","type":"post","link":"https:\/\/tamer-az.com\/?p=96","title":{"rendered":"A translatable WordPress theme"},"content":{"rendered":"\n<p>A translatable WordPress theme is a good way to interact with the \naudience with the language you desire it to present itself. There are <a href=\"https:\/\/www.google.com\/search?&amp;q=wordpress+theme+translation\">many resources<\/a>\n available over the Internet, and most of them worked actually. I don&#8217;t \nknow why you find them not working for you. Anyways, I found the \nfollowing tutorial nicely explained the matter so that you can proceed \nstep by step to translate your theme:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"http:\/\/wp.tutsplus.com\/tutorials\/theme-development\/translating-your-theme\/\"><strong>Translating Your Theme<\/strong><\/a> &#8211; by Robert Treacy \u2014 WPTuts+<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.stack.imgur.com\/8RyW1.png\" alt=\"PO Edit screen\"\/><\/figure>\n\n\n\n<p>The article explained the way more details. You will need a mini software named <a href=\"http:\/\/www.poedit.net\/download.php\">PO Edit<\/a>.\n Installing the software will require your email and password one time. \nThen opening the .po file into the software you will get a screen like \nbelow:<br>\n<\/p>\n\n\n\n<p>On the portion top, the translatable strings are there. Click on each\n string, and you will get it selected on the screen below-top, i.e. Here\n in this image the &#8220;Category Archives:&#8221; is selected. To translate the \nstring just type your translating string in your language on the portion\n at the bottom, i.e. Here in this image &#8220;Translate here&#8230;&#8221; is the \nstring will replace the original string &#8220;Category Archives:&#8221;.<\/p>\n\n\n\n<p>Please remember:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Translate being with the syntax<\/strong>, like: the string \n&#8220;Category Archives:&#8221; should translate into something that has a colon \n(:) at the end, for example: &#8220;My Archives:&#8221;.<\/li><li><strong>Do not change any code<\/strong>, like: <code>%s<\/code>, <code>%1$s<\/code> etc.<\/li><\/ul>\n\n\n\n<p>And finally you have to change your WordPress&#8217; <code>wp-config.php<\/code> file to support your language. In your case the language code would be <code>ar<\/code> for Arabic:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define('WPLANG', 'ar');<\/code><\/pre>\n\n\n\n<p>You can find all the language code <a href=\"http:\/\/codex.wordpress.org\/WordPress_in_Your_Language\">here in Codex<\/a>. I recommend following the tutorial and it will guide you to success inshALLAH.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A translatable WordPress theme is a good way to interact with the audience with the language you desire it to present itself. There are many resources available over the Internet, and most of them worked actually. I don&#8217;t know why you find them not working for you. Anyways, I found the following tutorial nicely explained the matter so that you<\/p>\n<div class=\"clearfix\"><\/div>\n<div class=\"pull-left padding-top-25\"><a href=\"https:\/\/tamer-az.com\/?p=96\" class=\"btn btn-theme\">Continue reading<span class=\"screen-reader-text\"> &#8220;A translatable WordPress theme&#8221;<\/span> <i class=\"fa fa-fw fa-long-arrow-right\"><\/i> <\/a>  <\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-96","post","type-post","status-publish","format-standard","hentry","category-word-press"],"_links":{"self":[{"href":"https:\/\/tamer-az.com\/index.php?rest_route=\/wp\/v2\/posts\/96","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tamer-az.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tamer-az.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tamer-az.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tamer-az.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=96"}],"version-history":[{"count":1,"href":"https:\/\/tamer-az.com\/index.php?rest_route=\/wp\/v2\/posts\/96\/revisions"}],"predecessor-version":[{"id":97,"href":"https:\/\/tamer-az.com\/index.php?rest_route=\/wp\/v2\/posts\/96\/revisions\/97"}],"wp:attachment":[{"href":"https:\/\/tamer-az.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=96"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tamer-az.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=96"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tamer-az.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=96"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}