Provide API Portal in multiple languages

You can provide API Portal in multiple languages at the same time to cater for your API consumers from different countries. The API consumers can use language-specific URLs to access API Portal in their own language.

Unlike when localizing API Portal to a single language, you are not simply substituting the language with another one. Instead, when providing several language versions of your API Portal, you must duplicate the API Portal elements and content for each language in addition to changing the UI texts. The process is as follows:

  1. Add a new content language and main menu
  2. Clone the main menu items
  3. Duplicate the page template styles
  4. Publish additional languages

You do not have to install a language to Joomla! before configuring the required components. However, it might help you to find the correct details when configuring a language.

Add a new content language and main menu

To add a new content language and main menu, follow these steps:

  1. In the Joomla! Administrator Interface (JAI) left navigation bar, click Language(s) > Content Languages.
  2. Joomla Languages Content Languages
  3. Note   If you have already installed the new language, a corresponding content language will already exist for that language and you can skip the following steps 3 to 7, and continue from step 8.
  4. Click New to add a new content language.
  5. On the Details tab, enter the Title and Title Native for the new language. The titles can be the same.
  6. Enter the Joomla! Language Tag. Ensure that you enter the tag in the correct format. You must use "-" instead of "_" (for example, fr-FR).
  7. In URL Language Code, enter the language identifier to use in the language-specific URL (for example, fr). The identifier must be unique for each language.
  8. Set Status to Unpublished, and click Save & Close.
  9. For more details on the parameters, see the tutorial for Joomla! Language Switcher.
  10. In the JAI top navigation bar, click Menus > Manage > Add New Menu.
  11. In Title, enter the title to be shown in drop-down lists (for example, Main menu (fr)).
  12. On the Menu Details tab, in Menu Type, enter a system identifier for the new main menu (for example, mainmenufr).
  13. Click Save & Close.

Clone the main menu items

You must duplicate the API Portal main menu for each language.

  1. In the JAI top navigation bar, click Menus and select the main menu to clone.
  2. Joomla Main Menu
  3. To clone all the menu items at once, click the Check All Items check box and click Batch.
  4. In Set Language, select the correct content language.
  5. In To Move or Copy, locate the correct main menu for the language and select Add to this menu.
  6. Select Copy to make a copy of the menu items.
  7. Click Process.
  8. In the JAI top navigation bar, click Menus and select the main menu you cloned the menu items to.
  9. To set the default home page, click the star in the row for the Home menu item.
  10. To rename the cloned menu items, click each menu item to edit it, and change Menu Title to the correct translation (for example, Home(2) to Accueil).
  11. Click Save & Close.
  12. Repeat for each menu item.

Duplicate the page template styles

You must also duplicate your page template styles for each language. By default, API Portal uses the Purity III template style.

  1. In the JAI left navigation bar, click Templates > Styles.
  2. Joomla Templates Styles
  3. Click your template style (for example, purity_III - Default) to open it.
  4. Click the arrow next to the Save button at the top left of the window, and select Save as Copy.
  5. Edit the Style Name to indicate the language (for example, purity_III - fr).
  6. Select the respective language as the Default. This sets this template as the default for pages using the selected language.
  7. Click the Navigation tab, and change the Menu to the correct main menu for the language.
  8. Click the Assignment tab, and assign the menu items from the correct language to the template. To select or deselect all menu items, click the toggle button next to the main menu title.
  9. Click Save and click Close to close the template style.

Publish additional languages

  1. Ensure that you have completed all the steps described in Change API Portal language for each language you want to publish.
  2. In the JAI left navigation bar, click Language(s) > Content Languages.
  3. Ensure that the Status for all the languages you want to publish is set to Publish.
  4. In the JAI top navigation bar, click Extensions > Plugins, and ensure the System - Language Filter plugin is enabled.
  5. Open your API Portal home page in a browser, and change the language code in the URL to one of the languages you have published. For example, changehttps://<your API Portal URL>/en/ to https://<your API Portal URL>/fr/. You are redirected to the API Portal home page in that language.

Related Links