ZMlocaleUtils
public class ZMlocaleUtils
| Constant Summary | |
|---|---|
| final static str | Locale patterns. |
| Method Summary | |
|---|---|
| static array | buildL10nMap(string baseDir, string ext) Build a language map for all found l10n strings in the given directory tree. |
| static string | dateLong(Date date) Format a date as long. |
| static string | dateShort(Date date) Format a date as short. |
| static string | map2po(array map, boolean pot) Create a po(t) file from a l10n map. |
| static string | map2yaml(array map) Create a yaml file from a l10n map. |
| static string | resolvePath(string path, string locale) Resolve a locale path. |
public final static str LOCALE_PATTERNS = 'zm_l10n_get,zm_l10n,_zmn,_zm,_vzm'
Locale patterns.
public static array buildL10nMap(string baseDir, string ext)
Build a language map for all found l10n strings in the given directory tree.
public static string dateLong(Date date)
Format a date as long.
public static string dateShort(Date date)
Format a date as short.
public static string map2po(array map, boolean pot)
Create a po(t) file from a l10n map.
This method operates only on the untranslated string. Translation itself happens further down the tool chain.
false.public static string map2yaml(array map)
Create a yaml file from a l10n map.
The created YAML will include comments with the filename and warnings about duplicate mappings, etc.
public static string resolvePath(string path, string locale)
Resolve a locale path.
The path given is assumed to contain the full locale as specified in the $locale parameter.
The function will validate the path and if not valid will default to using just the language.
null. /
Locale utils.