class_translationdomain.rst 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/TranslationDomain.xml.
  6. .. _class_TranslationDomain:
  7. TranslationDomain
  8. =================
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A self-contained collection of :ref:`Translation<class_Translation>` resources.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **TranslationDomain** is a self-contained collection of :ref:`Translation<class_Translation>` resources. Translations can be added to or removed from it.
  15. If you're working with the main translation domain, it is more convenient to use the wrap methods on :ref:`TranslationServer<class_TranslationServer>`.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------+-----------+
  22. | :ref:`bool<class_bool>` | :ref:`enabled<class_TranslationDomain_property_enabled>` | ``true`` |
  23. +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------+-----------+
  24. | :ref:`bool<class_bool>` | :ref:`pseudolocalization_accents_enabled<class_TranslationDomain_property_pseudolocalization_accents_enabled>` | ``true`` |
  25. +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------+-----------+
  26. | :ref:`bool<class_bool>` | :ref:`pseudolocalization_double_vowels_enabled<class_TranslationDomain_property_pseudolocalization_double_vowels_enabled>` | ``false`` |
  27. +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------+-----------+
  28. | :ref:`bool<class_bool>` | :ref:`pseudolocalization_enabled<class_TranslationDomain_property_pseudolocalization_enabled>` | ``false`` |
  29. +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------+-----------+
  30. | :ref:`float<class_float>` | :ref:`pseudolocalization_expansion_ratio<class_TranslationDomain_property_pseudolocalization_expansion_ratio>` | ``0.0`` |
  31. +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------+-----------+
  32. | :ref:`bool<class_bool>` | :ref:`pseudolocalization_fake_bidi_enabled<class_TranslationDomain_property_pseudolocalization_fake_bidi_enabled>` | ``false`` |
  33. +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------+-----------+
  34. | :ref:`bool<class_bool>` | :ref:`pseudolocalization_override_enabled<class_TranslationDomain_property_pseudolocalization_override_enabled>` | ``false`` |
  35. +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------+-----------+
  36. | :ref:`String<class_String>` | :ref:`pseudolocalization_prefix<class_TranslationDomain_property_pseudolocalization_prefix>` | ``"["`` |
  37. +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------+-----------+
  38. | :ref:`bool<class_bool>` | :ref:`pseudolocalization_skip_placeholders_enabled<class_TranslationDomain_property_pseudolocalization_skip_placeholders_enabled>` | ``true`` |
  39. +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------+-----------+
  40. | :ref:`String<class_String>` | :ref:`pseudolocalization_suffix<class_TranslationDomain_property_pseudolocalization_suffix>` | ``"]"`` |
  41. +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------+-----------+
  42. .. rst-class:: classref-reftable-group
  43. Methods
  44. -------
  45. .. table::
  46. :widths: auto
  47. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | |void| | :ref:`add_translation<class_TranslationDomain_method_add_translation>`\ (\ translation\: :ref:`Translation<class_Translation>`\ ) |
  49. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | |void| | :ref:`clear<class_TranslationDomain_method_clear>`\ (\ ) |
  51. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`Array<class_Array>`\[:ref:`Translation<class_Translation>`\] | :ref:`find_translations<class_TranslationDomain_method_find_translations>`\ (\ locale\: :ref:`String<class_String>`, exact\: :ref:`bool<class_bool>`\ ) |const| |
  53. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`String<class_String>` | :ref:`get_locale_override<class_TranslationDomain_method_get_locale_override>`\ (\ ) |const| |
  55. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`Translation<class_Translation>` | :ref:`get_translation_object<class_TranslationDomain_method_get_translation_object>`\ (\ locale\: :ref:`String<class_String>`\ ) |const| |
  57. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Array<class_Array>`\[:ref:`Translation<class_Translation>`\] | :ref:`get_translations<class_TranslationDomain_method_get_translations>`\ (\ ) |const| |
  59. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`bool<class_bool>` | :ref:`has_translation<class_TranslationDomain_method_has_translation>`\ (\ translation\: :ref:`Translation<class_Translation>`\ ) |const| |
  61. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`has_translation_for_locale<class_TranslationDomain_method_has_translation_for_locale>`\ (\ locale\: :ref:`String<class_String>`, exact\: :ref:`bool<class_bool>`\ ) |const| |
  63. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`StringName<class_StringName>` | :ref:`pseudolocalize<class_TranslationDomain_method_pseudolocalize>`\ (\ message\: :ref:`StringName<class_StringName>`\ ) |const| |
  65. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | |void| | :ref:`remove_translation<class_TranslationDomain_method_remove_translation>`\ (\ translation\: :ref:`Translation<class_Translation>`\ ) |
  67. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | |void| | :ref:`set_locale_override<class_TranslationDomain_method_set_locale_override>`\ (\ locale\: :ref:`String<class_String>`\ ) |
  69. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`StringName<class_StringName>` | :ref:`translate<class_TranslationDomain_method_translate>`\ (\ message\: :ref:`StringName<class_StringName>`, context\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  71. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`StringName<class_StringName>` | :ref:`translate_plural<class_TranslationDomain_method_translate_plural>`\ (\ message\: :ref:`StringName<class_StringName>`, message_plural\: :ref:`StringName<class_StringName>`, n\: :ref:`int<class_int>`, context\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
  73. +--------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. .. rst-class:: classref-section-separator
  75. ----
  76. .. rst-class:: classref-descriptions-group
  77. Property Descriptions
  78. ---------------------
  79. .. _class_TranslationDomain_property_enabled:
  80. .. rst-class:: classref-property
  81. :ref:`bool<class_bool>` **enabled** = ``true`` :ref:`🔗<class_TranslationDomain_property_enabled>`
  82. .. rst-class:: classref-property-setget
  83. - |void| **set_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  84. - :ref:`bool<class_bool>` **is_enabled**\ (\ )
  85. If ``true``, translation is enabled. Otherwise, :ref:`translate()<class_TranslationDomain_method_translate>` and :ref:`translate_plural()<class_TranslationDomain_method_translate_plural>` will return the input message unchanged regardless of the current locale.
  86. .. rst-class:: classref-item-separator
  87. ----
  88. .. _class_TranslationDomain_property_pseudolocalization_accents_enabled:
  89. .. rst-class:: classref-property
  90. :ref:`bool<class_bool>` **pseudolocalization_accents_enabled** = ``true`` :ref:`🔗<class_TranslationDomain_property_pseudolocalization_accents_enabled>`
  91. .. rst-class:: classref-property-setget
  92. - |void| **set_pseudolocalization_accents_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  93. - :ref:`bool<class_bool>` **is_pseudolocalization_accents_enabled**\ (\ )
  94. Replace all characters with their accented variants during pseudolocalization.
  95. \ **Note:** Updating this property does not automatically update texts in the scene tree. Please propagate the :ref:`MainLoop.NOTIFICATION_TRANSLATION_CHANGED<class_MainLoop_constant_NOTIFICATION_TRANSLATION_CHANGED>` notification manually after you have finished modifying pseudolocalization related options.
  96. .. rst-class:: classref-item-separator
  97. ----
  98. .. _class_TranslationDomain_property_pseudolocalization_double_vowels_enabled:
  99. .. rst-class:: classref-property
  100. :ref:`bool<class_bool>` **pseudolocalization_double_vowels_enabled** = ``false`` :ref:`🔗<class_TranslationDomain_property_pseudolocalization_double_vowels_enabled>`
  101. .. rst-class:: classref-property-setget
  102. - |void| **set_pseudolocalization_double_vowels_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  103. - :ref:`bool<class_bool>` **is_pseudolocalization_double_vowels_enabled**\ (\ )
  104. Double vowels in strings during pseudolocalization to simulate the lengthening of text due to localization.
  105. \ **Note:** Updating this property does not automatically update texts in the scene tree. Please propagate the :ref:`MainLoop.NOTIFICATION_TRANSLATION_CHANGED<class_MainLoop_constant_NOTIFICATION_TRANSLATION_CHANGED>` notification manually after you have finished modifying pseudolocalization related options.
  106. .. rst-class:: classref-item-separator
  107. ----
  108. .. _class_TranslationDomain_property_pseudolocalization_enabled:
  109. .. rst-class:: classref-property
  110. :ref:`bool<class_bool>` **pseudolocalization_enabled** = ``false`` :ref:`🔗<class_TranslationDomain_property_pseudolocalization_enabled>`
  111. .. rst-class:: classref-property-setget
  112. - |void| **set_pseudolocalization_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  113. - :ref:`bool<class_bool>` **is_pseudolocalization_enabled**\ (\ )
  114. If ``true``, enables pseudolocalization for the project. This can be used to spot untranslatable strings or layout issues that may occur once the project is localized to languages that have longer strings than the source language.
  115. \ **Note:** Updating this property does not automatically update texts in the scene tree. Please propagate the :ref:`MainLoop.NOTIFICATION_TRANSLATION_CHANGED<class_MainLoop_constant_NOTIFICATION_TRANSLATION_CHANGED>` notification manually after you have finished modifying pseudolocalization related options.
  116. .. rst-class:: classref-item-separator
  117. ----
  118. .. _class_TranslationDomain_property_pseudolocalization_expansion_ratio:
  119. .. rst-class:: classref-property
  120. :ref:`float<class_float>` **pseudolocalization_expansion_ratio** = ``0.0`` :ref:`🔗<class_TranslationDomain_property_pseudolocalization_expansion_ratio>`
  121. .. rst-class:: classref-property-setget
  122. - |void| **set_pseudolocalization_expansion_ratio**\ (\ value\: :ref:`float<class_float>`\ )
  123. - :ref:`float<class_float>` **get_pseudolocalization_expansion_ratio**\ (\ )
  124. The expansion ratio to use during pseudolocalization. A value of ``0.3`` is sufficient for most practical purposes, and will increase the length of each string by 30%.
  125. \ **Note:** Updating this property does not automatically update texts in the scene tree. Please propagate the :ref:`MainLoop.NOTIFICATION_TRANSLATION_CHANGED<class_MainLoop_constant_NOTIFICATION_TRANSLATION_CHANGED>` notification manually after you have finished modifying pseudolocalization related options.
  126. .. rst-class:: classref-item-separator
  127. ----
  128. .. _class_TranslationDomain_property_pseudolocalization_fake_bidi_enabled:
  129. .. rst-class:: classref-property
  130. :ref:`bool<class_bool>` **pseudolocalization_fake_bidi_enabled** = ``false`` :ref:`🔗<class_TranslationDomain_property_pseudolocalization_fake_bidi_enabled>`
  131. .. rst-class:: classref-property-setget
  132. - |void| **set_pseudolocalization_fake_bidi_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  133. - :ref:`bool<class_bool>` **is_pseudolocalization_fake_bidi_enabled**\ (\ )
  134. If ``true``, emulate bidirectional (right-to-left) text when pseudolocalization is enabled. This can be used to spot issues with RTL layout and UI mirroring that will crop up if the project is localized to RTL languages such as Arabic or Hebrew.
  135. \ **Note:** Updating this property does not automatically update texts in the scene tree. Please propagate the :ref:`MainLoop.NOTIFICATION_TRANSLATION_CHANGED<class_MainLoop_constant_NOTIFICATION_TRANSLATION_CHANGED>` notification manually after you have finished modifying pseudolocalization related options.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_TranslationDomain_property_pseudolocalization_override_enabled:
  139. .. rst-class:: classref-property
  140. :ref:`bool<class_bool>` **pseudolocalization_override_enabled** = ``false`` :ref:`🔗<class_TranslationDomain_property_pseudolocalization_override_enabled>`
  141. .. rst-class:: classref-property-setget
  142. - |void| **set_pseudolocalization_override_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  143. - :ref:`bool<class_bool>` **is_pseudolocalization_override_enabled**\ (\ )
  144. Replace all characters in the string with ``*``. Useful for finding non-localizable strings.
  145. \ **Note:** Updating this property does not automatically update texts in the scene tree. Please propagate the :ref:`MainLoop.NOTIFICATION_TRANSLATION_CHANGED<class_MainLoop_constant_NOTIFICATION_TRANSLATION_CHANGED>` notification manually after you have finished modifying pseudolocalization related options.
  146. .. rst-class:: classref-item-separator
  147. ----
  148. .. _class_TranslationDomain_property_pseudolocalization_prefix:
  149. .. rst-class:: classref-property
  150. :ref:`String<class_String>` **pseudolocalization_prefix** = ``"["`` :ref:`🔗<class_TranslationDomain_property_pseudolocalization_prefix>`
  151. .. rst-class:: classref-property-setget
  152. - |void| **set_pseudolocalization_prefix**\ (\ value\: :ref:`String<class_String>`\ )
  153. - :ref:`String<class_String>` **get_pseudolocalization_prefix**\ (\ )
  154. Prefix that will be prepended to the pseudolocalized string.
  155. \ **Note:** Updating this property does not automatically update texts in the scene tree. Please propagate the :ref:`MainLoop.NOTIFICATION_TRANSLATION_CHANGED<class_MainLoop_constant_NOTIFICATION_TRANSLATION_CHANGED>` notification manually after you have finished modifying pseudolocalization related options.
  156. .. rst-class:: classref-item-separator
  157. ----
  158. .. _class_TranslationDomain_property_pseudolocalization_skip_placeholders_enabled:
  159. .. rst-class:: classref-property
  160. :ref:`bool<class_bool>` **pseudolocalization_skip_placeholders_enabled** = ``true`` :ref:`🔗<class_TranslationDomain_property_pseudolocalization_skip_placeholders_enabled>`
  161. .. rst-class:: classref-property-setget
  162. - |void| **set_pseudolocalization_skip_placeholders_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  163. - :ref:`bool<class_bool>` **is_pseudolocalization_skip_placeholders_enabled**\ (\ )
  164. Skip placeholders for string formatting like ``%s`` or ``%f`` during pseudolocalization. Useful to identify strings which need additional control characters to display correctly.
  165. \ **Note:** Updating this property does not automatically update texts in the scene tree. Please propagate the :ref:`MainLoop.NOTIFICATION_TRANSLATION_CHANGED<class_MainLoop_constant_NOTIFICATION_TRANSLATION_CHANGED>` notification manually after you have finished modifying pseudolocalization related options.
  166. .. rst-class:: classref-item-separator
  167. ----
  168. .. _class_TranslationDomain_property_pseudolocalization_suffix:
  169. .. rst-class:: classref-property
  170. :ref:`String<class_String>` **pseudolocalization_suffix** = ``"]"`` :ref:`🔗<class_TranslationDomain_property_pseudolocalization_suffix>`
  171. .. rst-class:: classref-property-setget
  172. - |void| **set_pseudolocalization_suffix**\ (\ value\: :ref:`String<class_String>`\ )
  173. - :ref:`String<class_String>` **get_pseudolocalization_suffix**\ (\ )
  174. Suffix that will be appended to the pseudolocalized string.
  175. \ **Note:** Updating this property does not automatically update texts in the scene tree. Please propagate the :ref:`MainLoop.NOTIFICATION_TRANSLATION_CHANGED<class_MainLoop_constant_NOTIFICATION_TRANSLATION_CHANGED>` notification manually after you have finished modifying pseudolocalization related options.
  176. .. rst-class:: classref-section-separator
  177. ----
  178. .. rst-class:: classref-descriptions-group
  179. Method Descriptions
  180. -------------------
  181. .. _class_TranslationDomain_method_add_translation:
  182. .. rst-class:: classref-method
  183. |void| **add_translation**\ (\ translation\: :ref:`Translation<class_Translation>`\ ) :ref:`🔗<class_TranslationDomain_method_add_translation>`
  184. Adds a translation.
  185. .. rst-class:: classref-item-separator
  186. ----
  187. .. _class_TranslationDomain_method_clear:
  188. .. rst-class:: classref-method
  189. |void| **clear**\ (\ ) :ref:`🔗<class_TranslationDomain_method_clear>`
  190. Removes all translations.
  191. .. rst-class:: classref-item-separator
  192. ----
  193. .. _class_TranslationDomain_method_find_translations:
  194. .. rst-class:: classref-method
  195. :ref:`Array<class_Array>`\[:ref:`Translation<class_Translation>`\] **find_translations**\ (\ locale\: :ref:`String<class_String>`, exact\: :ref:`bool<class_bool>`\ ) |const| :ref:`🔗<class_TranslationDomain_method_find_translations>`
  196. Returns the :ref:`Translation<class_Translation>` instances that match ``locale`` (see :ref:`TranslationServer.compare_locales()<class_TranslationServer_method_compare_locales>`). If ``exact`` is ``true``, only instances whose locale exactly equals ``locale`` will be returned.
  197. .. rst-class:: classref-item-separator
  198. ----
  199. .. _class_TranslationDomain_method_get_locale_override:
  200. .. rst-class:: classref-method
  201. :ref:`String<class_String>` **get_locale_override**\ (\ ) |const| :ref:`🔗<class_TranslationDomain_method_get_locale_override>`
  202. Returns the locale override of the domain. Returns an empty string if locale override is disabled.
  203. .. rst-class:: classref-item-separator
  204. ----
  205. .. _class_TranslationDomain_method_get_translation_object:
  206. .. rst-class:: classref-method
  207. :ref:`Translation<class_Translation>` **get_translation_object**\ (\ locale\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_TranslationDomain_method_get_translation_object>`
  208. **Deprecated:** Use :ref:`find_translations()<class_TranslationDomain_method_find_translations>` instead.
  209. Returns the :ref:`Translation<class_Translation>` instance that best matches ``locale``. Returns ``null`` if there are no matches.
  210. .. rst-class:: classref-item-separator
  211. ----
  212. .. _class_TranslationDomain_method_get_translations:
  213. .. rst-class:: classref-method
  214. :ref:`Array<class_Array>`\[:ref:`Translation<class_Translation>`\] **get_translations**\ (\ ) |const| :ref:`🔗<class_TranslationDomain_method_get_translations>`
  215. Returns all available :ref:`Translation<class_Translation>` instances as added by :ref:`add_translation()<class_TranslationDomain_method_add_translation>`.
  216. .. rst-class:: classref-item-separator
  217. ----
  218. .. _class_TranslationDomain_method_has_translation:
  219. .. rst-class:: classref-method
  220. :ref:`bool<class_bool>` **has_translation**\ (\ translation\: :ref:`Translation<class_Translation>`\ ) |const| :ref:`🔗<class_TranslationDomain_method_has_translation>`
  221. Returns ``true`` if this translation domain contains the given ``translation``.
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_TranslationDomain_method_has_translation_for_locale:
  225. .. rst-class:: classref-method
  226. :ref:`bool<class_bool>` **has_translation_for_locale**\ (\ locale\: :ref:`String<class_String>`, exact\: :ref:`bool<class_bool>`\ ) |const| :ref:`🔗<class_TranslationDomain_method_has_translation_for_locale>`
  227. Returns ``true`` if there are any :ref:`Translation<class_Translation>` instances that match ``locale`` (see :ref:`TranslationServer.compare_locales()<class_TranslationServer_method_compare_locales>`). If ``exact`` is ``true``, only instances whose locale exactly equals ``locale`` are considered.
  228. .. rst-class:: classref-item-separator
  229. ----
  230. .. _class_TranslationDomain_method_pseudolocalize:
  231. .. rst-class:: classref-method
  232. :ref:`StringName<class_StringName>` **pseudolocalize**\ (\ message\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_TranslationDomain_method_pseudolocalize>`
  233. Returns the pseudolocalized string based on the ``message`` passed in.
  234. .. rst-class:: classref-item-separator
  235. ----
  236. .. _class_TranslationDomain_method_remove_translation:
  237. .. rst-class:: classref-method
  238. |void| **remove_translation**\ (\ translation\: :ref:`Translation<class_Translation>`\ ) :ref:`🔗<class_TranslationDomain_method_remove_translation>`
  239. Removes the given translation.
  240. .. rst-class:: classref-item-separator
  241. ----
  242. .. _class_TranslationDomain_method_set_locale_override:
  243. .. rst-class:: classref-method
  244. |void| **set_locale_override**\ (\ locale\: :ref:`String<class_String>`\ ) :ref:`🔗<class_TranslationDomain_method_set_locale_override>`
  245. Sets the locale override of the domain.
  246. If ``locale`` is an empty string, locale override is disabled. Otherwise, ``locale`` will be standardized to match known locales (e.g. ``en-US`` would be matched to ``en_US``).
  247. \ **Note:** Calling this method does not automatically update texts in the scene tree. Please propagate the :ref:`MainLoop.NOTIFICATION_TRANSLATION_CHANGED<class_MainLoop_constant_NOTIFICATION_TRANSLATION_CHANGED>` signal manually.
  248. .. rst-class:: classref-item-separator
  249. ----
  250. .. _class_TranslationDomain_method_translate:
  251. .. rst-class:: classref-method
  252. :ref:`StringName<class_StringName>` **translate**\ (\ message\: :ref:`StringName<class_StringName>`, context\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_TranslationDomain_method_translate>`
  253. Returns the current locale's translation for the given message and context.
  254. .. rst-class:: classref-item-separator
  255. ----
  256. .. _class_TranslationDomain_method_translate_plural:
  257. .. rst-class:: classref-method
  258. :ref:`StringName<class_StringName>` **translate_plural**\ (\ message\: :ref:`StringName<class_StringName>`, message_plural\: :ref:`StringName<class_StringName>`, n\: :ref:`int<class_int>`, context\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_TranslationDomain_method_translate_plural>`
  259. Returns the current locale's translation for the given message, plural message and context.
  260. The number ``n`` is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language.
  261. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  262. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  263. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  264. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  265. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  266. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  267. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  268. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  269. .. |void| replace:: :abbr:`void (No return value.)`