Add Localisation Data

Add localization flow

Adding Localizations

  • 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.

API for adding localizations

Same API is utilized for edit and bulk upload as well.

Refer the below curl:

curl --location 'http://localhost:3000/localization/messages/v1/_upsert' \
--header 'Accept: application/json, text/plain, */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'Origin: http://localhost:3000' \
--header 'Referer: http://localhost:3000/workbench-ui/employee/workbench/localisation-add' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-origin' \
--header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36' \
--header 'sec-ch-ua: "Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "Windows"' \
--data '{"tenantId":"pb","messages":[{"code":"sdf","message":"dsf","locale":"default","module":"rainmaker-test","id":0}],"RequestInfo":{"apiId":"Rainmaker","authToken":"5bbfa93c-adc2-42b2-992e-a708a83cb2cf","userInfo":{"id":80234,"uuid":"aeb85b37-c996-4218-bdca-1b00cc268f2f","userName":"WBQA","name":"LOC","mobileNumber":"9999991942","emailId":null,"locale":null,"type":"EMPLOYEE","roles":[{"name":"MDMS ADMIN","code":"MDMS_ADMIN","tenantId":"pb"},{"name":"Super User","code":"SUPERUSER","tenantId":"pb"},{"name":"Localisation admin","code":"LOC_ADMIN","tenantId":"pb"},{"name":"Employee","code":"EMPLOYEE","tenantId":"pb"}],"active":true,"tenantId":"pb","permanentCity":null},"msgId":"1694166894795|en_IN","plainAccessRequest":{}}}'

Tenant Module Localization

  • 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


       {
            "code": "PG_CITYA_ADMIN_B2",
            "message": "Ward Two",
            "module": "rainmaker-pg.citya",
            "locale": "en_IN"
        },
        
        {
            "code": "PG_CITYA_ADMIN_B3",
            "message": "Ward Three",
            "module": "rainmaker-pg.citya",
            "locale": "en_IN"
        }

Last updated

All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.