Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I second Pawel Dyda's answer to use Jquery Globalize Plugin. We are using similar solution in our project.</p> <p>Steps below. </p> <ol> <li><p>Download Jquery Globalize Plugin</p> <p><a href="https://github.com/jquery/globalize" rel="nofollow">https://github.com/jquery/globalize</a></p></li> <li><p>Include <strong>globalize.js</strong> and the JS files for the cultures you need in your HTML file</p> <p>e.g., <strong>globalize.culture.tr.js</strong></p></li> <li><p>Add HTML code with IDs</p> <pre><code>&lt;div id="name"&gt;&lt;/div&gt; &lt;div id="surname&gt;&lt;/div&gt; </code></pre></li> <li><p>Add name and surname to the messages section of the respective language JS files</p> <p>Turkish JS File</p> <pre><code> messages : { "name": "isim", "surname": "soyisim" } </code></pre> <p>Swedish JS file</p> <pre><code> messages : { "name": "namn" "surname": "efternamn" } </code></pre></li> <li><p>Set the culture based on selection</p> <pre><code> Globalize.Culture("tr"); </code></pre></li> <li><p>Update the strings for the culture using .text function or .html function </p> <pre><code> $("#name").text(Globalize.localize("name",globalize.culture())); $("#surname").text(Globalize.localize("surame",globalize.culture())); </code></pre></li> </ol> <p>In our project, we are also using JSON string to populate dropdowns based on culture</p> <ol> <li>Save the dropdown name and value pairs as a JSON string in the messages section</li> <li>Convert the JSON string to JSON object</li> <li>Loop the JSON object and set the Option Name and Value for the dropdown list</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload