diff options
Diffstat (limited to 'core/string/translation_po.h')
-rw-r--r-- | core/string/translation_po.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/string/translation_po.h b/core/string/translation_po.h index 73f9b33a87..ba820c6ee4 100644 --- a/core/string/translation_po.h +++ b/core/string/translation_po.h @@ -50,7 +50,17 @@ class TranslationPO : public Translation { String plural_rule; // Cache temporary variables related to _get_plural_index() to make it faster - Vector<String> equi_tests; + class EQNode : public RefCounted { + public: + String regex; + Ref<EQNode> left; + Ref<EQNode> right; + }; + Ref<EQNode> equi_tests; + + int _find_unquoted(const String &p_src, char32_t p_chr) const; + int _eq_test(const Ref<EQNode> &p_node, const Variant &p_result) const; + Vector<String> input_name; mutable Ref<Expression> expr; mutable Array input_val; @@ -59,7 +69,7 @@ class TranslationPO : public Translation { mutable int last_plural_n = -1; // Set it to an impossible value at the beginning. mutable int last_plural_mapped_index = 0; - void _cache_plural_tests(const String &p_plural_rule); + void _cache_plural_tests(const String &p_plural_rule, Ref<EQNode> &p_node); int _get_plural_index(int p_n) const; Vector<String> _get_message_list() const override; |