{"id":3697,"date":"2020-11-17T14:07:14","date_gmt":"2020-11-17T14:07:14","guid":{"rendered":"https:\/\/docs.redsun.design\/coffeebean\/?page_id=3697"},"modified":"2023-11-11T13:33:48","modified_gmt":"2023-11-11T13:33:48","slug":"theme-translation","status":"publish","type":"page","link":"https:\/\/docs.redsun.design\/marni\/theme-translation\/","title":{"rendered":"Theme Translation"},"content":{"rendered":"\n<p><a href=\"#loco\">Method 1: Loco Translate Plugin<\/a><br><a href=\"#poedit\">Method 2: PoEdit Software<\/a><br><a href=\"#multilingual\">Method 3: Multilingual Website<\/a><\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"loco\">Method 1: Loco Translate Plugin<\/h5>\n\n\n\n<p>The easiest way to translate the theme is to use the Loco Translate plugin.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-plugin-directory wp-block-embed-plugin-directory\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"qpRadyVNXj\"><a href=\"https:\/\/wordpress.org\/plugins\/loco-translate\/\">Loco Translate<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Loco Translate&#8221; &#8212; Plugin Directory\" src=\"https:\/\/wordpress.org\/plugins\/loco-translate\/embed\/#?secret=CK3PFzrPwd#?secret=qpRadyVNXj\" data-secret=\"qpRadyVNXj\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to&nbsp;<strong>Settings <strong>\u2192<\/strong> General&nbsp;<\/strong>and set the Site Language to your language.<\/li>\n\n\n\n<li>Go to&nbsp;<strong>Loco Translate<\/strong><\/li>\n\n\n\n<li>Select&nbsp;<strong>Your Theme<\/strong>&nbsp;from the&nbsp;<strong>Active theme&nbsp;<\/strong>section.<\/li>\n\n\n\n<li>Click on&nbsp;<strong>New language&nbsp;<\/strong>and start translating the theme.<\/li>\n\n\n\n<li>In the&nbsp;<strong>Choose a language&nbsp;<\/strong>section choose your language.<\/li>\n\n\n\n<li>In&nbsp;<strong>Choose a location<\/strong>&nbsp;select&nbsp;<strong>Custom<\/strong>, then click <strong>Start Translating<\/strong>.<\/li>\n\n\n\n<li>Select any of the strings in&nbsp;<strong>Source&nbsp;text&nbsp;<\/strong>list.<\/li>\n\n\n\n<li>If you can\u2019t find a specific string, use the search tool&nbsp;<strong>Filter translation<\/strong>.<\/li>\n\n\n\n<li>Scroll down and type the translated version into<strong>&nbsp;translation<\/strong>&nbsp;area.<\/li>\n\n\n\n<li>Click&nbsp;<strong>Save<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"poedit\">Method 2: PoEdit<\/h5>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to&nbsp;<strong>Settings <strong>\u2192<\/strong> General&nbsp;<\/strong>and set the Site Language to your language.<\/li>\n\n\n\n<li>Download&nbsp;<a rel=\"noreferrer noopener\" href=\"http:\/\/www.poedit.net\/\" target=\"_blank\">Poedit<\/a>, which is a free, open source tool.<\/li>\n\n\n\n<li>Look for the <strong>marni.pot<\/strong>\u00a0file, which is included in your theme files (in the subfolder \u201clanguages\u201d) and open it with Poedit.<\/li>\n\n\n\n<li>Click <strong>Create New Translation<\/strong>, select your language and click&nbsp;<strong>OK<\/strong><\/li>\n\n\n\n<li>You should see a list of all strings (in English) used in the theme. Go through the list and click on the text that you want to translate. When you click a line of text, the same text will appear at the upper of the 2 boxes at the bottom. Enter the translation for the text in the lower box.\n<ul class=\"wp-block-list\">\n<li>If you right-click on any line, you\u2019ll see a file name and line number like \u201carchive.php line 71\u2033. That is the place in the theme files where this text is being used.<\/li>\n\n\n\n<li>If you are looking for a certain text that you want to translate, click&nbsp;<strong>Edit&nbsp;\u2192&nbsp;Find .<\/strong><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>In&nbsp;<strong>Poedit&nbsp;\u2192&nbsp;Preferences&nbsp;\u2192&nbsp;Editing<\/strong>, make sure&nbsp;<strong>Automatically compile MO file when saving<\/strong>&nbsp;is checked. That way, when you click&nbsp;<strong>File&nbsp;\u2192&nbsp;Save as<\/strong>, it will automatically output a .po and .mo file. The naming of your .po and .mo files is important. The naming convention is based on the language code (e.g. pt for Portuguese) followed by the country code (e.g. _PT for Portugal or _BR for Brazil). So, the Brazilian Portuguese files would be called pt_BR.po and pt_BR.mo. A complete list of codes can be found at&nbsp;<a rel=\"noreferrer noopener\" href=\"http:\/\/www.gnu.org\/software\/gettext\/manual\/html_chapter\/gettext_16.html#Language-Codes\" target=\"_blank\">language codes<\/a>&nbsp;and&nbsp;<a rel=\"noreferrer noopener\" href=\"http:\/\/www.gnu.org\/software\/gettext\/manual\/html_chapter\/gettext_16.html#Country-Codes\" target=\"_blank\">country codes<\/a>. Save the translation files in the same folder as the coffeebean.pot file.<\/li>\n<\/ol>\n\n\n\n<p>You can always open your .po file again (in Poedit) and add translations.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"multilingual\">Multilingual Website<\/h5>\n\n\n\n<p>If you wish to display your website in multiple languages, we recommend using the&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/de.wordpress.org\/plugins\/polylang\/\" target=\"_blank\">Polylang <\/a>plugin. Translate all pages, posts, navigation menus, online shop and everything else on your site into multiple languages.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-plugin-directory wp-block-embed-plugin-directory\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"HmRQCZ7Oz2\"><a href=\"https:\/\/de.wordpress.org\/plugins\/polylang\/\">Polylang<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8222;Polylang&#8220; &#8212; Plugin Directory\" src=\"https:\/\/de.wordpress.org\/plugins\/polylang\/embed\/#?secret=WXY6S2xPb2#?secret=HmRQCZ7Oz2\" data-secret=\"HmRQCZ7Oz2\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"Method 1: Loco Translate PluginMethod 2: PoEdit SoftwareMethod 3: Multilingual Website Method 1: Loco Translate Plugin The easiest way to translate the theme is to use the Loco Translate plugin. ...","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3697","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/docs.redsun.design\/marni\/wp-json\/wp\/v2\/pages\/3697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.redsun.design\/marni\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.redsun.design\/marni\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.redsun.design\/marni\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.redsun.design\/marni\/wp-json\/wp\/v2\/comments?post=3697"}],"version-history":[{"count":1,"href":"https:\/\/docs.redsun.design\/marni\/wp-json\/wp\/v2\/pages\/3697\/revisions"}],"predecessor-version":[{"id":5185,"href":"https:\/\/docs.redsun.design\/marni\/wp-json\/wp\/v2\/pages\/3697\/revisions\/5185"}],"wp:attachment":[{"href":"https:\/\/docs.redsun.design\/marni\/wp-json\/wp\/v2\/media?parent=3697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}