Add localization flow
From the search screen user can navigate to add localization screen by clicking the action button
In this screen user can specify the locale(language) and module in which messages have to be upserted
Once the language and module is selected a table is rendered in which user can add the keycode and the respective message. In one go, we can upsert upto 50 messages in this table.
These messages will be upserted into the default locale as well.
After adding the messages user can click on the "Save" action button. Upon success, a relevant toast message is shown and the table is cleared.
In case of failure, an error toast message is shown listing the list of errors due to which the messages could not be upserted.
Same API is utilized for edit and bulk upload as well.
Refer the below curl:
State level users can upsert localizations to all modules
City level users can only upsert to module specific to the tenantId (eg -> pg.citya)
Some examples of city module localizations
This page provides the steps to search localisation data.
Navigate to the Manage Localisation screen from the home screen card. This opens the search localisation screen.
locale -> this field is mandatory. This dropdown is populated based on this mdms https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-UAT/data/pg/common-masters/StateInfo.json
module -> list of modules present in this mdms https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/pg/common-masters/StateInfo.json
keycode -> code of a specific message. It is a string-type parameter
We have the following columns for localisation search results:
Module name
Key code
Default value -> message stored in default locale
Text -> message stored
Action -> Edit action to update message in that particular localisation
While adding localisations, by default all the messages will be updated in the locale mentioned by the user as well as in the "default" locale. The message updated in this locale is considered the default message. While updating the message default locale message remains unchanged.
Localisation search API is an open API. Refer to the curl given below:
Search for the desired language and module using the provided search functionality. The language and module are derived from MDMSv2.
For example, if you are searching for the language ‘English’ and the module ‘rainmaker-common’, Once you perform the search, all relevant results will be displayed below.
Refer to the screenshot below:
Bulk Upload
If you are visiting the screen and it is not localized, the screen will appear as in the screenshot below.
You can localize it with these simple steps:
We have an option to upload Excel sheets (XLSX, XLS) and upsert bulk messages.
From the "Add Localization" screen, there is an option to Bulk upload. See the image below.
Upon clicking the bulk upload option, the user can select an Excel file from the file system.
Copy all the locale code and give the corresponding message to display, module, and locale.
Paste this data into an Excel spreadsheet and save it as an XLSX file.
See the screenshot provided for reference for excel file.
Conditions for valid excel file
Excel file can contain multiple sheets, every sheet must have these four columns:
code
message
locale
module
Upload this XLSX file to the project UI.
After uploading, log out and log back in to see the UI localized.
Now see the UI, it will be as given below:
From the Search screen itself user can update localization messages
Only message text can be edited, we are not allowed to change locale, module and code of the message.
There is a fixed action column in the results table.
Upon clicking the edit icon a modal is opened from where user can add the updated message
User can click on the submit button, a respective toast is shown and the search results are refetched and rendered with the updated message.
API used here is same as add localization.
Select the edit icon in the action column, update the text as needed, and then click submit to save your changes.