SPICE Product Docs
SPICE 2.0 Docs
SPICE 2.0 Docs
  • Overview
    • 📒What is SPICE?
    • ✨SPICE App Workflows
      • Household Registration
      • Assessment
      • Follow-up
      • My Patients
      • Medical Review
      • Pharmacy
    • đŸ‘Šâ€âš•ī¸SPICE Users
    • đŸĸAdmin Workflows
      • Admin Portal
    • 🔏Data Privacy & Security
      • Privacy Policy
      • Terms & Conditions of Use
    • ❓Frequently Asked Questions (FAQs)
  • Engineering
    • đŸ–Ĩī¸Architecture
      • C4 Diagrams
      • Architecture Diagram
    • 🔧Technology Stack
    • 👨‍đŸ’ģAPI Documentation
      • Common Services
        • Login
        • Reset Password
        • Logout
        • Verify Set Password
        • User Profile Update
        • Set Password for new User
        • Validate Phone Number
        • Get User Details
        • Change Password for Users
        • Forgot Password
        • Validate User Email
        • Get User Profile
      • Admin Services
        • Lab Test Customization
          • Lab Test Update
          • Lab Test List
          • Lab Test by Name
          • Lab Test Delete
          • Lab Test Create
          • Lab Test Validate
        • Medication
          • Medication List
          • Medication Create
          • Medication Update
          • Medication Remove
          • Medication Validate
        • User
          • User Validate
          • User List
          • User Remove
          • User Create and Update
        • Get Menu
        • Country List
        • Health Facility
          • Health Facility Update
          • Health Facility List
          • Health Facility Create
          • Health Facility Details
        • Region
          • Get Region Detail
          • Region Upload
          • Region Download
      • SPICE Service
        • Patient Search
        • Household Create
        • Patient List
        • Member Create
        • Offline Sync
          • Offline Household Create
          • Offline Member Create
        • Medical Review
          • ANC Pregnancy Create
          • ANC Pregnancy Detail
          • ICCM Under two months Create
          • ICCM Under five years Create
          • ICCM Under two months Details
          • Labour Mother Neonate Create
          • ICCM Under five years Details
          • Labour Mother Neonate Details
          • PNC Create
          • PNC Details
        • Assessment
          • Childhood Visit
          • ICCM
          • ANC
          • PNC
          • Other Symptoms
        • Investigation
          • Create Investigation
          • Investigation Remove
          • Investigation History List
        • Prescription
          • Prescription Remove
          • Prescribed Details
          • Prescription Create
        • App Version
        • Calculate WGS
        • Create Diagnosis
        • Diagnosis Details
        • Get Chiefdoms
        • Get Districts
        • Get Patient Status
        • Get Patient Details
        • Household Update
        • Member Update
  • Deploy
    • 🚀Deployment Guide
      • 📱Android
      • đŸ–Ĩī¸Admin Portal
      • đŸ—„ī¸HAPI FHIR Server
      • đŸ—„ī¸Server
    • 🌎Customization Guide
      • Multi-Language Translation
        • Support for multiple languages
      • Clinical Workflow Customization
      • WHO Hearts Algorithm
      • Country Level Administrative Divisions
  • PRODUCT
    • đŸĨ˜Releases
    • đŸ›Ŗī¸Roadmap
  • COMMUNITY
    • 🧑‍đŸ’ģEngage
    • 📞Support
    • 📃Policies
  • LINKS
    • Source Code (GitHub)
    • Medtronic LABS
    • Developer Support
  • versions
    • SPICE 1.0
      • OVERVIEW
        • 📒What is SPICE?
        • ✨SPICE App Workflows
          • Screening
          • Enrollment
          • Assessment
          • Medical Review
            • Treatment Plan
            • Prescribe
            • Lab Test
          • My Patients
          • Pharmacy
          • Admin Portal
        • đŸ‘Šâ€âš•ī¸SPICE Users
        • 🔏Data Privacy & Security
          • Privacy Policy
          • Terms & Conditions of Use
        • ❓Frequently Asked Questions (FAQs)
      • ENGINEERING
        • đŸ–Ĩī¸Architecture
          • C4 Diagrams
          • FHIR & Standards
        • 🔧Technology Stack
        • 👨‍đŸ’ģAPI Documentation
          • Common Services
            • Account Create
            • Change Password for Site Users
            • Country Create
            • Forgot Password
            • Get User Details
            • Get User Profile
            • Locked Users List
            • Login
            • Logout
            • Operating Unit Create
            • Reset Password
            • Set Password for New User
            • Site Create
            • Unlock User
            • User Profile Update
            • Validate User Email
            • Verify Set Password
            • Super Admin
              • Superadmin Details
              • Superadmin List
              • Superadmin Create
              • Superadmin Delete
              • Superadmin Update
          • Admin Services
            • Account
              • Account - Activate
              • Account - Deactivate
              • Account - Deactivated list
              • Account - Details
              • Account - Update
              • Account Admin - Create
              • Account Admin - Delete
              • Account Admin - Update
              • Account Dashboard - Region Admin
              • Account List - Admin
            • Clinical Workflow
              • Create
              • Delete
              • List
              • Update
              • Account Customization - Create
              • Account Customization - Details
              • Account Customization - Update
            • Country Dashboard - Superadmin
            • Lab Test
              • Create
              • Delete
              • Details
              • List
              • Update
              • Lab Test Range - Create
              • Lab Test Range - Delete
              • Lab Test Range - Details
              • Lab Test Range - Update
            • Medication
              • Create
              • Delete
              • Medication Validation
              • List
              • Update
            • Operating Unit
              • Operating Unit - Details
              • Operating Unit - Update
              • Operating Unit Admin - Create
              • Operating Unit Admin - Remove
              • Operating Unit Admin - Update
              • Operating Unit Dashboard - Account Admin
              • Operating Unit List - Admin
            • Program
              • Create
              • List
              • Delete
              • Details
              • Update
            • Region Admin
              • Region Admin - Create
              • Region admin - Delete
              • Region Admin - Details
              • Region admin - Update
            • Site
              • Site - Details
              • Site - Update
              • Site Dashboard - Operating Unit Admin
              • Site List - Admin
              • Site User - Create
              • Site User - Remove
              • Site User - Update
            • Site List - Region Admin
          • SPICE Services
            • Advance-search
            • Advanced search - Site
            • App Version
            • Assessment
            • Assessment Bplog Create
            • Assessment Glucose log Create
            • BPLog List
            • BPLog Create
            • Confirm Diagnosis
            • Device Details
            • Fill Prescription - Update
            • GlucoseLog Create
            • GlucoseLog List
            • Investigation Create
              • Fill Prescription List
            • Investigation List
            • Investigation Search
            • Labtest Result Create
            • Labtest Result Details
            • Labtest Result List
            • Lifestyle Create
            • Lifestyle List
            • Lifestyle remove
            • Lifestyle Update
            • Lifestyle Update view Status
            • Lifestyle view history
            • Medical Review Create - Continuous Medical Review
            • Medical Review Create - Initial Medical Review
            • Medical Review Static Data
            • Medical Review Count
            • Medical review list
            • Medical Review Summary
            • Mental Health Create
            • Mental Health Details
            • Mobile - Forgot Password
            • Mobile - Login
            • Mobile - Logout
            • Nutritionist Lifestyle Create
            • Patient Basic Details
            • Patient Details
            • Patient enrollment
            • Patient-labtest-list
            • Patient Labtest - Remove
            • Patient Labtest - Review
            • Patient-lifestyle-details
            • Patient list
            • Patient Pregnancy Details
            • Patient Pregnancy Details Create
            • Patient Remove
            • Patient Transfer - Create
            • Patient Transfer Count
            • Patient Transfer - Country Site List
            • Patient Transfer - Role user list
            • Patient Transfer List
            • Patient Transfer - Update
            • Patient Transfer - Validate
            • Patient update
            • Patient Visit
            • PatientVisit
            • Pregnancy Create
            • Pregnancy Details
            • Prescription History List
            • Prescription List
            • Prescription Remove
            • Prescription search
            • Pregnancy Update
            • Prescription-history list
            • Prescription Update
            • Refill Prescription History
            • Screening
            • Screening log details
            • Search
            • Transfer Notification Count
            • Treatment Plan Details
            • Treatment Plan Update
            • User Validate API
          • FHIR-Adapter Services
            • Add User
            • Get User By Id
            • Get User By Username
            • Get User List
            • Get User Profile
            • Update User
            • Reset User Password
            • Delete User by ID
            • Forgot Password Validation
            • Options
            • Receive Message
            • Login
            • Site Migration
            • User Migration
            • APIKey Manager API
              • Retrieve API Keys
              • Generate API Keys
              • Delete API Keys
              • Validate API Key
      • DEPLOY
        • 🚀Deployment Guide
          • đŸ—„ī¸Server
          • 📱Android
          • đŸ–Ĩī¸Admin Portal
          • đŸ—„ī¸FHIR Adapter
        • 🌎Customization Guide
          • Multi-Language Translation
            • Support for multiple languages
          • Clinical Workflow Customization
          • WHO Hearts Algorithm
          • Country Level Administrative Divisions
      • PRODUCT
        • đŸĨ˜Releases
        • đŸ›Ŗī¸Roadmap
      • LINKS
        • Source Code (GitHub)
        • Medtronic LABS
        • Developer Support
