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
  4. Publish additional languages

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

Add a new content language and main menu

  1. Log in to the Joomla! Administrator Interface (JAI).
  2. Click Extensions > Language(s) > Content languages, and select New to add a new content language.
  3. On the Details tab, enter the titles to be shown in drop-down lists. The titles can be the same.
  4. Enter the Joomla! language tag. Ensure you enter the tag in the correct format, use "-" instead of "_" (for example, fr-FR).
  5. In the URL language code, enter the language identifier to be used in the language-specific URL (for example, fr). The identifier must be unique for each language.
  6. Set Status to Unpublish, and click Save & Close.
  7. For more details on the parameters, see the tutorial for Joomla! Language Switcher.
  8. Click Menus> Manage > Add New Menu.
  9. On the Menu Details tab, enter the title to be shown in drop-down lists (for example, Main menu (fr)).
  10. In the Menu Type, enter a system identifier for the new main menu (for example, mainmenufr), and click Save.

Clone the main menu items

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

  1. In JAI, click Menus > Manage, and select the main menu you want to clone.
  2. To clone all the menu items at one go, click Check all > Batch.
  3. Set language to the correct content language.
  4. In Move or Copy your selection, find the correct main menu for the language, and select Add to this menu.
  5. Select Copy, and click Process.
  6. Click Menus, and select the main menu you cloned to menu items to.
  7. To set the default home page, click the star for the Home menu item.
  8. To rename the cloned menu items, click a menu item, change Menu Title to the correct translation (for example, Home(2) to Accueil), and click Save & Close. Repeat for each menu item.

Duplicate the page template

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

  1. In JAI, click Extensions > Templates, select your template, and select Save as Copy.
  2. Change the style name to indicate the language (for example, purity_III - fr).
  3. On the Navigation page, set Menu to the correct main menu for the language.
  4. On theAssignment page, assign the menu items from the correct language to the template. To select all menu items as a batch, click the square with line next to the main menu title.
  5. Click Save & Close.

Publish additional languages

  1. Ensure you have completed all the steps described in Change API Portal language for each language you want to publish.
  2. In JAI, click Extensions > Language(s) > Content languages.
  3. Ensure that the status for all the languages you want to publish now is set to Publish.
  4. Click Extensions > Plugins, and ensure the System - Language Filter plugin is enabled.
  5. Open you API Portal home page in browser, and change the language code in the URL to another language you just 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