Skip to content

Commit 50ecdbc

Browse files
committed
chore: remove translation string normalization
(now done on micro-connector side)
1 parent f729750 commit 50ecdbc

File tree

2 files changed

+2
-41
lines changed

2 files changed

+2
-41
lines changed

src/translations.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{state::GlobalState, structs::TranslationRecord, utils::normalize_polish_letters};
1+
use crate::{state::GlobalState, structs::TranslationRecord};
22
use alloc::{
33
string::{String, ToString},
44
vec::Vec,
@@ -62,7 +62,7 @@ pub fn process_locale(locale: String, records: Vec<TranslationRecord>) {
6262

6363
for record in records {
6464
if let Some(key) = TranslationKey::from_key_str(&record.key) {
65-
tmp_locale.translations[key] = Some(normalize_polish_letters(record.translation));
65+
tmp_locale.translations[key] = Some(record.translation);
6666
}
6767
}
6868
}

src/utils/mod.rs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use alloc::string::String;
2-
31
pub mod arc;
42
pub mod backtrace_store;
53
pub mod buttons;
@@ -96,40 +94,3 @@ fn esp32c3_rtc_apb_freq_update() {
9694
.store5()
9795
.modify(|_, w| unsafe { w.scratch5().bits(value) });
9896
}
99-
100-
pub fn normalize_polish_letters(input: String) -> String {
101-
let replacements = [
102-
('ą', 'a'),
103-
('ć', 'c'),
104-
('ę', 'e'),
105-
('ł', 'l'),
106-
('ń', 'n'),
107-
('ó', 'o'),
108-
('ś', 's'),
109-
('ź', 'z'),
110-
('ż', 'z'),
111-
('Ą', 'A'),
112-
('Ć', 'C'),
113-
('Ę', 'E'),
114-
('Ł', 'L'),
115-
('Ń', 'N'),
116-
('Ó', 'O'),
117-
('Ś', 'S'),
118-
('Ź', 'Z'),
119-
('Ż', 'Z'),
120-
];
121-
122-
let mut result = String::with_capacity(input.len());
123-
124-
for c in input.chars() {
125-
let replacement = replacements
126-
.iter()
127-
.find(|(polish, _)| *polish == c)
128-
.map(|(_, normal)| *normal)
129-
.unwrap_or(c);
130-
131-
result.push(replacement);
132-
}
133-
134-
result
135-
}

0 commit comments

Comments
 (0)