We are in the process of developing an application that makes use of html/css/js, incorporating i18next for displaying translated strings.
To display these translations, I insert an attribute within a tag. Here's an example:
<a href="#top" id="agreement" data-i18n="text_agreement">利用規約</a><label for="checkbox2" data-i18n="text_agree">に同意する</label>
Along with this, the application utilizes a javascript file to replace strings with translations. For example, the code above corresponds to:
en: { translation: {
text_agreement: 'Agree to EULA'
} }
While this method of translation works for HTML tags, I am unsure how to translate strings within the js code. How would I display translated strings for something like this?
element.alert('なまえを記入してください。');
Any assistance with this matter would be greatly appreciated.