From b35fb5007348b7892c9d1314c8d3b18818be7178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9C=A7=E9=9B=A8=E7=83=A8?= Date: Fri, 14 Jun 2024 00:43:31 +0800 Subject: [PATCH] Subdivision of Misc and Action from UI translation files. --- locals/Action.csv | 8 ++++++++ locals/Action.csv.import | 17 +++++++++++++++++ locals/Misc.csv | 4 ++++ locals/Misc.csv.import | 17 +++++++++++++++++ locals/UI.csv | 10 ---------- project.godot | 2 +- scripts/character/Player.cs | 14 +++++++------- .../loader/uiLoader/LevelGraphEditorLoader.cs | 14 +++++++------- 8 files changed, 61 insertions(+), 25 deletions(-) create mode 100644 locals/Action.csv create mode 100644 locals/Action.csv.import create mode 100644 locals/Misc.csv create mode 100644 locals/Misc.csv.import diff --git a/locals/Action.csv b/locals/Action.csv new file mode 100644 index 0000000..9c072c2 --- /dev/null +++ b/locals/Action.csv @@ -0,0 +1,8 @@ +id,zh,en,ja +action_pick_up,拾捡,Pick up ,拾います +action_move_left,向左移动,Move left,左に移動します +action_move_right,向右移动,Move right,右に移動します +action_jump,跳跃,Jump,飛 +action_throw,抛出,Throw a ,ほうしゅつ +action_use_item,使用,Use,しよう +action_jump_down,跳下平台,Jump off platform,踊り場から飛び降ります \ No newline at end of file diff --git a/locals/Action.csv.import b/locals/Action.csv.import new file mode 100644 index 0000000..c34e892 --- /dev/null +++ b/locals/Action.csv.import @@ -0,0 +1,17 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://b0hqoab2n241u" + +[deps] + +files=["res://locals/Action.zh.translation", "res://locals/Action.en.translation", "res://locals/Action.ja.translation"] + +source_file="res://locals/Action.csv" +dest_files=["res://locals/Action.zh.translation", "res://locals/Action.en.translation", "res://locals/Action.ja.translation"] + +[params] + +compress=true +delimiter=0 diff --git a/locals/Misc.csv b/locals/Misc.csv new file mode 100644 index 0000000..1d3370e --- /dev/null +++ b/locals/Misc.csv @@ -0,0 +1,4 @@ +id,zh,en,ja +de,的,"'s",の +default_player_name,白纸,blankPaper,しらかみ +item_prompt_debug,ID:{0}\n名称:{1}\n数量:{2}\n最大叠加数量:{3}\n数据类型:{4}\n描述:{5},ID: {0}\nName: {1}\nQuantity: {2}\nMaximum stacking quantity: {3}\nData type: {4}\nDescription:{5},id:{0}\n名称:{1}\nの数は最大{2}\nシナジー数:{3}\nデータタイプ:{4}\n述べ表わす:{5} \ No newline at end of file diff --git a/locals/Misc.csv.import b/locals/Misc.csv.import new file mode 100644 index 0000000..c2d2d11 --- /dev/null +++ b/locals/Misc.csv.import @@ -0,0 +1,17 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://bdyf1nkmm3h6c" + +[deps] + +files=["res://locals/Misc.zh.translation", "res://locals/Misc.en.translation", "res://locals/Misc.ja.translation"] + +source_file="res://locals/Misc.csv" +dest_files=["res://locals/Misc.zh.translation", "res://locals/Misc.en.translation", "res://locals/Misc.ja.translation"] + +[params] + +compress=true +delimiter=0 diff --git a/locals/UI.csv b/locals/UI.csv index 97ea839..7f407b4 100644 --- a/locals/UI.csv +++ b/locals/UI.csv @@ -2,16 +2,6 @@ id,zh,en,ja ui_product_name,异界旅人,A traveler from another world,異界の旅人です ui_start_game,开始游戏,Start game,ゲームを始めます ui_settings,设置,Settings,備え付け -ui_pick_up,拾捡,Pick up ,拾います -ui_move_left,向左移动,Move left,左に移動します -ui_move_right,向右移动,Move right,右に移動します -ui_jump,跳跃,Jump,飛 -ui_throw,抛出,Throw a ,ほうしゅつ -ui_use_item,使用,Use,しよう -ui_jump_down,跳下平台,Jump off platform,踊り場から飛び降ります -ui_de,的,"'s",の -ui_default_player_name,白纸,blankPaper,しらかみ -ui_item_prompt_debug,ID:{0}\n名称:{1}\n数量:{2}\n最大叠加数量:{3}\n数据类型:{4}\n描述:{5},ID: {0}\nName: {1}\nQuantity: {2}\nMaximum stacking quantity: {3}\nData type: {4}\nDescription:{5},id:{0}\n名称:{1}\nの数は最大{2}\nシナジー数:{3}\nデータタイプ:{4}\n述べ表わす:{5} ui_level_graph_editor,关卡图编辑器,Level graph editor,ステージマップエディター ui_create_room,创建房间,Create room,部屋を作ります ui_close,关闭,Close,閉じます diff --git a/project.godot b/project.godot index 0fcb4f3..933865e 100644 --- a/project.godot +++ b/project.godot @@ -146,7 +146,7 @@ hotbar_previous={ [internationalization] -locale/translations=PackedStringArray("res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.ja.translation", "res://locals/DeathInfo.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.ja.translation", "res://locals/InputMapping.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.ja.translation", "res://locals/Log.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.ja.translation", "res://locals/Slogan.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.ja.translation", "res://locals/UI.zh.translation", "res://locals/Item.en.translation", "res://locals/Item.ja.translation", "res://locals/Item.zh.translation") +locale/translations=PackedStringArray("res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.ja.translation", "res://locals/DeathInfo.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.ja.translation", "res://locals/InputMapping.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.ja.translation", "res://locals/Log.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.ja.translation", "res://locals/Slogan.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.ja.translation", "res://locals/UI.zh.translation", "res://locals/Item.en.translation", "res://locals/Item.ja.translation", "res://locals/Item.zh.translation", "res://locals/Action.en.translation", "res://locals/Action.ja.translation", "res://locals/Action.zh.translation", "res://locals/Misc.en.translation", "res://locals/Misc.ja.translation", "res://locals/Misc.zh.translation") [layer_names] diff --git a/scripts/character/Player.cs b/scripts/character/Player.cs index 6a291f0..a965b5c 100644 --- a/scripts/character/Player.cs +++ b/scripts/character/Player.cs @@ -82,21 +82,21 @@ public partial class Player : CharacterTemplate operationTipBuilder.Append(']'); operationTipBuilder.Append(TranslationServerUtils.Translate(InputMap.ActionGetEvents("ui_left")[0].AsText())); operationTipBuilder.Append("[/color]"); - operationTipBuilder.Append(TranslationServerUtils.Translate("move_left")); + operationTipBuilder.Append(TranslationServerUtils.Translate("action_move_left")); operationTipBuilder.Append(' '); operationTipBuilder.Append("[color="); operationTipBuilder.Append(Config.OperationTipActionColor); operationTipBuilder.Append(']'); operationTipBuilder.Append(TranslationServerUtils.Translate(InputMap.ActionGetEvents("ui_right")[0].AsText())); operationTipBuilder.Append("[/color]"); - operationTipBuilder.Append(TranslationServerUtils.Translate("move_right")); + operationTipBuilder.Append(TranslationServerUtils.Translate("action_move_right")); operationTipBuilder.Append(' '); operationTipBuilder.Append("[color="); operationTipBuilder.Append(Config.OperationTipActionColor); operationTipBuilder.Append(']'); operationTipBuilder.Append(TranslationServerUtils.Translate(InputMap.ActionGetEvents("ui_up")[0].AsText())); operationTipBuilder.Append("[/color]"); - operationTipBuilder.Append(TranslationServerUtils.Translate("jump")); + operationTipBuilder.Append(TranslationServerUtils.Translate("action_jump")); if (_collidingWithPlatform) { operationTipBuilder.Append(' '); @@ -106,7 +106,7 @@ public partial class Player : CharacterTemplate operationTipBuilder.Append( TranslationServerUtils.Translate(InputMap.ActionGetEvents("ui_down")[0].AsText())); operationTipBuilder.Append("[/color]"); - operationTipBuilder.Append(TranslationServerUtils.Translate("jump_down")); + operationTipBuilder.Append(TranslationServerUtils.Translate("action_jump_down")); } //If the PickingRangeBodiesList is not null and the length is greater than 0 @@ -120,7 +120,7 @@ public partial class Player : CharacterTemplate operationTipBuilder.Append( TranslationServerUtils.Translate(InputMap.ActionGetEvents("pick_up")[0].AsText())); operationTipBuilder.Append("[/color]"); - operationTipBuilder.Append(TranslationServerUtils.Translate("pick_up")); + operationTipBuilder.Append(TranslationServerUtils.Translate("action_pick_up")); operationTipLabel.Text = operationTipBuilder.ToString(); } @@ -132,7 +132,7 @@ public partial class Player : CharacterTemplate operationTipBuilder.Append(']'); operationTipBuilder.Append(TranslationServerUtils.Translate(InputMap.ActionGetEvents("throw")[0].AsText())); operationTipBuilder.Append("[/color]"); - operationTipBuilder.Append(TranslationServerUtils.Translate("throw")); + operationTipBuilder.Append(TranslationServerUtils.Translate("action_throw")); if (CurrentItem is IItem item) { operationTipBuilder.Append(TranslationServerUtils.Translate(item.Name)); @@ -143,7 +143,7 @@ public partial class Player : CharacterTemplate operationTipBuilder.Append( TranslationServerUtils.Translate(InputMap.ActionGetEvents("use_item")[0].AsText())); operationTipBuilder.Append("[/color]"); - operationTipBuilder.Append(TranslationServerUtils.Translate("use_item")); + operationTipBuilder.Append(TranslationServerUtils.Translate("action_use_item")); operationTipBuilder.Append(TranslationServerUtils.Translate(item.Name)); } } diff --git a/scripts/loader/uiLoader/LevelGraphEditorLoader.cs b/scripts/loader/uiLoader/LevelGraphEditorLoader.cs index b10804a..3d20953 100644 --- a/scripts/loader/uiLoader/LevelGraphEditorLoader.cs +++ b/scripts/loader/uiLoader/LevelGraphEditorLoader.cs @@ -60,7 +60,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate { base.InitializeData(); _roomNodeScene = (PackedScene)GD.Load("res://prefab/ui/RoomNode.tscn"); - _defaultRoomName = TranslationServerUtils.Translate("default_room_name"); + _defaultRoomName = TranslationServerUtils.Translate("ui_default_room_name"); var folder = Config.GetLevelGraphExportDirectory(); if (!Directory.Exists(folder)) { @@ -148,7 +148,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate { if (!lastLine.StartsWith("res://")) { - var lineError = TranslationServer.Translate("line_errors_must_start_with_res"); + var lineError = TranslationServer.Translate("ui_line_errors_must_start_with_res"); if (lineError == null) { return; @@ -162,7 +162,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate var dirExists = DirAccess.DirExistsAbsolute(lastLine); if (!fileExists && !dirExists) { - var lineError = TranslationServerUtils.Translate("error_specifying_room_template_line"); + var lineError = TranslationServerUtils.Translate("ui_error_specifying_room_template_line"); if (lineError == null) { return; @@ -404,7 +404,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate if (_nodeBinding.ActionButton != null) { - _nodeBinding.ActionButton.Text = TranslationServerUtils.Translate("load"); + _nodeBinding.ActionButton.Text = TranslationServerUtils.Translate("ui_load"); } if (_nodeBinding.FileNameLineEdit != null) @@ -414,7 +414,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate if (_nodeBinding.SaveOrLoadPanelTitleLabel != null) { - _nodeBinding.SaveOrLoadPanelTitleLabel.Text = TranslationServerUtils.Translate("load"); + _nodeBinding.SaveOrLoadPanelTitleLabel.Text = TranslationServerUtils.Translate("ui_load"); } _saveMode = false; @@ -432,7 +432,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate if (_nodeBinding.ActionButton != null) { - _nodeBinding.ActionButton.Text = TranslationServerUtils.Translate("save"); + _nodeBinding.ActionButton.Text = TranslationServerUtils.Translate("ui_save"); } if (_nodeBinding.FileNameLineEdit != null) @@ -442,7 +442,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate if (_nodeBinding.SaveOrLoadPanelTitleLabel != null) { - _nodeBinding.SaveOrLoadPanelTitleLabel.Text = TranslationServerUtils.Translate("save"); + _nodeBinding.SaveOrLoadPanelTitleLabel.Text = TranslationServerUtils.Translate("ui_save"); } _saveMode = true;