CMD_JSON_LANG .po files for languages, and locales

Version 1.52


Extension for the CMD_JSON_LANG tool: 1) If no options are returns, a json output will show something like: { "default": { "id": "en" }, "languages": { "en": "English", "fr": "Français", } } depending on the languages available for this skin (we only include "en" by default) The "en" can be any valid language, and the rules have been related to allow proper locale naming, like en_US. Each value for that local on the right will be in that native language, not English. So for fr, it will show Français, and not "French". The actual locales.po file should exist the skins document root, eg: /usr/local/directadmin/data/skins/SKINNAME/locales.po If if it doesn't exist, DA will fall-back to use the "internal_lang" directadmin.conf, variable, but access the po file using the .. method eg: /usr/local/directadmin/data/skins/enhanced/lang/../locales.po allowing the fallback to be used, even if the client has some other skin set, for the event where the other skin does not have locales.po file. TODO: Fill with all languages/locales. 2) WIth a lang value, eg: CMD_JSON_LANG?lang=en it will dump json for the given .po file. A language po file can exist either at: /usr/local/directadmin/data/skins/SKINNAME/lang/LANG/lang.po where "lang.po" is the literal filename for the current LANG... OR /usr/local/directadmin/data/skins/SKINNAME/lang/LANG.po where LANG.po could be any valid lower-case language or local name (instead of a directory), eg: /usr/local/directadmin/data/skins/SKINNAME/lang/fr.po 3) With everything: CMD_JSON_LANG?default_data=yes will include the array from #1, but will also have: default[data] containtaining the entire json array for the whole defautl language po file, eg: { "default": { "data": { #whole json output for "en" becaue id=en. } "id": "en" }, "languages": { "en": "English", "fr": "Français", } }

Interested to try DirectAdmin? Get a 30-day Free Trial!