Articles in this section
Category / Section

Localization Support in Bold BI Application in Docker

Published:

Localization Support in Bold BI Application in Docker

Localization is the process of adapting a website to different linguistic and cultural contexts, which involves more than just text translation. By default, the Bold BI application is available in English (en-US) localization. This article will guide you through the process of adding a new localization and editing the existing localization in the Bold BI application deployed in Docker.

Add a New Localization

Follow these steps to add a new localization:

  1. Bash the container using the following command:

    docker exec -it <container name or container ID> bash
    
  2. Create a folder called locale inside the app_data in the deployed location:

    cd /application/app_data/
    mkdir locale
    
  3. Create a folder inside the locale folder and mention the folder name in the locale language code in which you want to generate the localization file. For example, create a folder called fr-FR, which represents the French language code:

    cd locale
    mkdir fr-FR
    

    Create locale folder

  4. Create application folders with the following names inside the language code folder for each service:

    cd fr-FR
    mkdir bi bi-dataservice ums
    

    Create application folders

    Note: By default, the Bold BI is deployed in /application for Docker.

How to Add the Default Locale File in the Application Folder

  1. Exec the container and copy the messages.pot file present in the following folders:

    • /application/bi/web/locale/ and paste the file inside /application/app_data/locale/[language-folder]/bi/ folder.
    • /application/idp/ums/locale/ and paste the file inside /application/app_data/locale/[language-folder]/ums/ folder.
    • /application/bi/dataservice/locale and paste the file inside /application/app_data/locale/[language-folder]/bi-dataservice/ folder.
    docker exec -it <container name or container ID> bash
    cp /application/bi/web/locale/messages.pot /application/app_data/locale/fr-FR/bi/
    cp /application/idp/ums/locale/messages.pot /application/app_data/locale/fr-FR/ums/
    cp /application/bi/dataservice/locale/default.po /application/app_data/locale/fr-FR/bi-dataservice/
    

    How to add application folder

How to Generate the Localization File for Another Language

You can generate the localization file for the application in two ways:

  1. Manual edit
  2. Auto-generate using online tools

Manual Edit

  1. Rename the messages.pot file to messages.po:

    cd /application/app_data/locale/fr-FR/bi
    mv messages.pot messages.po
    

    For bi-dataservice, rename the default.po file to messages.po:

    cd /application/app_data/locale/fr-FR/bi-dataservice/
    mv default.po messages.po
    
  2. Install nano to edit the .po file:

    apt-get update
    apt-get install nano
    
  3. Convert the content in the msgid into the equivalent language of the desired localization support. Replace this converted content into the empty string in msgtr. Also, change the locale Language code at the top of the messages.po file using nano:

    cd /application/app_data/locale/fr-FR/bi-dataservice/
    nano messages.po
    

    Convert the content

  4. After editing the messages.po file, press Ctrl+x to save the changes.

    Save the changes

  5. For Yes, click Shift+y and then click Enter. Now your changes will be saved in the messages.po file.

Auto-Generate Using Online Tools

  1. Zip the locale file:

    apt-get install zip
    zip -r locale.zip locale
    
  2. Create a folder named kube-local in your local machine.

  3. Open the folder in PowerShell and run the following command to copy the file from the container to local:

    docker cp <container name or container id>:/application/app_data/locale.zip ./locale.zip
    

    Copy the file from container to local

  4. Unzip the file and delete the zip file after unzipping.

    Extract the file

  5. Follow the steps in the Bold BI Localization documentation up to step 6.

  6. Change the downloaded file name to messages.po and replace the files in the same location in the unzipped folder.

    Change the download file name

  7. Follow the steps provided in the “How to Generate the Local JS File for bi-dataservice” section.

  8. Zip the folder and copy the zip file to the app_data\locale\[language-folder]\ inside the container by running the following command in PowerShell in the same directory:

    docker cp locale.zip <container ID or container name>:/application/app_data/locale.zip
    

    Picture9.png

  9. Unzip the file inside the container using the following commands:

    docker exec -it <container name or container ID> bash
    apt-get update && apt-get install unzip
    cd /application/app_data/
    unzip -o locale.zip
    
  10. Delete the zip file once the unzip is done:

    rm -rf locale.zip
    

    Delete the zip file

How to Generate the Locale JS File for bi-DataService

  1. Zip the default locale file for bi-dataservice:

    docker cp <container name or container ID>:/application/bi/dataservice ./locale.zip
    
  2. Unzip the file and delete the zip file after unzipping.

    Picture11.png

  3. Download the locale Utility from the provided link. Once the download is completed, extract the .Zip file.

  4. Open the appsettings.json file in an editor and modify the boldbi_custom_locale_path as the deployed path of the designer locale files, boldbi_locale_path locale as the deployed path of BoldBI designer locale files.

    Picture12.png

  5. Run the BoldBI.Locale.Utility.exe file.

    Picture13.png

  6. Once you have run the utility, a locale.js file will be generated in the newly created localized folder path of the designer locale.

    Note: Please run the utility in a Windows environment and generate the locale.js file.

How to Deploy Custom Locale Path for Docker

  1. Take a backup of your app_data and nginx volumes. This will help to retain the old data in case of any issues with the new deployment.

  2. Stop and remove your old container.

  3. Give the custom path {Required Location}\locale\[language-folder]\bi-data-service\locale.js in the value section for the variable AppSettings_locale_path under the environment variable:

    docker run --name boldbi -p 80:80 -p 443:443 -e APP_URL=<app_base_url> -e OPTIONAL_LIBS=<optional_library_names>
    -e AppSettings_locale_path=</application/app_data/locale> -v <host_path_for_appdata_files>:/boldbi/app_data -v <host_path_for_nginx_config>:/etc/nginx/sites-available -d <image name:tag>
    

    Note: After generating the localization file using the preceding steps, you can change the localization in the application by following the steps mentioned in the Localization Support in Embedded Bold BI v5.1+ documentation.

Additional References

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
SR
Written by Sethu Raman Athimoolam
Updated:
Comments (0)
Please  to leave a comment
Access denied
Access denied