Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with i118next initialization
    primarykey
    data
    text
    <p>I am using the i18next script in my jQuery Mobile page in Cordova/PhoneGap app.</p> <p>I have the below scripts included in the bottom of HTML page.</p> <pre><code>&lt;script src="js/jquery-1.8.3.min.js"&gt;&lt;/script&gt; &lt;script src="js/jquery.mobile-1.3.2.min.js"&gt;&lt;/script&gt; &lt;script src="js/i18next-1.7.1.min.js"&gt;&lt;/script&gt; &lt;script src="js/main.js"&gt;&lt;/script&gt; </code></pre> <p>The main.js file has some logic which will be included in all pages of my app. </p> <p><strong>main.js</strong> File:</p> <pre><code>function doBootstrap() { i18n.init({lng: "en", fallbackLng: 'en'}); var header = "some tags"; header += '&lt;h1&gt;' + i18n.t("app.title") + '&lt;/h1&gt;'; // other functions } </code></pre> <p>I will be using the script to get the translated values across the page in different sections</p> <p>The above function is called in Cordova devideready function which is placed beow the above mentioned includes. .</p> <pre><code>document.addEventListener("deviceready", onDeviceReady, true); function onDeviceReady() { doBootstrap(); } </code></pre> <p>With all the above setup I get the below error in i18next-1.7.1.min.js file.</p> <pre><code>Uncaught TypeError: Cannot read property 'defaultValue' of undefined </code></pre> <p>The .json file is present in \locales\en\translation.json and the content of it is below. No error or warning is displayed in console.</p> <pre><code>{ "app": { "title": "Title" } } </code></pre> <p>What I am missing with the plugin setup?</p>
    singulars
    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.
 

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