Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleWhy not place all language in a single directory?

Allowing Modules, Gateways, and Plugins to specify their own language packs allows for a simplified installation process and helps ensure users will successfully install third-party add-ons.

 

Language Packs

Language packs must be named according to ISO 639-1 and 3166-1 standards. For example, English, US is stored in language pack en_us. Each In addition to a collection of language files, each language pack must additionally contain a file of the same name as its directory with a single line defining the name of the language in its native format.

...

Each language file should correspond to a the class name from in which the language is used. Take for example /installdir/language/en_us/admin_clients.php. This file contains all language associated with the AdminClients controller and related views.

A language file may contain one or more language entries. Entries are represented by array key/value pairs that correspond to an index and definitions, respectively. The keys are used to reference the

Code Block
languagephp
title/installdir/language/en_us/admin_clients.php
$lang['AdminClients.index.boxtitle_browseclients'] = "Browse Clients";

Index Formats

Indexes are primarily comprised of three dot-segments. The two main formats are:

  1. [ClassName].[methodName].[entry_name]
  2. [ClassName].[!errror/!success/!notice].[entry_name]

The exclamation point identifies an entry as not belonging to any particular method. This convention makes it easy to identify error, success, and notice messages that may be used by various methods.

Variable Substitution

Some definitions contain variable substitutions, which can be identified