Language module
In order to keep a better track of our texts that will be displayed we will need to implement a Language module. We are to store all texts in a file with the name of the language in a JSON formatted object with key and value. The key is how we will read it and the value is what will be displayed.
The keys need to be similar to the possible values in English because we want to have the option to add specific values at certain places. For example:
“You have 10 new orders”. Needs to be with a key similar to “NEW_%s_ORDERS” and the value will be “You have %s new orders”. The 10 will be handled by the code that uses this message. This is to reduce the number of messages we may need. In the example above, without this (%s) we will need two texts one before 10 and one after it.
These files will be in a separate git project that can be manipulated from the Product team in order to reduce the development overhead a change in this may cause.
To make the support for this easier we are to add a job to the deployer that upon deployment of a project (for now only the new UI) it is to scan the files for such texts and to add them to the project and to update it in git. The scraping of the code should check for the calling of the function that calls for this and if a value does not exist in the JSON it should add it and it should use the key as its value.
The strings in the code should be called from a class that will read the JSON for the current language and get the values.