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

Function DTRN

core/string/ustring.cpp:5984–5997  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5982}
5983
5984String DTRN(const String &p_text, const String &p_text_plural, int p_n, const String &p_context) {
5985 const String text = p_text.dedent().strip_edges();
5986 const String text_plural = p_text_plural.dedent().strip_edges();
5987
5988 if (TranslationServer::get_singleton()) {
5989 return String(TranslationServer::get_singleton()->doc_translate_plural(text, text_plural, p_n, p_context)).replace("$DOCS_URL", REDOT_VERSION_DOCS_URL);
5990 }
5991
5992 // Return message based on English plural rule if translation is not possible.
5993 if (p_n == 1) {
5994 return text.replace("$DOCS_URL", REDOT_VERSION_DOCS_URL);
5995 }
5996 return text_plural.replace("$DOCS_URL", REDOT_VERSION_DOCS_URL);
5997}
5998#endif
5999
6000String RTR(const String &p_text, const String &p_context) {

Callers

nothing calls this directly

Calls 5

strip_edgesMethod · 0.80
dedentMethod · 0.80
doc_translate_pluralMethod · 0.80
StringClass · 0.70
replaceMethod · 0.45

Tested by

no test coverage detected