Powered by GitBook

@2024 Medtronic LABS

On this page
  • Translation Implementation Details
  • Steps to Add Translations
  • To run the shell script, follow these steps:
  • Multi-Language Translation Implementation for Windows OS
  • Translation Implementation Details
  • Steps to Add Translations
  • Building JSON for Forms with Cultural Translations (Android Changes)
  • 1. Including Cultural Translations in the Base JSON:
  • 2. Translating Field Labels and Error Messages:
  • 3. Translating Spinner Options:
  • 4. Translating Radio Button Options:
  • Sample Implementation: Bengali Language Translation
  1. Deploy
  2. Customization Guide

Multi-Language Translation

This supports multi-language translation for user-facing content. By following the steps outlined below, users can add translations for additional languages to the system.

Translation Implementation Details

Folder Structure

user-service/src/main/resource/db/migration/translation

Steps to Add Translations

Prepare Translation Metadata: Begin by creating a translate.txt file within the translation folder. This file contains metadata for the English language and allows users to map corresponding translations in their desired language. Each line should consist of a key-value pair, where the key represents the English text and the value is the translation in the user's language.

translate.txt

Tablet: āĻŸā§āϝāĻžāĻŦāϞ⧇āϟ
Nutrition: āĻĒ⧁āĻˇā§āϟāĻŋ

