Document toolboxDocument toolbox

How to add new language in ASTPP?

1. Get the source code of ASTPP from the Git.

2. Then copy the demo language addon (language_demo) from the given path

ASTPP/web_interface/astpp/addons/Community/language_demo/

The demo language addon has a complete directory structure with the required file to develop any language-specific addons. It contains all required files with dummy data. You need to modify those files to make it ready.

3. Language_demo

If you check the hierarchy of the demo language addon then it will look like this.

Note

  • Here keyword demo will be replaced with language local code (Example: For language Russian, the code will be ru_RU)


  • Local code for any language you can easily find on the internet. Please make sure we must have to use the global code which is accepted by all and defined globally for any language.

Here, the keyword demo will be replaced with the language local code (Example: For language Russian, the code will be ru_RU)

Local code for any language you can easily find on the internet. Please make sure we must have to use the global code which is accepted by all and defined globally for any language.

4. Now we are ready with all base files and we can start modification on language addon files to make it ready. In this tutorial, we are going to build a complete addon for the Russian language. First, let's rename all files with Russian keywords. For that, you need to replace the keyword demo where you find any file name with Russian.

After renaming all files the structure will look like this.

5. Now let's start content modification into all files where it required.

First, we start with database-related modification. For that we have to change queries into file : database/language_demo_1.0.0.sql

You can find the default query with the demo keyword but as we are going to build this addon for the Russian language so let's modify the queries to install the language option into the database.

After modification, it should look like as the given image.

6. Now we are done with the installation part, in the same way, we have to change queries for the uninstallation process. The reason to add delete queries is when you uninstall any addon it can remove dependent entries from the database.

File : database/uninstall.sql

Please modify the queries with your language option so it will look like :

7. Now add new translation keywords (/web_interface/astpp/language).csv file (the first column is English and the second column is your language). In our case, the first column contains all english keywords and the second column will contain all Russian keywords.

8. csv name must be the same as the language locale name. (Example: ru_RU.csv)

9. CSV Files convert the keywords that are going to be used into the ASTPP portal but the keywords which is used by the PHP framework to show database or framework-related errors is converted by internal framework files. To convert those messages we have to add translation on the below path.

Open the files and convert all messages into Russian language.

10. Now at last update the XML code on the "module.xml" file. The importance of modifying XML file is to list the correct details on the addon page.

Replace this XML with the default XML code.

<?xml version="1.0" encoding="UTF-8"?>

<addon>

<tech_name>language_russian</tech_name>

<name>Russian Localization</name>

<description>Add Russian Language Support.</description>

<icon>static/images/language_russian.png</icon>

<version>1.0.0</version>

<license>Enterprise</license>

<author>iNextrix Technologies Pvt. Ltd.</author>

<status>production</status>

</addon>

11. Now the addon is ready to install.

12. Install it

NOTE : Now click on install to install the language addon.

13. Show where he can find newly added language (Configuration -> Languages->languages)

14. Select a new language from the dropdown and display a dashboard screenshot.

When you want to change the language for the portal, you just need to select a language from the language dropdown given in the footer section.