Switch repo to English, add i18n with EN/DE language files and first-start language selection
- in-game texts moved to lang/en.lang and lang/de.lang (key = text, placeholders) - game logic emits message keys + args, translated at display time - localStorage access via own miniquad JS plugin (www/dc_plugin.js) - code comments, DESIGN.md, CREDITS.md translated; README.md added Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a101f6ddc4
commit
fbf6f223fc
18 files changed
+1072
-362
No files matched your search
+13
@@ -2,7 +2,9 @@
|
||||
|
||||
mod game;
|
||||
mod gfx;
|
||||
mod i18n;
|
||||
mod map;
|
||||
mod platform;
|
||||
mod render3d;
|
||||
mod sound;
|
||||
mod ui;
|
||||
@@ -59,6 +61,11 @@ async fn main() {
|
||||
let mut seed = (miniquad::date::now() * 1000.0) as u32 | 1;
|
||||
let (mut game, mut cam) = new_game(seed);
|
||||
let mut ui = Ui::new();
|
||||
// language: stored choice, otherwise ask on first start
|
||||
match platform::storage_get("dc.lang") {
|
||||
Some(code) if i18n::set_language(&code) => {}
|
||||
_ => ui.show_langsel = true,
|
||||
}
|
||||
let mut inp = Input { ldown: None, rdown: None, rlast: (0.0, 0.0), rdrag: false, mlast: None, minimap_drag: false };
|
||||
|
||||
loop {
|
||||
@@ -234,6 +241,12 @@ async fn main() {
|
||||
(game, cam) = new_game(seed);
|
||||
ui.show_help = false;
|
||||
}
|
||||
UiAction::SelectLanguage(code) => {
|
||||
i18n::set_language(&code);
|
||||
platform::storage_set("dc.lang", &code);
|
||||
ui.show_langsel = false;
|
||||
game.sfx_ui(game::Sfx::Click);
|
||||
}
|
||||
UiAction::Consumed => {}
|
||||
UiAction::None => {
|
||||
if game.state == 0 {
|
||||
|
||||
Reference in new issue
Block a user