insert_culture_values.sql : SQL file containing string literals of the English values. This file serves as a template for inserting translations into the database.

execute_translation.sh: Utilize the provided shell script to automate the translation mapping and insertion process. The script reads data from the translate.txt file and maps the corresponding values against the string literals in the SQL file.

Users are required to provide their PostgreSQL connection details, path to the translate.txt file, and the path to the SQL query file. Once executed, the script inserts the translated data into the user database.

To run the shell script, follow these steps:

Ensure that you have PostgreSQL installed and running.

Navigate to the translation folder.

cd user-service/src/main/resource/db/migration/translation

Execute the shell script by running the following command:

./translate.sh

Follow the prompts to enter your PostgreSQL connection details, the path to the translate.txt file, and the path to the SQL query file.

Multi-Language Translation Implementation for Windows OS

This supports multi-language translation for user-facing content, specifically for Windows OS users. Follow the steps outlined below to configure and execute the translation process.

Translation Implementation Details

Folder Structure

user-service/src/main/resource/db/migration/translation

Steps to Add Translations

Configure Database Connection: Open the execute_translation file located in the windows_script folder. Configure your database connection details and provide the paths for the SQL file and translate.txt file.

Execute Shell Script: After assigning the corresponding values to the translate.txt file and updating the database configuration, execute the script in Git Bash. Navigate to the windows_script folder and execute the following command:

