feel free to keep it strictly simple...

create and include language files

Standard language files

If your addon needs language files please notice following conventions

  1. language files are placed in a addon- subdirectory called "/languages",
  2. language files have to be named like languages, example given: "EN.php" or "NL.php" or "DE.php" ,
  3. the keys in the arrays in the language files should be sorted in alphabetical order,
  4. module language strings should be placed in an associative array that must be named like the addon: $MOD_[ADDON_NAME]. See an existing Addon as example.
  5. module language strings must be keys of this associative array .

If you run into problems please search for an example in the Addons-Repository or check the forum for details.

Custom language files(custom)

Simply copy a origin language file of the addon , rename the file to ( for example) EN_custom.php and you are done. The custom file will automatically replace the standard addon language file.

Keep in mind, that you have to be aware if language files are modified via update of the specific addon. You can check the changelog for modifications.

Notice: the same procedure is working with core language files!

Custom language files (add)

Simply create a language file for the addon and call the file ( for example) EN_add.php . The "ADD" file will automatically add  the language strings to the current language file. If the language string is already existing in the origin language file it will be replaced with the content of the "ADD "file, so you don't have to care about changes or additions in the origin file.

Search for an example in the Addons-Repository or check the forum for examples or details.

Please take care, that the "ADD" file looks like follwowing example:

$MOD_ADDON-NAME_ADD = [ 'description' => "Additional description or overwriting existing string" ]; if (file_exists(LEPTON_PATH.'/modules/addon-name/languages/EN.php')) { require (LEPTON_PATH.'/modules/addon-name/languages/EN.php'); $MOD_ADDON-NAME = array_merge($MOD_ADDON-NAME,$MOD_ADDON-NAME_ADD); }

Example

last edit: 12. Mar 2024 CET 20:17:36