Skip to content

Commit 56611f0

Browse files
committed
fix: add missing param localizations
1 parent 0632d26 commit 56611f0

File tree

9 files changed

+39
-21
lines changed

9 files changed

+39
-21
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ thiserror = "1"
4141
tracing = "0.1"
4242
tracing-subscriber = "0.3"
4343
tower = "0.4.13"
44-
regex = "1.9.1"
4544

4645
[workspace.dependencies.axum]
4746
version = "0.6"

locale/bg.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ skyblock-equipment = equipment
339339
.username = потребителско-име
340340
.username-description = Minecraft потребителско име
341341
.uuid = uuid
342+
.uuid-description = Minecraft UUID
343+
.profile = профил
344+
.profile-description = Профилът за преглед
342345
343346
skyblock-wardrobe = гардероб
344347
.description = Преглед на гардероба на SkyBlock

locale/hu.ftl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,6 +2024,10 @@ uhc-project = projekt
20242024
.uuid-description = Minecraft UUID
20252025
.mode = mód
20262026
.mode-description = Az UHC Champions módot, amit szeretne megtekinteni
2027+
.kind = statisztika
2028+
.kind-description = A megjelenítendő UHC Champions statisztika
2029+
.value = érték
2030+
.value-description = A statisztikához tartozó érték
20272031
20282032
uhc-daily = napi
20292033
.description = Tekintse meg az UHC Champions statisztikák alakulását az elmúlt nap alatt
@@ -2263,6 +2267,10 @@ warlords-project = projekt
22632267
.uuid-description = Minecraft azonosító
22642268
.mode = mód
22652269
.mode-description = A megtekinteni kívánt Warlords mód
2270+
.kind = statisztika
2271+
.kind-description = A Warlords statisztika, amit szeretne projektálni
2272+
.value = érték
2273+
.value-description = Az érték, amit a statisztikához szeretne hozzárendelni
22662274
22672275
warlords-daily = napi
22682276
.description = Nézd meg a Warlords statisztikák fejlődését az elmúlt nap alatt

locale/ko.ftl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,6 +2025,10 @@ uhc-project = 프로젝트
20252025
.uuid-description = Minecraft UUID
20262026
.mode = 모드
20272027
.mode-description = 볼 UHC Champions 모드
2028+
.kind = 통계
2029+
.kind-description = 예측할 UHC Champions 통계
2030+
.value =
2031+
.value-description = 예측할 통계값
20282032
20292033
uhc-daily = 일일
20302034
.description = 지난 하루 동안의 UHC Champions 통계 보기
@@ -2264,6 +2268,10 @@ warlords-project = 프로젝트
22642268
.uuid-description = Minecraft UUID
22652269
.mode = 모드
22662270
.mode-description = 보고 싶은 Warlords 모드
2271+
.kind = 통계
2272+
.kind-description = 예측할 Warlords 통계
2273+
.value =
2274+
.value-description = 예측할 통계값
22672275
22682276
warlords-daily = 일일
22692277
.description = 지난 하루 동안의 Warlords 통계 보기

locale/th.ftl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,8 @@ copsandcrims-weekly = สัปดาห์ล่าสุด
10601060
.username-description = ชื่อผู้เล่น Minecraft
10611061
.uuid = uuid
10621062
.uuid-description = UUID Minecraft
1063+
.mode = โหมด
1064+
.mode-description = โหมดของ Cops and Crims ที่ต้องการดู
10631065
10641066
copsandcrims-monthly = เดือนล่าสุด
10651067
.description = ดูการพัฒนาสถิติ Cops and Crims ในช่วงเดือนที่ผ่านมา

statpixel/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ tracing.workspace = true
4646
tracing-subscriber.workspace = true
4747
uuid.workspace = true
4848
humantime.workspace = true
49-
serde_json.workspace = true
5049

5150
[dev-dependencies]
5251
criterion = "0.5"

translate/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,3 @@ tracing.workspace = true
2323
uuid.workspace = true
2424
tokio.workspace = true
2525
humantime.workspace = true
26-
regex.workspace = true
27-
once_cell.workspace = true

translate/src/locale.rs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use core::panic;
55
use std::{borrow::Cow, fmt::Debug, str::FromStr};
66

77
use crate::{prelude::GetLocale, Data, Error};
8-
use once_cell::sync::Lazy;
8+
// use once_cell::sync::Lazy;
99
use tracing::warn;
1010

1111
type Bundle = fluent::bundle::FluentBundle<
@@ -15,8 +15,8 @@ type Bundle = fluent::bundle::FluentBundle<
1515

1616
pub struct English<'c>(&'c Data);
1717

18-
static NAME_REGEX: Lazy<regex::Regex> =
19-
Lazy::new(|| regex::Regex::new(r"^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$").unwrap());
18+
// static NAME_REGEX: Lazy<regex::Regex> =
19+
// Lazy::new(|| regex::Regex::new(r"^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$").unwrap());
2020

2121
impl GetLocale for English<'_> {
2222
fn data(&self) -> &crate::Data {
@@ -195,13 +195,13 @@ impl Locale {
195195
}
196196
};
197197

198-
if !NAME_REGEX.is_match(&localized_command_name) {
198+
/*if !NAME_REGEX.is_match(&localized_command_name) {
199199
panic!(
200200
"invalid localized command name `{}` in {}",
201201
localized_command_name,
202202
locale.as_str(),
203203
);
204-
}
204+
}*/
205205

206206
command
207207
.name_localizations
@@ -225,22 +225,24 @@ impl Locale {
225225
let name = format(bundle, &command_name, Some(&parameter.name), None);
226226

227227
if let Some(name) = name {
228-
if !NAME_REGEX.is_match(&name) {
228+
/*if !NAME_REGEX.is_match(&name) {
229229
panic!(
230-
"invalid localized parameter name `{}` in {}",
230+
"invalid localized parameter name `{}` in {} for command `{}`",
231231
name,
232232
locale.as_str(),
233+
command_name
233234
);
234-
}
235+
}*/
235236

236237
parameter
237238
.name_localizations
238239
.insert(locale.as_str().to_string(), name);
239240
} else {
240241
warn!(
241-
"missing parameter name localization for `{}` in {}",
242+
"missing parameter name localization for `{}` in {} for command `{}`",
242243
parameter.name,
243-
locale.as_str()
244+
locale.as_str(),
245+
command_name
244246
);
245247

246248
continue;
@@ -259,9 +261,10 @@ impl Locale {
259261
.insert(locale.as_str().to_string(), description);
260262
} else {
261263
warn!(
262-
"missing parameter description localization for `{}` in {}",
264+
"missing parameter description localization for `{}` in {} for command `{}`",
263265
parameter.name,
264-
locale.as_str()
266+
locale.as_str(),
267+
command_name
265268
);
266269
}
267270

@@ -275,9 +278,10 @@ impl Locale {
275278
.insert(locale.as_str().to_string(), name);
276279
} else {
277280
warn!(
278-
"missing choice name localization for `{}` in {}",
281+
"missing choice name localization for `{}` in {} for command `{}`",
279282
choice.name,
280-
locale.as_str()
283+
locale.as_str(),
284+
command_name
281285
);
282286
}
283287
}

0 commit comments

Comments
 (0)