{"id":198,"date":"2019-10-08T12:19:04","date_gmt":"2019-10-08T12:19:04","guid":{"rendered":"https:\/\/docs.theironnetwork.org\/embryo\/?page_id=198"},"modified":"2019-11-20T03:24:38","modified_gmt":"2019-11-20T03:24:38","slug":"translate-app-2","status":"publish","type":"page","link":"https:\/\/docs.theironnetwork.org\/embryo\/translate-app-2\/","title":{"rendered":"Translate App"},"content":{"rendered":"\n<p>Embryo support multilingual feature which helps you to build your app in multilingual. Read the documentation carefully and follow the steps.\u200c<\/p>\n\n\n\n<h5 id=\"how-to-set-default-locale\">How To Set Default Locale<a href=\"#how-to-set-default-locale\"><\/a><\/h5>\n\n\n\n<p>Follow the steps if you want to set default locale you can choose english, french according to your desired locale.\u200c<\/p>\n\n\n\n<p>Go to the <code>src -> store -> modules -> settings<\/code> directory and open <code>data.js<\/code> file.<\/p>\n\n\n\n<p>Where languages is type of array which provides you to set of locales. Languages are defined in the <code>data.js<\/code> file under the <code>src -> store -> modules -> settings<\/code> directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ languages <br>export const languages = [<br>   {<br>      name: \"English\",<br>      locale: \"en\"<br>   },<br>   {<br>      name: \"French\",<br>      locale: \"fr\"<br>   }<br>]<\/pre>\n\n\n\n<h5 id=\"how-to-add-a-new-locale\">How To Add A New Locale<a href=\"#how-to-add-a-new-locale\"><\/a><\/h5>\n\n\n\n<p>Here are the instructions to add a new locale in your app. We are taken an example of <strong>French<\/strong> that we are going to add.\u200c<\/p>\n\n\n\n<p>Create a directory with name of locale code inside the <code>src -&gt; lang<\/code> directory.\u200c<\/p>\n\n\n\n<p>Create <code>index.js<\/code> file under the directory that you have just created and define the static strings which you want translate into German, you can check the other locale files how strings are defined.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>  \"HOME\":\"Accueil\",<br>  \"SHOP\":\"Boutique\",<br>  \"PRODUCT DETAILS\": \"d\u00e9tails du produit\",<br>  \"CART\" : \"Chariot\"<br>}<\/pre>\n\n\n\n<p>Open <code>src -> lang -> index.js<\/code> file and import the file that you have just created e.g.,<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">...<br>import fr from '.\/fr'<br> <br>export default {  <br>    fr: {<br>        message: fr<br>    }<br>}<\/pre>\n\n\n\n<p>Now you need to add your locale inside the <code>data.js<\/code> file under the <code>src -> store -> modules -> settings<\/code> directory.index.js<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">export const languages = [<br>   {<br>      name: \"French\",<br>      locale: \"fr\"<br>   }<br>]<\/pre>\n\n\n\n<p>That&#8217;s it, Now you can translate your app in your preferred language.<\/p>\n<div class=\"pld-like-dislike-wrap pld-template-1\">\n    <div class=\"pld-like-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-like-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"198\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-ip-check=\"0\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-up\"><\/i>\n                    <\/a>\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-dislike-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"198\" data-trigger-type=\"dislike\" data-ip-check=\"0\" data-restriction=\"cookie\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-down\"><\/i>\n                    <\/a>\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\n<\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Embryo support multilingual feature which helps you to build your app in multilingual. Read the documentation carefully and follow the steps.\u200c How To Set Default Locale Follow the steps if you want to set default locale you can choose english, french according to your desired locale.\u200c Go to the src -> store -> modules -> [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":22,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/docs.theironnetwork.org\/embryo\/wp-json\/wp\/v2\/pages\/198"}],"collection":[{"href":"https:\/\/docs.theironnetwork.org\/embryo\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.theironnetwork.org\/embryo\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/embryo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/embryo\/wp-json\/wp\/v2\/comments?post=198"}],"version-history":[{"count":7,"href":"https:\/\/docs.theironnetwork.org\/embryo\/wp-json\/wp\/v2\/pages\/198\/revisions"}],"predecessor-version":[{"id":207,"href":"https:\/\/docs.theironnetwork.org\/embryo\/wp-json\/wp\/v2\/pages\/198\/revisions\/207"}],"wp:attachment":[{"href":"https:\/\/docs.theironnetwork.org\/embryo\/wp-json\/wp\/v2\/media?parent=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}