* "Tools TRanslate for N items". Performs string replacement for * internationalization within the editor. A translation context can optionally * be specified to disambiguate between identical source strings in * translations. Use `TTR()` if the string doesn't need dynamic plural form. * When placeholders are desired, use * `vformat(TTRN("%d item", "%d items", some_integer), some_integer)`.
| 5706 | * For translations that can be supplied by exported projects, use `RTRN()` instead. |
| 5707 | */ |
| 5708 | String TTRN(const String& p_text, const String& p_text_plural, int p_n, const String& p_context) |
| 5709 | { |
| 5710 | if (TranslationServer::get_singleton()) |
| 5711 | { |
| 5712 | return TranslationServer::get_singleton()->tool_translate_plural(p_text, p_text_plural, p_n, p_context); |
| 5713 | } |
| 5714 | |
| 5715 | // Return message based on English plural rule if translation is not possible. |
| 5716 | if (p_n == 1) |
| 5717 | { |
| 5718 | return p_text; |
| 5719 | } |
| 5720 | return p_text_plural; |
| 5721 | } |
| 5722 | |
| 5723 | /** |
| 5724 | * "Docs TRanslate". Used for the editor class reference documentation, |
nothing calls this directly
no test coverage detected