Actions

J1.5

Language Guidelines for 3rd Party Extensions

From Joomla! Documentation

Revision as of 19:29, 30 August 2008 by Pe7er (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

The purpose of this document is to give some guidelines to developers for their 3rd party Joomla! 1.5 extension, so that users can easier adapt extensions for use in their local language.

Note that this document contains only guidelines. These guidelines are not rules which limit your freedom in development and distribution. Extensions based on these guidelines will be more flexible and easier to translate to other languages, which will have a positive influence on their use and popularity.

Extensions with hard coded text in a specific language have limited use within the community, because translating such an extension is difficult, and if possible, takes a lot of time.

Contents

Do NOT use hard coded language text

A module (e.g. mod_somemodule) with the following hard coded Dutch language text in the XML installation (and configuration) file, needs to be fully analyzed and rewritten for any other language.

<param name="dateformat" type="text" default="%A %d %B %Y, %H:%M" 
 label="Datum / Tijd formaat" description="Gebruik de PHP strftime datum en tijd opmaak." />
<param name="posttext" type="text" default="" 
 label="Tekst achter datum" description="Eventuele tekst die achter de datum wordt getoond." />

Use language labels instead

The same mod_somemodule.xml installer file but now with language labels is much easier to translate!

<param name="dateformat" type="text" default="%A %d %B %Y, %H:%M" 
 label="DATUMTIJDFORMAAT" description="DATUMTIJDFORMAATBESCHR" />
<param name="posttext" type="text" default="" 
 label="TEKSTACHTER" description="TEKSTACHTERBESCHR" />

Only the nl-NL.mod_somemodule.ini language file needs to be translated to get the module working in any other language:

DATUMTIJDFORMAAT = Datum / Tijd formaat
DATUMTIJDFORMAATBESCHR = Gebruik de PHP strftime datum en tijd opmaak.
TEKSTACHTER = Tekst achter datum
TEKSTACHTERBESCHR = Eventuele tekst die achter de datum wordt getoond.

Use English language labels

The previous example with language labels and an external language file is easier to translate. However Non-Dutch users will have much difficulties in translating the language file. Please use English language labels instead!

<param name="dateformat" type="text" default="%A %d %B %Y, %H:%M" 
 label="DATETIMEFORMAT" description="DATETIMEFORMATDESCR" />
<param name="posttext" type="text" default="" 
 label="TEXTAFTER" description="POSTTEXTDESCR" />

And the same English labels with Dutch translation in nl-NL.mod_somemodule.ini

DATETIMEFORMAT = Datum / Tijd formaat
DATETIMEFORMATDESCR = Gebruik de PHP strftime datum en tijd opmaak.
TEXTAFTER = Tekst achter datum
POSTTEXTDESCR = Eventuele tekst die achter de datum wordt getoond.

Include an English language file

Again, the above example is easier to translate because of the English labels. But again, not everyone can read and translate the Dutch translation. Most people can read English, so include at least an English language file. Translating English to some other language is easier for most people.

en-GB.mod_somemodule.ini

DATETIMEFORMAT = Date/Time format
DATETIMEFORMATDESCR = Use the PHP strftime formatting.
TEXTAFTER = Text after date
POSTTEXTDESCR = Any text that should be placed after the date.

PHP strftime

Countries have different date and time formats. Please use the PHP strftime function for dates and times in your extension. That way the local date/time format will be used automatically, because it's based on the local format.

Use UTF8

All .ini language files need to be saved as UTF-8 for the proper display of characters which are not in the ASCII range [a..z] and [A..Z].

es-ES.mod_somemodule.ini

DATETIMEFORMAT = Formato de fecha/tiempo
DATETIMEFORMATDESCR = Usan el PHP strftime formateo.
TEXTAFTER = Texto después de Fecha
POSTTEXTDESCR = Cualquier texto que debería ser colocado después de la fecha.

después is UTF-8 and will be displayed as debería =

Other documentation

More information regarding the use of language files can be found at the following places: