i18n
stands for internationalization
, the process and means to adapt text, unit of measures and other language-specific aspects of software to the different languages and their norms. The code you added in the previous step is referring to a folder called i18n
in the base directory, where the text bundles are. Create the folder and a file called messages.properties
with the following content:
greeting = Hello! Welcome to {0} running on {1}.
You can see the code in textBundle.js
is getting the language from the request and passing it to the TextBundle
library, getting the text greeting
. You can add a file called messajes_ja.properties
for the translation in Japanese:
greeting = こんにちは!{0}上で実行されているへようこそ{1}
Or the following for the translation in German, in a file called message_de.properties
.
greeting = Hallo! Willkommen bei {0} läuft auf {1}
This is what the files should look like: