the main.xml loads now

This commit is contained in:
⍚~Nex
2024-04-02 00:39:53 +02:00
parent aa9af9b052
commit 221d1c8cda
4 changed files with 14 additions and 8 deletions
@@ -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)))