./execute_translation

This script will create a temp_script.sql file containing the translated values in SQL script format.

Execute Temporary SQL Script in Windows:

Navigate to the PostgreSQL folder on your desktop/laptop.

Execute the following commands to set the encoding to UTF-8:

SET PGCLIENTENCODING=utf-8
chcp 65001

After setting the encoding, execute the following psql command to execute the temporary SQL script. Replace placeholders (---host ip---, ---port-id---, ---dbname---, ---temp sql script path---) with your actual database connection details and the path to the temporary SQL script:

psql -h ---host ip--- -p ---port-id--- -d ---dbname--- -U postgres -W -f "---temp sql script path---"

Building JSON for Forms with Cultural Translations (Android Changes)

The following explains the procedure for integrating cultural translations (utilizing Bengali language as an example) into JSON structures utilized for the dynamic generation of forms, especially for assessments, screenings, and enrollment. It highlights the significance of integrating cultural values into dynamic form generation systems.

1. Including Cultural Translations in the Base JSON:

The below showcases the general structure of a form generator JSON. To include a language(Bengali) translation for the entire form, add a key-value pair with the key titleCulture and the desired Bengali translation (āĻŦāĻžāϝāĻŧā§‹āĻĄāĻžāϟāĻž in this example) as the value, specifically for the title field.

{
      "familyOrder": 0,
      "viewType": "CardView",
      "id": "bioData",
      "title": "Bio Data"
}

{
      "familyOrder": 0,
      "viewType": "CardView",
      "id": "bioData",
      "title": "Bio Data",
      "titleCulture": "āĻŦāĻžā§Ÿā§‹āĻĄāĻžāϟāĻž"
}

2. Translating Field Labels and Error Messages:

The example below demonstrates how to include cultural translations within a specific form field's JSON definition. Here, a FirstName field is used. We've added Bengali translations for the following:

  • title - Translated to āĻĒā§āϰāĻĨāĻŽ āύāĻžāĻŽ using the titleCulture key.

  • hint - Translated to āĻĒā§āϰāĻĨāĻŽ āύāĻžāĻŽ āϞāĻŋāϖ⧁āύ using the hintCulture key.

  • cultureErrorMessage - A Bengali error message āĻĒā§āϰāĻĨāĻŽ āύāĻžāĻŽ āĻ…āĻŦāĻļā§āϝāχ āĻĒā§‚āϰāĻŖ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ āĻāĻŦāĻ‚ āĻāϟāĻŋ ā§§ āĻĨ⧇āϕ⧇ ā§§ā§Ļā§Ļ āĻŦāĻ°ā§āϪ⧇āϰ āĻŽāĻ§ā§āϝ⧇ āĻšāϤ⧇ āĻšāĻŦ⧇ is provided.

{
      "isNotDefault": false,
      "fieldName": "First Name",
      "visibility": "visible",
      "orderId": 1,
      "minLength": 1,
      "errorMessage": "First name is required and must be length of 1 to 100",
      "isSummary": true,
      "title": "First Name",
      "isNeededDefault": true,
      "condition": [],
      "isEnabled": true,
      "hint": "Enter First Name",
      "viewType": "EditText",
      "inputType": 96,
      "id": "firstName",
      "family": "bioData",
      "isMandatory": true,
      "maxLength": 100
}

