TranslationServer.xml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="TranslationServer" inherits="Object" version="3.4">
  3. <brief_description>
  4. Server that manages all translations.
  5. </brief_description>
  6. <description>
  7. Server that manages all translations. Translations can be set to it and removed from it.
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/3.3/tutorials/i18n/internationalizing_games.html</link>
  11. <link>https://docs.godotengine.org/en/3.3/tutorials/i18n/locales.html</link>
  12. </tutorials>
  13. <methods>
  14. <method name="add_translation">
  15. <return type="void">
  16. </return>
  17. <argument index="0" name="translation" type="Translation">
  18. </argument>
  19. <description>
  20. Adds a [Translation] resource.
  21. </description>
  22. </method>
  23. <method name="clear">
  24. <return type="void">
  25. </return>
  26. <description>
  27. Clears the server from all translations.
  28. </description>
  29. </method>
  30. <method name="get_loaded_locales" qualifiers="const">
  31. <return type="Array">
  32. </return>
  33. <description>
  34. Returns an Array of all loaded locales of the game.
  35. </description>
  36. </method>
  37. <method name="get_locale" qualifiers="const">
  38. <return type="String">
  39. </return>
  40. <description>
  41. Returns the current locale of the game.
  42. </description>
  43. </method>
  44. <method name="get_locale_name" qualifiers="const">
  45. <return type="String">
  46. </return>
  47. <argument index="0" name="locale" type="String">
  48. </argument>
  49. <description>
  50. Returns a locale's language and its variant (e.g. [code]"en_US"[/code] would return [code]"English (United States)"[/code]).
  51. </description>
  52. </method>
  53. <method name="remove_translation">
  54. <return type="void">
  55. </return>
  56. <argument index="0" name="translation" type="Translation">
  57. </argument>
  58. <description>
  59. Removes the given translation from the server.
  60. </description>
  61. </method>
  62. <method name="set_locale">
  63. <return type="void">
  64. </return>
  65. <argument index="0" name="locale" type="String">
  66. </argument>
  67. <description>
  68. Sets the locale of the game.
  69. </description>
  70. </method>
  71. <method name="translate" qualifiers="const">
  72. <return type="String">
  73. </return>
  74. <argument index="0" name="message" type="String">
  75. </argument>
  76. <description>
  77. Returns the current locale's translation for the given message (key).
  78. </description>
  79. </method>
  80. </methods>
  81. <constants>
  82. </constants>
  83. </class>