Closed sadashivm closed 2 years ago
but why not using react-i18next with react (how it is meant to be)
Hi Jamuhl, Thanks for reply! I checked the above reference link, still it is not working and I want to this plugin in clojure application hence I'm not using react-i18next.
Here is the my code,
and output is,
please create a sandbox sample for easier recreation of the problem...my current guess is that your i18n-options
are not correctly formatted and can't be parsed as JSON -> but you would have to check / debug it -> or provide a sample on codesandbox so I can have a look
Hi jamuhl, please check below sandbox example, https://codesandbox.io/s/zen-visvesvaraya-rythp?file=/src/App.js
like shown here:
the options attribute as default is disabled: https://github.com/mthh/loc-i18next#initialize-the-plugin
changing useOptionsAttr: true in your code does the trick:
function updateContent() {
const localize = locI18next.init(i18next, {
// optionsAttr: "data-i18n-options",
useOptionsAttr: true
});
localize("html");
}
Wow, great!!!!!!!! It is working jamuhl. Thank you so much. Have a great day :)
I'm using this library using npm module like, npm install i18next npm install loc-i18next
the above npm packages have installed in my react application but I dont want to use "npm i react-i18next".
Here is the sample code,
LocalizationExample.js
en.json
de.js
Can you please tell me, how to pass username value to key_3 paramater?