the main.xml loads now
This commit is contained in:
@@ -20,9 +20,9 @@ class TranslationsUtil
|
||||
public static var transMap(default, null):Map<String, String> = [];
|
||||
|
||||
/**
|
||||
* The default language used inside of the source code (`en` is English in this case).
|
||||
* The default language used inside of the source code.
|
||||
*/
|
||||
public static var DEFAULT_LANGUAGE:String = 'en'; // no inline so psycopathic mods can edit it - Nex
|
||||
public static var DEFAULT_LANGUAGE:String = 'English'; // no inline so psycopathic mods can edit it - Nex
|
||||
|
||||
/**
|
||||
* Returns the current language.
|
||||
@@ -48,7 +48,7 @@ class TranslationsUtil
|
||||
* If `name` is `null`, it's gonna use the current language.
|
||||
*/
|
||||
public static function setTransl(?name:String)
|
||||
transMap = loadLanguage(name == null ? get_curLanguage() : name);
|
||||
trace(transMap = loadLanguage(name == null ? get_curLanguage() : name));
|
||||
|
||||
/**
|
||||
* This is for checking a translation, `defString` it's just the string that gets returned just in case it won't find the translation OR the current language selected is ``DEFAULT_LANGUAGE``.
|
||||
@@ -89,8 +89,8 @@ class TranslationsUtil
|
||||
public static function loadLanguage(name:String):Map<String, String>
|
||||
{
|
||||
#if TRANSLATIONS_SUPPORT
|
||||
var path:String = 'main.xml';
|
||||
if (!Assets.exists(Paths.translations('$name/$path'), TEXT)) return [];
|
||||
var path:String = Paths.translationsMain('$name/main.xml');
|
||||
if (!Assets.exists(path, TEXT)) return [];
|
||||
|
||||
var xml:Access = null;
|
||||
try xml = new Access(Xml.parse(Assets.getText(path)))
|
||||
|
||||
Reference in New Issue
Block a user