Difference between revisions of "Addons:Language"

From GExtension Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Language files should be named after this pattern: <2-digit-country-code>.php
+
Language files should be named after this pattern: <2-digit-country-code>.json
  
For example de.php, fr.php or en.php
+
For example de.json, fr.json or en.json
  
 
== Content ==
 
== Content ==
The file must contain the following to access the language variable:
+
The file must contain a json dictionary with the language-keys as keys and the translations as values :
global $language;
+
  {
 
+
  "category_create": "Create Category",
After that, language strings can be added with the pattern $language['<identifier>'] = '<translation>'. For example:
+
  "payment_pending": "Your payment is pending...",
  $language['changes_unsaged'] = 'Unsafed Changes';
+
  ...
$language['category_create'] = 'Create Category';
+
}
$language['payment_pending'] = 'Your payment is pending...';
 
...
 
  
  
 
[[Category:Addons]]
 
[[Category:Addons]]

Latest revision as of 14:22, 27 December 2020

Language files should be named after this pattern: <2-digit-country-code>.json

For example de.json, fr.json or en.json

Content

The file must contain a json dictionary with the language-keys as keys and the translations as values :

{
  "category_create": "Create Category",
  "payment_pending": "Your payment is pending...",
  ...
}