{"id":669,"date":"2024-04-12T10:47:45","date_gmt":"2024-04-12T08:47:45","guid":{"rendered":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/?post_type=lsvr_kba&#038;p=669"},"modified":"2024-09-05T10:28:11","modified_gmt":"2024-09-05T08:28:11","slug":"translating-the-plugin","status":"publish","type":"lsvr_kba","link":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/knowledge-base\/translating-the-plugin\/","title":{"rendered":"Translating the Plugin"},"content":{"rendered":"<p>When it comes to translating the plugin, Poedit stands out as a versatile external software dedicated to the task. There are both free and premium versions available and although the PRO version has additional functionalities that speed up work, the free version is completely sufficient for smoothly translating language files.<\/p>\n<h2>Setting the WordPress Site Language<\/h2>\n<p>Navigate to your WordPress admin panel, go to <mark>&#8216;Settings&#8217;<\/mark> -&gt; <mark>&#8216;General&#8217;<\/mark>, and confirm that your desired language is set in the <mark>&#8216;Site Language&#8217;<\/mark> dropdown menu. This action is crucial to ensure that the language file you create is properly utilized on your site.<\/p>\n<p><a href=\"https:\/\/quanticalabs.com\/Envato\/Items\/Chauffeur_Booking_System_WordPress\/guides\/poedit_03.png\">See screenshot<\/a><\/p>\n<h2>File Formats<\/h2>\n<p>Translation is facilitated through <strong>.po<\/strong> and <strong>.mo<\/strong> files. These files hold the texts displayed within your plugin, with <strong>.pot<\/strong> file specifically serving as template containing source text but no translations.<\/p>\n<div class=\"tip\">\n<p><strong>Good to Know<\/strong><\/p>\n<p><strong>.po<\/strong> stands for &#8216;portable object&#8217;. This human-readable file contains both the original texts and translations of the theme or plugin.<\/p>\n<p><strong>.mo<\/strong> stands for &#8216;machine object&#8217;. These files are machine-readable and are used by WordPress.<\/p>\n<p><strong>.pot<\/strong> stands for &#8216;portable object template&#8217;. These files contain source text but no translations, while .po files also contain the translations to a particular language.<\/p>\n<\/div>\n<h2>Translating with Poedit<\/h2>\n<p>Locate the source <strong>.pot<\/strong> language file in the plugin&#8217;s languages directory:<\/p>\n<pre>{YOUR_WORDPRESS_FOLDER}\/wp-content\/plugins\/chauffeur-booking-system\/languages\/chauffeur-booking-system.pot\r\n<\/pre>\n<div class=\"tip\">\n<p><strong>Good to Know<\/strong><\/p>\n<p>To locate this file you can use any FTP client like FileZilla or any file manager available in your administration panel (e.g. cPanel).<\/p>\n<\/div>\n<p>Download the file <strong>chauffeur-booking-system.pot<\/strong> to your disk.<\/p>\n<p>Download and install Poedit software from <a href=\"https:\/\/poedit.net\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<p>Open Poedit, click on <mark>&#8216;Create new&#8230;&#8217;<\/mark>, then select your previously downloaded <strong>chauffeur-booking-system.pot<\/strong> file.<\/p>\n<p><a href=\"https:\/\/quanticalabs.com\/Envato\/Items\/Chauffeur_Booking_System_WordPress\/guides\/poedit_01.png\">See screenshot<\/a><\/p>\n<p>Choose the language you want to translate your plugin into.<\/p>\n<p><a href=\"https:\/\/quanticalabs.com\/Envato\/Items\/Chauffeur_Booking_System_WordPress\/guides\/poedit_02.png\">See screenshot<\/a><\/p>\n<p>Once loaded in Poedit, the content will be displayed as a table in the form of rows. The original phrases\/words are on the left, while the suggested translations are on the right of the screen, making your work easier. In the lower part of the window, there are two fields with the source text and the translation (changed text).<\/p>\n<p>Translate the rows of the table one by one or search (CTRL+F) for specific phrases\/words to modify. Simply select a row and select the suggested translation on the right or enter your own in the <mark>&#8216;Translation&#8217;<\/mark> box at the bottom of the window.<\/p>\n<div class=\"important\">\n<p><strong>Important!<\/strong><\/p>\n<p>Some strings may contain symbols like <mark>&#8216;%s&#8217;<\/mark>, <mark>&#8216;%d&#8217;<\/mark>, or <mark>&#8216;&amp;&#8217;<\/mark>. These correspond to numbers or specific characters. You may also encounter HTML code in the translation strings. Copy these characters and <strong>replace only the English text<\/strong> with your desired language.<\/p>\n<\/div>\n<div class=\"important\">\n<p><strong>Important!<\/strong><\/p>\n<p>At the bottom of the <mark>&#8216;Translation&#8217;<\/mark> window there is a <mark>&#8216;Needs work&#8217;<\/mark> toggle button. If this option is selected, the phrase will not be included in the translation.<\/p>\n<\/div>\n<p>Once all (or selected) phrases are translated, save the file as a new translation file. Go to <mark>&#8216;File&#8217;<\/mark> -&gt; <mark>&#8216;Save as&#8230;&#8217;<\/mark> and name your file according to the scheme: <strong>plugin-name-locale_code.po<\/strong> so for the English version it will be the file name: <strong>chauffeur-booking-system-en_US.po<\/strong>.<\/p>\n<p>Poedit will create two files: one with the .po extension and the other with the .mo extension, e.g.:<\/p>\n<p><strong>chauffeur-booking-system-en_US.po<\/strong><br \/>\n<strong>chauffeur-booking-system-en_US.mo<\/strong><\/p>\n<div class=\"important\">\n<p><strong>Important!<\/strong><\/p>\n<p>Depending on the language of the translation, you must use a different so-called locale code. Therefore, for translation into French, the files should be named: <strong>chauffeur-booking-system-fr_FR.po<\/strong> and <strong>chauffeur-booking-system-fr_FR.mo<\/strong>. For translation into Portuguese, the files should be named: <strong>chauffeur-booking-system-pt_PT.po<\/strong> and <strong>chauffeur-booking-system-pt_PT.mo<\/strong>. See the full list of locale codes <a href=\"https:\/\/translate.wordpress.org\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<\/div>\n<p>Upload the files to the same location as the <strong>chauffeur-booking-system.pot<\/strong> file. Then disable any cache plugins in your WordPress installation or clear the cache in the settings of any caching plugins you&#8217;re using. Refresh the page (CTRL+F5) or clear your browser cache if necessary.<\/p>\n<div class=\"doc-version\">\n<p><strong>Summary<\/strong><\/p>\n<p>Document version: 1.0<br \/>\nLast updated: April 12, 2024<br \/>\nPlugin version: 6.8+<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>When it comes to translating the plugin, Poedit stands out as a versatile external software dedicated to the task. There are both free and premium versions available and although the PRO version has additional functionalities that speed up work, the free version is completely sufficient for smoothly translating language files. Setting the WordPress Site Language [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"lsvr_kba_cat":[10],"lsvr_kba_tag":[],"_links":{"self":[{"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba\/669"}],"collection":[{"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba"}],"about":[{"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/types\/lsvr_kba"}],"author":[{"embeddable":true,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/comments?post=669"}],"version-history":[{"count":34,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba\/669\/revisions"}],"predecessor-version":[{"id":939,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba\/669\/revisions\/939"}],"wp:attachment":[{"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/media?parent=669"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba_cat?post=669"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba_tag?post=669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}