MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / RTRN

Function RTRN

core/string/ustring.cpp:6012–6026  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6010}
6011
6012String RTRN(const String &p_text, const String &p_text_plural, int p_n, const String &p_context) {
6013 if (TranslationServer::get_singleton()) {
6014 String rtr = TranslationServer::get_singleton()->tool_translate_plural(p_text, p_text_plural, p_n, p_context);
6015 if (rtr.is_empty() || rtr == p_text || rtr == p_text_plural) {
6016 return TranslationServer::get_singleton()->translate_plural(p_text, p_text_plural, p_n, p_context);
6017 }
6018 return rtr;
6019 }
6020
6021 // Return message based on English plural rule if translation is not possible.
6022 if (p_n == 1) {
6023 return p_text;
6024 }
6025 return p_text_plural;
6026}

Callers

nothing calls this directly

Calls 3

tool_translate_pluralMethod · 0.80
is_emptyMethod · 0.45
translate_pluralMethod · 0.45

Tested by

no test coverage detected