Skip to content

Commit 8c1249e

Browse files
authored
feat: add i18n package (#545)
* bump * lang * ffi * locale * pt-BR * i18n * en-US * vite * import * i18n * build-app * i18n * just * i18n * locale * useMarket * fix imports * onError * clippy
1 parent b3b1a49 commit 8c1249e

161 files changed

Lines changed: 1216 additions & 756 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
run: |
8080
pnpm ci
8181
pnpm run -F @tsukilabs/nil-bindings build
82+
pnpm run -F @tsukilabs/nil-i18n build
8283
8384
- name: Run tests
8485
run: cargo -Zscript scripts/test.rs

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"js/ts.tsdk.path": "node_modules/typescript/lib",
2929
"rust-analyzer.linkedProjects": [
3030
"./Cargo.toml",
31-
"./scripts/build-client.rs",
31+
"./scripts/build-app.rs",
3232
"./scripts/build-docs.rs",
3333
"./scripts/build-ffi.rs",
3434
"./scripts/build-server.rs",

Cargo.lock

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ members = [
2323

2424
[workspace.package]
2525
description = "Multiplayer strategy game"
26-
version = "0.7.14"
26+
version = "0.7.15"
2727
edition = "2024"
2828
rust-version = "1.99"
2929
license = "AGPL-3.0-only"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Call of Nil requires a [nightly Rust toolchain](https://rust-lang.github.io/rust
1414
```sh
1515
git clone https://github.com/tsukilabs/nil.git
1616
cd nil
17-
cargo -Zscript scripts/build-client.rs
17+
cargo -Zscript scripts/build-app.rs
1818
```
1919

2020
## Library usage

app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"type-check": "vue-tsc --noEmit"
1111
},
1212
"dependencies": {
13-
"@tsukilabs/nil-bindings": "workspace:*"
13+
"@tsukilabs/nil-bindings": "workspace:*",
14+
"@tsukilabs/nil-i18n": "workspace:*"
1415
},
1516
"devDependencies": {
1617
"tailwindcss": "=4.3.3"

app/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2.0.0",
33
"productName": "Call of Nil",
4-
"version": "0.7.14",
4+
"version": "0.7.15",
55
"identifier": "tsukilabs.nil",
66
"build": {
77
"beforeDevCommand": "pnpm run -F ui dev",

app/src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
<script setup lang="ts">
55
import { router } from "@/router";
6-
import { useI18n } from "vue-i18n";
76
import { Sonner } from "@ui/sonner";
87
import * as commands from "@/commands";
98
import { handleError } from "@/lib/error";
109
import { nextTick, onMounted } from "vue";
1110
import { handleProcessArgs } from "@/lib/env";
11+
import { useI18n } from "@tsukilabs/nil-i18n";
1212
import Loading from "@/components/Loading.vue";
1313
import { useSettings } from "@/stores/settings";
1414
import { ListenerSet } from "@/lib/listener-set";
@@ -71,6 +71,7 @@ function setColorMode(mode: BasicColorSchema) {
7171
7272
function setLocale(value: Locale) {
7373
i18n.locale.value = value;
74+
document.querySelector("html")?.setAttribute("lang", value);
7475
}
7576
</script>
7677

app/src/components/CityTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
33

44
<script vapor lang="ts">
5-
import { useI18n } from "vue-i18n";
5+
import { useI18n } from "@tsukilabs/nil-i18n";
66
import { computed, ref } from "vue";
77
import { PLACEHOLDER } from "@/lib/string";
88
import type { Option } from "@tb-dev/utils";

app/src/components/chat/ChatInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<script vapor lang="ts">
55
import { Input } from "@ui/input";
6-
import { useI18n } from "vue-i18n";
6+
import { useI18n } from "@tsukilabs/nil-i18n";
77
import { Button } from "@ui/button";
88
import type { MaybePromise } from "@tb-dev/utils";
99
import { useChatInput } from "@/composables/chat/useChatInput";

0 commit comments

Comments
 (0)