Merge pull request #97624 from timothyqiu/atrn
Fix `atr_n()` behavior when auto translation is disabled
This commit is contained in:
commit
6d9a797ea4
1 changed files with 7 additions and 2 deletions
|
@ -743,8 +743,13 @@ public:
|
||||||
virtual void set_translation_domain(const StringName &p_domain) override;
|
virtual void set_translation_domain(const StringName &p_domain) override;
|
||||||
void set_translation_domain_inherited();
|
void set_translation_domain_inherited();
|
||||||
|
|
||||||
_FORCE_INLINE_ String atr(const String p_message, const StringName p_context = "") const { return can_auto_translate() ? tr(p_message, p_context) : p_message; }
|
_FORCE_INLINE_ String atr(const String &p_message, const StringName &p_context = "") const { return can_auto_translate() ? tr(p_message, p_context) : p_message; }
|
||||||
_FORCE_INLINE_ String atr_n(const String p_message, const StringName &p_message_plural, int p_n, const StringName p_context = "") const { return can_auto_translate() ? tr_n(p_message, p_message_plural, p_n, p_context) : p_message; }
|
_FORCE_INLINE_ String atr_n(const String &p_message, const StringName &p_message_plural, int p_n, const StringName &p_context = "") const {
|
||||||
|
if (can_auto_translate()) {
|
||||||
|
return tr_n(p_message, p_message_plural, p_n, p_context);
|
||||||
|
}
|
||||||
|
return p_n == 1 ? p_message : String(p_message_plural);
|
||||||
|
}
|
||||||
|
|
||||||
/* THREADING */
|
/* THREADING */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue