The SUSI SKill CMS provides skills in multiple languages. Often there are similar skills in different languages. For example, there is a News skill in English and Samachar skill in Hindi. Then why not link them together and mark one as the translation of the other. This will help the user to reach and explore the desired skill in an efficient way. Moreover, it may be easier to type ‘News’ than ‘समाचार’ and find the required skill through translations. So here it has been explained how to link two SUSI skills as translations.
Server side implementation
Create a skillSupportedLanguages.json file to store the related skills together as translations and make a JSONTray object for that in src/ai/susi/DAO.java file. The JSON file contains the language name and the skill name in that language, wrapped in an array.
Now create an API that accepts the skill details and translation details and stores them in the JSON file. Create UpdateSupportedLanguages.java class for the API.
Minimum user role: Anonymous
- Language (language of the skill for which translation is to be added)
- Skill (name of the skill for which translation is to be added)
- New language (translation language of the skill)
- New skill name (name of the skill in translated language)
When a new translation is added check if it already exists in the translation group stored in the skillSupportedLanguages.json. Use the DAO object and loop over the array, check is the language name and the language name already exists. If yes then simply return.
Otherwise, create a new object containing the new language name and the skill name in that language and add it to the translation group.
Add this API to SusiServer.java
- JSONTray – https://dev.susi.ai/javadoc/index.html?ai/susi/json/JsonTray.html
- Wikipedia (list of languages with their ISO 639-1 codes) – https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes