i18n for Grunt
This solution is using grunt-string-replace plugin to replace all translation keys with their values.
Specify a translation key-value pair within the JSON file located at
./source/i18n/en.locale.json,
and then utilize it within an HTML template by simply referencing the key using object notation:
<h2>employeeInfo.editEmployee</h2>
will be compiled into
<h2>Edit employee</h2>
It's supposed that you have already passed these steps:
- Install Node.js (version 14 or above)
- I recommend you to use Node Version Manager
- Install Grunt globally
npm install -g grunt-cli
Install all dependencies:
npm i
grunt
Make sure your Node version is 14 or above (check with node -v
) but a major version should be not higher than 15.
I recommend you to use Node Version Manager for working with different Node versions withing this mono repository.
nvm install 14
nvm use 14
npm i