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

Function TTR

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

* "Tools TRanslate". Performs string replacement for internationalization * within the editor. A translation context can optionally be specified to * disambiguate between identical source strings in translations. When * placeholders are desired, use `vformat(TTR("Example: %s"), some_string)`. * If a string mentions a quantity (and may therefore need a dynamic plural form), * use `TTRN()` inst

Source from the content-addressed store, hash-verified

5684 * For translations that can be supplied by exported projects, use `RTR()` instead.
5685 */
5686String TTR(const String& p_text, const String& p_context)
5687{
5688 if (TranslationServer::get_singleton())
5689 {
5690 return TranslationServer::get_singleton()->tool_translate(p_text, p_context);
5691 }
5692
5693 return p_text;
5694}
5695
5696/**
5697 * "Tools TRanslate for N items". Performs string replacement for

Callers

nothing calls this directly

Calls 1

get_singletonFunction · 0.85

Tested by

no test coverage detected