Internationalization and Localization
WSO2 API Manager comes with two Web applications as API Publisher and API Store. API Publisher is designed for API development, community aspects, lifecycle management and publication while WSO2 API Store is designed for API consumers to subscribe to and consume APIs. The instructions given below show how to localize WSO2 API Publisher Web application in Spanish. Same instructions apply to localization of the API Store as well.
Changing the Browser Settings
1. First, set the browser language to a preferred language. Instructions should be available in the web browser user guide. For example, language can be selected in Google Chrome through "Settings -> Show advanced settings -> Languages" menu.
2. Set the browser's encoding type to UTF-8.
Introduction to the Resource Files
3. Go to $AM_HOME/repository/deployment/server/jaggeryapps/publisher directory where $AM_HOME is the API Manager distribution home.
4. There are two types of resource files used to define localization strings in WSO2 API Manager.
- The resource file used to store the strings defined in .jag files according to browser locale (For example, locale_en.json) is located at .../publisher/site/conf/locales/jaggery folder.
- The resource file i18nResources.json, which is used to store strings defined in client-side javascript files such as pop-up messages when a UI event is triggered is located at .../publisher/site/conf/locales/js folder.
For example,
To implement localization support for jaggery, we have used its in-built script module 'i18n'. For more information, refer to http://jaggeryjs.org/apidocs/i18n.jag.
Localize Strings in jaggery Files
5. To localize the API publisher to Spanish, first localize the strings defined in jaggery files. Create a new file by the name "locale_{lolcaleCode}.json" inside '...publisher/site/conf/locales/jaggery' folder. For example, if the language set in the browser is Spanish, the locale code is 'es' and the file name should be "locale_es.json".
6. Add the key-value pairs to locale_es.json file. For an example of how to add key value pairs, you can refer to 'locale_en.json' file in '...publisher/site/conf/locales/jaggery' folder. It is the default resource file for jaggery.
In addition, a section of a sample 'locale_es.json' file is shown below for your reference.
Localize Strings in Client-Side javascript Files
7. To localize the javascript UI messages, navigate to 'publisher/site/conf/locales/js folder and update "i18nResources.json" file with relevant values for the key strings.
8. Once done, open the API Publisher web application in your browser (https:
//<YourHostName>:9443/publisher).
9. Note that the UI is now changed to Spanish.