{
      "isNotDefault": false,
      "fieldName": "First Name",
      "visibility": "visible",
      "orderId": 1,
      "minLength": 1,
      "errorMessage": "First name is required and must be length of 1 to 100",
      "isSummary": true,
      "isNeededDefault": true,
      "title": "First Name",
      "hintCulture": "āĻĒā§āϰāĻĨāĻŽ āύāĻžāĻŽ āϞāĻŋāϖ⧁āύ",
      "titleCulture": "āĻĒā§āϰāĻĨāĻŽ āύāĻžāĻŽ",
      "condition": [],
      "hint": "Enter First Name",
      "isEnabled": true,
      "viewType": "EditText",
      "inputType": 96,
      "id": "firstName",
      "family": "bioData",
      "isMandatory": true,
      "maxLength": 100,
      "cultureErrorMessage": "āĻĒā§āϰāĻĨāĻŽ āύāĻžāĻŽ āĻ…āĻŦāĻļā§āϝāχ āĻĒā§‚āϰāĻŖ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇ āĻāĻŦāĻ‚ āĻāϟāĻŋ ā§§ āĻĨ⧇āϕ⧇ ā§§ā§Ļā§Ļ āĻŦāĻ°ā§āϪ⧇āϰ āĻŽāĻ§ā§āϝ⧇ āĻšāϤ⧇ āĻšāĻŦ⧇"
 }

3. Translating Spinner Options:

Spinners allow users to choose from a predefined list. The example explains how to incorporate Bengali translations into the JSON for such a field. Here's what's included:

  • titleCulture - Translated to āĻŽā§‹āĻŦāĻžāχāϞ āύāĻŽā§āĻŦāϰ⧇āϰ āϧāϰāύ for the spinner's title.

  • optionsList - Each option within the list has a cultureValue field for the Bengali translation. For instance, "Personal" is translated to āĻŦā§āϝāĻ•ā§āϤāĻŋāĻ—āϤ, "Family Member" to āĻĒāϰāĻŋāĻŦāĻžāϰ⧇āϰ āϏāĻĻāϏ Õ°Õ˛āύāĻž, and "Friend" to āĻŦāĻ¨ā§āϧ⧁.

  • cultureErrorMessage - A Bengali error message āĻ…āύ⧁āĻ—ā§āϰāĻš āĻ•āϰ⧇ āĻļā§āϰ⧇āĻŖā§€ āύāĻŋāĻ°ā§āĻŦāĻžāϚāύ āĻ•āϰ⧁āύ is provided.

{
      "isNotDefault": false,
      "fieldName": "Mobile Number Category",
      "visibility": "visible",
      "orderId": 5,
      "defaultValue": "Personal",
      "errorMessage": "Please select a category",
      "isSummary": false,
      "title": "Mobile Number Category",
      "isNeededDefault": true,
      "condition": [],
      "optionsList": [
        {
          "name": "Personal",
          "id": "Personal"
        },
        {
          "name": "Family Member",
          "id": "Family Member"
        },
        {
          "name": "Friend",
          "id": "Friend"
        }
      ],
      "isEnabled": true,
      "viewType": "Spinner",
      "id": "phoneNumberCategory",
      "family": "bioData",
      "isMandatory": true
}

{
      "isNotDefault": false,
      "fieldName": "Mobile Number Category",
      "visibility": "visible",
      "orderId": 5,
      "defaultValue": "Personal",
      "errorMessage": "Please select a category",
      "isSummary": false,
      "isNeededDefault": true,
      "title": "Mobile Number Category",
      "titleCulture": "āĻŽā§‹āĻŦāĻžāχāϞ āύāĻŽā§āĻŦāϰ⧇āϰ āϧāϰāύ",
      "condition": [],
      "optionsList": [
        {
          "name": "Personal",
          "cultureValue": "āĻŦā§āϝāĻ•ā§āϤāĻŋāĻ—āϤ",
          "id": "Personal"
        },
        {
          "name": "Family Member",
          "cultureValue": "āĻĒāϰāĻŋāĻŦāĻžāϰ⧇āϰ āϏāĻĻāĻ¸ā§āϝ",
          "id": "Family Member"
        },
        {
          "name": "Friend",
          "cultureValue": "āĻŦāĻ¨ā§āϧ⧁",
          "id": "Friend"
        }
      ],
      "isEnabled": true,
      "viewType": "Spinner",
      "id": "phoneNumberCategory",
      "family": "bioData",
      "isMandatory": true,
      "cultureErrorMessage": "āĻ…āύ⧁āĻ—ā§āϰāĻš āĻ•āϰ⧇ āĻļā§āϰ⧇āĻŖā§€ āύāĻŋāĻ°ā§āĻŦāĻžāϚāύ āĻ•āϰ⧁āύ"
}

