Print Download PDF Send Feedback

Previous

Next

Adding a New Language

You can configure the Captive Portal to show the Network Login pages in different languages. After you set the language selection list, users can choose the language they prefer to log in with from a list at the bottom of the page.

To configure a language for Captive Portal you must:

  1. Edit the language array for the new language locale.
  2. Use the English language file as a template to create new language files. Then translate the strings in the new language file.
  3. Save the files with UTF-8 encoding and move them to the correct location.
  4. Set the language selection list to show on the Network Login page.
  5. Make sure the text strings are shown correctly.

Editing the Language Array

The supported language file contains entries for languages that you can see in the list on the Captive Portal page.

By default, English is the only language entry in the list. It has a corresponding language file. For each new language, you must create an entry in the supported languages file and create a new language file.

To create a new language, add an entry to the supported languages file:

  1. Open the file:

    /opt/CPNacPortal/phpincs/conf/L10N/supportedLanguages.php

  2. In the $arLanguages array, create a new locale entry with the syntax: "xx_XX" => "XName".

    For example: "de_DE" => "German".

To disable a language:

Comment out the line of the specific language or delete the line.

Creating New Language Files

To create new language files, use the English language file (portal_en_US.php) as a template and refer to it for the source language. The file contains the message strings. It is not necessary to translate all strings, but you must include all strings in the new language file.

When you translate a string, make sure that the string's length is almost the same in size as the initial English string. This is important to prevent breaks in the page layout. If this is not possible, consult with technical support.

You cannot use HTML special character sequences such as   / < / &gt in the translated strings.

To create a new language file:

  1. Make a copy of the English language file:

    /opt/CPNacPortal/phpincs/conf/L10N/portal_en_US.php

  2. Rename it to the new language using the syntax portal_xx_XX.php.

    For example, portal_de_DE.php

  3. Translate the strings in the new language file.
  4. Make sure that the read permissions for the new language file are the same as those for the original language file. Run this command to set the permissions for read and write:
    chmod 666 <file name>.

Saving New Language Files

You must save the language file with UTF-8 encoding.

To save a file with UTF-8 encoding:

  1. Use Notepad, Microsoft Word or a different editor to save the file with UTF-8 encoding. When using Microsoft Word, save the file as a '.txt' file with UTF-8 as the encoding method and rename it to portal_xx_XX.php. For example: portal_de_DE.php.
  2. Move the file to /opt/CPNacPortal/phpincs/conf/L10N if it is not already there.

Showing the Language Selection List

When you only use the English language, the language selection list does not show at the bottom of the Captive Portal Network Login page. When you configure additional languages, you must show the language selection list on the Network Login page. Captive Portal users can then select the language, with which to log in.

To see the language list on the Network Login page:

  1. On the Security Gateway, open the file:

    /opt/CPNacPortal/phpincs/view/html/Authentication.php

  2. Back up the file (for possible future revert).
  3. In <label for="language_selection">, remove the lines that start with <?PHP /* and end with */ ?>

    The lines to remove are in the square:

  4. Save the file.

    The language selection list will show on the Network Login page.

To revert to not showing the language selection list, replace the current file with the backup of the original file.

Making Sure the Strings Show Correctly

To make sure the strings show correctly:

  1. Browse to the Captive Portal and select the new language.
  2. Browse from different operating systems with different locale setups.
  3. Make sure that the text is shown correctly on the Captive Portal pages.
  4. Browse to the Captive Portal from a different browser and use a different font size.