Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

OptimizedTranslation

繼承: Translation < Resource < RefCounted < Object

經過最佳化的翻譯。

說明

最佳化後的翻譯。它使用即時壓縮翻譯,因此生成的字典非常小。

出於最佳化目的,該類不儲存未翻譯的字串。因此,Translation.get_message_list() 始終回傳一個空陣列,而 Translation.get_message_count() 始終回傳 0。

方法

bool

generate(from: Translation)


方法說明

bool generate(from: Translation) 🔗

根據給定的 Translation(翻譯)資源,生成並設定一套最佳化後的翻譯。如果操作成功,則回傳 true。

注意: from 中的訊息不應使用情境(context)或複數形式。

注意: 此方法旨在編輯器內使用。在匯出的專案(即打包發佈後的遊戲或應用)中呼叫它不會產生任何效果。