mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 05:36:59 -04:00
Moved locale validation to a compile time test, instead of a runtime check performed by MSE itself.
This also removes perl as a build dependency for people who don't want to run the test suite.
This commit is contained in:
+3
-9
@@ -22,22 +22,19 @@ DECLARE_POINTER_TYPE(SubLocaleValidator);
|
||||
|
||||
/// Translations of the texts of a game/stylesheet/symbolfont
|
||||
class SubLocale : public IntrusivePtrBase<SubLocale> {
|
||||
public:
|
||||
public:
|
||||
map<String,String> translations;
|
||||
|
||||
/// Translate a key, if not found, apply the default function to the key
|
||||
String tr(const String& key, DefaultLocaleFun def);
|
||||
String tr(const String& subcat, const String& key, DefaultLocaleFun def);
|
||||
|
||||
/// Is this a valid sublocale? Returns errors
|
||||
String validate(const String& name, const SubLocaleValidatorP&) const;
|
||||
|
||||
DECLARE_REFLECTION();
|
||||
};
|
||||
|
||||
/// A collection of translations of messages
|
||||
class Locale : public Packaged {
|
||||
public:
|
||||
public:
|
||||
/// Translations of UI strings in each category
|
||||
SubLocale translations[LOCALE_CAT_MAX];
|
||||
/// Translations of Package specific texts, by relativeFilename
|
||||
@@ -46,10 +43,7 @@ class Locale : public Packaged {
|
||||
/// Open a locale with the given name
|
||||
static LocaleP byName(const String& name);
|
||||
|
||||
/// Validate that the locale is valid for this MSE version
|
||||
virtual void validate(Version = app_version);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
String typeName() const;
|
||||
Version fileVersion() const;
|
||||
DECLARE_REFLECTION();
|
||||
|
||||
Reference in New Issue
Block a user