MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / DTR

Function DTR

modules/gui/gui/src/backend/text_server/ustring.cpp:5729–5740  ·  view source on GitHub ↗

* "Docs TRanslate". Used for the editor class reference documentation, * handling descriptions extracted from the XML. * It also replaces `$DOCS_URL` with the actual URL to the documentation's branch, * to allow dehardcoding it in the XML and doing proper substitutions everywhere. */

Source from the content-addressed store, hash-verified

5727 * to allow dehardcoding it in the XML and doing proper substitutions everywhere.
5728 */
5729String DTR(const String& p_text, const String& p_context)
5730{
5731 // Comes straight from the XML, so remove indentation and any trailing whitespace.
5732 const String text = p_text.dedent().strip_edges();
5733
5734 if (TranslationServer::get_singleton())
5735 {
5736 return String(TranslationServer::get_singleton()->doc_translate(text, p_context)).replace("$DOCS_URL", VERSION_DOCS_URL);
5737 }
5738
5739 return text.replace("$DOCS_URL", VERSION_DOCS_URL);
5740}
5741
5742/**
5743 * "Docs TRanslate for N items". Used for the editor class reference documentation

Callers

nothing calls this directly

Calls 5

get_singletonFunction · 0.85
strip_edgesMethod · 0.80
dedentMethod · 0.80
StringClass · 0.70
replaceMethod · 0.45

Tested by

no test coverage detected