Language Package

From FreeNATS Wiki
Jump to: navigation, search

Introduction

As of version 1.10.0 FreeNATS supports multi-lingual support (as of 1.10.0 this is only for major functionality and not for all the interface).

Additional languages are provided by language packages that are either shipped with FreeNATS or created by users.

Contributing Translations

Contributed translations are especially welcome. See this document for how to make them and then please submit via email to freenats-language [at] purplepixie.org.

Full credit will be given for translations as well as much kudos.

As new versions of FreeNATS come out please check your translated version against the new English base language to see new update new language elements.

Format of Language Packages

Languages packages are files in the server/base/lang directory of FreeNATS with a filename of the form Language.short.lang.php for example English.en.lang.php

They are simple PHP files setting elements to an array called $lang for each language element.

A language element is called within the source code (for example welcome) and then looked up in this array. If the element is not found in the selected language then the base (English) entry is used instead.

See the server/base/lang/English.en.lang.php file for an example.

Markup

The help elements use a specific markup to allow them to interlink. These are contained within brace brackets { } and are in some ways similar to wiki markups.

For example consider have a help element called GRAPH.KEY which refers to the site.graph.key variable. This variable is covered by the help item VAR:SITE.GRAPH.KEY

We could use content as follows:

Require this key from the user, the variable {VAR:SITE.GRAPH.KEY|site.graph.key} must be set

In this example the text site.graph.key links to the help element VAR:SITE.GRAPH.KEY

Tools

There is a rudimentary editor/creator tool available to aid in the identification of needed elements and auto-generation of language packs. Details are on the Language Editor Tool page.