TranslationServer.xml 2.2 KB

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