From 61719c41fe7964289529affdf6e752045f43ffe6 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Sat, 23 Feb 2013 03:26:11 -0800 Subject: [PATCH] Updated e107 Coding Standard (markdown) --- e107-Coding-Standard.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/e107-Coding-Standard.md b/e107-Coding-Standard.md index c2e144a..66034a5 100644 --- a/e107-Coding-Standard.md +++ b/e107-Coding-Standard.md @@ -293,13 +293,26 @@ To check whether a particular plugin is installed, use function e107::isInstalle ## Language Files and LANS +### Plugin Language-File Naming + +Use the following path: _e107_plugins/YOUR_PLUGIN/languages/LANGUAGE/_ + +* English_front.php - used in front-end script. +* English_admin.php - used in admin script. +* English_global.php - used site-wide. +* English_log.php - used for logging. + +### Loading Language-Files To load a language file from the current theme's directory: e107::lan('theme'); // loads e107_themes/CURRENT_THEME/languages/English.php (when English is selected) To load a language file from a plugin folder: - e107::lan('gallery'); // loads e107_plugins/gallery/languages/English.php (when English is selected) + e107::lan('gallery'); // loads e107_plugins/gallery/languages/English_front.php (when English is selected) + e107::lan('gallery',true); // loads e107_plugins/gallery/languages/English_admin.php (when English is selected) + +### Defining Language Terms aka 'LANS' Avoid duplicating terms, particularly in the admin area. If coding for admin, always search lan_admin.php and the lan_xxxx.php of the specific page you are working on for existing LANs which may match what you need translated. Avoid using HTML or Urls inside LAN definitions.