Skip to content

Commit 2c8a1f0

Browse files
committed
Merge pull request godotengine#91544 from MewPurPur/add-translation-server-note
Add notes in Object documentation about TranslationServer methods
2 parents 0fcd301 + 409202d commit 2c8a1f0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/classes/Object.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,7 @@
10341034
Translates a [param message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. Note that most [Control] nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text.
10351035
If [method can_translate_messages] is [code]false[/code], or no translation is available, this method returns the [param message] without changes. See [method set_message_translation].
10361036
For detailed examples, see [url=$DOCS_URL/tutorials/i18n/internationalizing_games.html]Internationalizing games[/url].
1037+
[b]Note:[/b] This method can't be used without an [Object] instance, as it requires the [method can_translate_messages] method. To translate strings in a static context, use [method TranslationServer.translate].
10371038
</description>
10381039
</method>
10391040
<method name="tr_n" qualifiers="const">
@@ -1048,6 +1049,7 @@
10481049
The [param n] is the number, or amount, of the message's subject. It is used by the translation system to fetch the correct plural form for the current language.
10491050
For detailed examples, see [url=$DOCS_URL/tutorials/i18n/localization_using_gettext.html]Localization using gettext[/url].
10501051
[b]Note:[/b] Negative and [float] numbers may not properly apply to some countable subjects. It's recommended to handle these cases with [method tr].
1052+
[b]Note:[/b] This method can't be used without an [Object] instance, as it requires the [method can_translate_messages] method. To translate strings in a static context, use [method TranslationServer.translate_plural].
10511053
</description>
10521054
</method>
10531055
</methods>

0 commit comments

Comments
 (0)