Skip to content

Commit

Permalink
feat:add locales
Browse files Browse the repository at this point in the history
  • Loading branch information
limuy2022 committed Jun 18, 2024
1 parent bb9697c commit 817f6b4
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 9 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ A indie fan game about undertale and terraria, developed in godot engine

## Build Guide

Godot 4.2.2

Because of the godot extensions of Rust and Cpp,you should make sure that the rust and cpp compiler have been installed.

Then you can run ```cd script && python build.py``` to build the extension (both Debug and Release)
| dependencies |
| :---------------- |
| Godot 4.3 |
| Gettext |
| Protobuf Compiler |
| Rust Compiler |

Then you can run `cd script && python build.py` to build the extension (both Debug and Release)

Finally,you can start godot editor and develop or export the game.

Expand Down
9 changes: 6 additions & 3 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@

## 构建指南

Godot 4.2.2

由于Rust和Cpp的godot extensions,你需要确保rust和Cpp编译器已经安装好了
| 依赖 |
| :---------------- |
| Godot 4.3 |
| Gettext |
| Protobuf Compiler |
| Rust Compiler |

接下来,你可以运行`cd script && python build.py`来构建extension(Debug和Release)

Expand Down
1 change: 1 addition & 0 deletions gdrust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ mod consts;
mod fight;
mod fight_items;
mod player;
mod ui;
mod utils;
mod weapons;
mod zenith;
Expand Down
1 change: 1 addition & 0 deletions gdrust/src/ui.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mod multi_enter;
15 changes: 15 additions & 0 deletions gdrust/src/ui/multi_enter.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use godot::engine::{Button, IButton};
use godot::prelude::*;

#[derive(GodotClass)]
#[class(base = Button)]
struct MultiEnter {
base: Base<Button>,
}

#[godot_api()]
impl IButton for MultiEnter {
fn init(base: Base<Button>) -> Self {
Self { base }
}
}
36 changes: 36 additions & 0 deletions locales/multi_game.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# LANGUAGE translation for Zenith for the following files:
# res://scenes/multi_game.tscn
#
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Zenith\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"

#: scenes/multi_game.tscn
msgid "OK"
msgstr ""

#: scenes/multi_game.tscn
msgid "Warning!"
msgstr ""

#: scenes/multi_game.tscn
msgid "IP"
msgstr ""

#: scenes/multi_game.tscn
msgid "like 127.0.0.1:6371"
msgstr ""

#: scenes/multi_game.tscn
msgid "Player"
msgstr ""

#: scenes/multi_game.tscn
msgid "Limuy"
msgstr ""
5 changes: 5 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ slow_down={
]
}

[internationalization]

locale/translations=PackedStringArray("res://locales/zh_cn.po")
locale/translations_pot_files=PackedStringArray("res://scenes/multi_game.tscn")

[layer_names]

2d_render/layer_2="wall"
2 changes: 1 addition & 1 deletion scenes/multi_game.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Ok" type="Button" parent="."]
[node name="Ok" type="MultiEnter" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.5
Expand Down

0 comments on commit 817f6b4

Please sign in to comment.