TranslationServer.xml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="TranslationServer" inherits="Object" category="Core" version="3.1.2">
  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.1/tutorials/i18n/internationalizing_games.html</link>
  11. <link>https://docs.godotengine.org/en/3.1/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. </description>
  35. </method>
  36. <method name="get_locale" qualifiers="const">
  37. <return type="String">
  38. </return>
  39. <description>
  40. Returns the current locale of the game.
  41. </description>
  42. </method>
  43. <method name="get_locale_name" qualifiers="const">
  44. <return type="String">
  45. </return>
  46. <argument index="0" name="locale" type="String">
  47. </argument>
  48. <description>
  49. Returns a locale's language and its variant (e.g. "en_US" would return "English (United States)").
  50. </description>
  51. </method>
  52. <method name="remove_translation">
  53. <return type="void">
  54. </return>
  55. <argument index="0" name="translation" type="Translation">
  56. </argument>
  57. <description>
  58. Removes the given translation from the server.
  59. </description>
  60. </method>
  61. <method name="set_locale">
  62. <return type="void">
  63. </return>
  64. <argument index="0" name="locale" type="String">
  65. </argument>
  66. <description>
  67. Sets the locale of the game.
  68. </description>
  69. </method>
  70. <method name="translate" qualifiers="const">
  71. <return type="String">
  72. </return>
  73. <argument index="0" name="message" type="String">
  74. </argument>
  75. <description>
  76. Returns the current locale's translation for the given message (key).
  77. </description>
  78. </method>
  79. </methods>
  80. <constants>
  81. </constants>
  82. </class>