跳转至

TranslationServer

继承

Object

简要描述

管理所有翻译的服务器。

描述

管理所有翻译的服务器。可以为其设置翻译,也可以将其删除。

方法

返回值类型 方法名称
void add_translation(translation: Translation)
void clear()
Array get_loaded_locales() const
String get_locale() const
String get_locale_name(locale: String) const
void remove_translation(translation: Translation)
void set_locale(locale: String)
String translate(message: String) const

方法说明

  • add_translation add_translation(translation: Translation)

添加Translation资源。


  • clear clear()

从所有翻译中清除服务器。


  • get_loaded_locales get_loaded_locales() const

返回游戏所有已加载语言环境的数组。


  • get_locale get_locale() const

返回游戏的当前语言环境。


  • get_locale_name get_locale_name(locale: String) const

返回语言环境的语言及其变量(例如"en_US"将返回"English (United States)")。


  • remove_translation remove_translation(translation: Translation)

从服务器中删除给定的翻译。


  • set_locale set_locale(locale: String)

设置游戏的语言环境。


  • translate translate(message: String) const

返回给定消息(键)的当前语言环境翻译。