diff --git a/e107-Coding-Standard.md b/e107-Coding-Standard.md index 843c713..60e0934 100644 --- a/e107-Coding-Standard.md +++ b/e107-Coding-Standard.md @@ -52,7 +52,7 @@ Use camelCase for variables. ### Constants Use UPPER_CASE_WITH_UNDERSCORES for constants. - define("CONSTANT_NAME","some value"); + define("CONSTANT_NAME", "some value"); Where numeric values represent a particular status, define a constant for that value to make the meaning more obvious. @@ -318,19 +318,19 @@ Avoid duplicating terms, particularly in the admin area. If coding for admin, al **Good:** - define("LAN_XXX","Thank you [b]Firstname[/b]"); - define("LAN_XXX","Thank you [x]"); // Good - replace [ and ] with and using str_replace() + define("LAN_XXX", "Thank you [b]Firstname[/b]"); + define("LAN_XXX", "Thank you [x]"); // Good - replace [ and ] with and using str_replace() **Bad:** - define("LAN_XXX","Thank you Firstname"); //Bad contains HTML - define("LAN_XXX","Thank you Firstname"); //Bad contains HTML - define("LAN_XXX","Thank you [link=www.somewhere.com]Firstname[/link]"); //Bad - allows translator to modify link. + define("LAN_XXX", "Thank you Firstname"); //Bad contains HTML + define("LAN_XXX", "Thank you Firstname"); //Bad contains HTML + define("LAN_XXX", "Thank you [link=www.somewhere.com]Firstname[/link]"); //Bad - allows translator to modify link. Avoid short language strings for words such as 'and', 'to' and so on. There aren't always equivalents in other languages. If embedding values into a phrase, use substitution. Avoid using substitution terms which are real words or known bbcodes. - define('LAN_EXAMPLE_01','Update results: [x] records changed, [y] errors, [z] not changed'); + define("LAN_EXAMPLE_01", "Update results: [x] records changed, [y] errors, [z] not changed"); $srch = array('[x]','[y]','[z]'); $repl = array($changed,$errors,$unchanged); $text = str_replace($srch,$repl,LAN_EXAMPLE_01);