4. Translating Radio Button Options:

Similar to spinners, radio buttons allow users to select one option. The example explains how to incorporate Bengali translations into their JSON definition:

  • titleCulture - Translated to āϞāĻŋāĻ™ā§āĻ— for the radio button group's title.

  • optionsList - Each option within the list has a cultureValue field for the Bengali translation. For instance, "Male" is translated to āĻĒ⧁āϰ⧁āώ, "Female" to āĻŽāĻšāĻŋāϞāĻž, and "Non-Binary" to āύāύ-āĻŦāĻžāχāύāĻžāϰ⧀.

  • cultureErrorMessage - A Bengali error message āĻ…āύ⧁āĻ—ā§āϰāĻš āĻ•āϰ⧇ āϞāĻŋāĻ™ā§āĻ— āύāĻŋāĻ°ā§āĻŦāĻžāϚāύ āĻ•āϰ⧁āύ is provided.

By following these guidelines, you can create culturally inclusive forms that cater to Bengali users.

{
      "orientation": 0,
      "fieldName": "Gender",
      "visibility": "visible",
      "orderId": 1,
      "errorMessage": "Please select a gender",
      "isSummary": true,
      "title": "Gender",
      "isNeededDefault": true,
      "optionType": "string",
      "condition": [],
      "optionsList": [
        {
          "name": "Male",
          "id": "Male"
        },
        {
          "name": "Female",
          "id": "Female"
        },
        {
          "name": "Non-Binary",
          "id": "Non-Binary"
        }
      ],
      "isEnabled": true,
      "viewType": "RadioGroup",
      "id": "gender",
      "family": "bioMetrics",
      "isMandatory": true
}

{
      "orientation": 0,
      "fieldName": "Gender",
      "visibility": "visible",
      "orderId": 1,
      "errorMessage": "Please select a gender",
      "isSummary": true,
      "isNeededDefault": true,
      "title": "Gender",
      "titleCulture": "āϞāĻŋāĻ™ā§āĻ—",
      "optionType": "string",
      "condition": [],
      "optionsList": [
        {
          "name": "Male",
          "cultureValue": "āĻĒ⧁āϰ⧁āώ",
          "id": "Male"
        },
        {
          "name": "Female",
          "cultureValue": "āĻŽāĻšāĻŋāϞāĻž",
          "id": "Female"
        },
        {
          "name": "Non-Binary",
          "cultureValue": "āύāύ-āĻŦāĻžāχāύāĻžāϰ⧀",
          "id": "Non-Binary"
        }
      ],
      "isEnabled": true,
      "viewType": "RadioGroup",
      "id": "gender",
      "family": "bioMetrics",
      "isMandatory": true,
      "cultureErrorMessage": "āĻ…āύ⧁āĻ—ā§āϰāĻš āĻ•āϰ⧇ āϞāĻŋāĻ™ā§āĻ— āύāĻŋāĻ°ā§āĻŦāĻžāϚāύ āĻ•āϰ⧁āύ"
}

Sample Implementation: Bengali Language Translation

As a demonstration of the multi-language translation module, we have implemented translation for the Bengali language. The translation values can be found at the specified path mentioned in the initial documentation.

This serves as a reference for users to understand the process and structure of the translation module.To use this sample as a guide when implementing translations for additional languages.

After updating the translation values of meta tables, it's necessary to restart the Spice service so that the translation data will be visible in the application.

PreviousCustomization GuideNextSupport for multiple languages

Last updated 3 months ago

🌎