mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
feat: restore locale level translations for other packages (fixes #41)
This is only a partial fix though, it basically restores the old behavior as a default. That doesn't help though with flipping the definitions to get stuff out of the UI Locale file though. So that'll have to come next for allowing wildcard resolutions to be done from the game(?) or maybe locale extension files?
This commit is contained in:
@@ -118,6 +118,24 @@ String tr(const Package& pkg, const String& subcat, const String& key, DefaultLo
|
||||
loc = find_wildcard_and_set(the_locale->package_translations, pkg.relativeFilename());
|
||||
}
|
||||
return loc->tr(subcat, key, def);
|
||||
}
|
||||
|
||||
String tr(const String& pkg_relative_filename, const String& key, DefaultLocaleFun def) {
|
||||
if (!the_locale) return def(key);
|
||||
SubLocaleP loc = the_locale->package_translations[pkg_relative_filename];
|
||||
if (!loc) {
|
||||
loc = find_wildcard_and_set(the_locale->package_translations, pkg_relative_filename);
|
||||
}
|
||||
return loc->tr(key, def);
|
||||
}
|
||||
|
||||
String tr(const String& pkg_relative_filename, const String& subcat, const String& key, DefaultLocaleFun def) {
|
||||
if (!the_locale) return def(key);
|
||||
SubLocaleP loc = the_locale->package_translations[pkg_relative_filename];
|
||||
if (!loc) {
|
||||
loc = find_wildcard_and_set(the_locale->package_translations, pkg_relative_filename);
|
||||
}
|
||||
return loc->tr(subcat, key, def);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : LocalizedString
|
||||
|
||||
Reference in New Issue
Block a user