diff --git a/core/embed/rust/src/translations/generated/translated_string.rs.mako b/core/embed/rust/src/translations/generated/translated_string.rs.mako index 3147724698..9ecc94fbcf 100644 --- a/core/embed/rust/src/translations/generated/translated_string.rs.mako +++ b/core/embed/rust/src/translations/generated/translated_string.rs.mako @@ -5,6 +5,7 @@ #![cfg_attr(rustfmt, rustfmt_skip)] <% import json +import re ALTCOIN_PREFIXES = ( "binance", @@ -55,7 +56,7 @@ impl TranslatedString { %if any(name.startswith(prefix + "__") for prefix in ALTCOIN_PREFIXES): #[cfg(feature = "universal_fw")] %endif - Self::${name} => ${json.dumps(en_data.get(name, '""'))}, + Self::${name} => ${re.sub(r'\\u([0-9a-f]{4})', r'\\u{\g<1>}', json.dumps(en_data.get(name, '""')))}, % endfor } } diff --git a/core/embed/rust/src/ui/display/font.rs b/core/embed/rust/src/ui/display/font.rs index 2814f7fa38..fd410a43bf 100644 --- a/core/embed/rust/src/ui/display/font.rs +++ b/core/embed/rust/src/ui/display/font.rs @@ -285,6 +285,12 @@ impl Font { } pub fn get_glyph(self, ch: char) -> Glyph { + /* have the non-breaking space counted for width but not counted as a + * breaking point */ + let ch = match ch { + '\u{00a0}' => '\u{0020}', + c => c, + }; let gl_data = display::get_char_glyph(ch as u16, self.into()); ensure!(!gl_data.is_null(), "Failed to load glyph"); diff --git a/tests/translations.py b/tests/translations.py index 3be33e88e8..48e0ca9a38 100644 --- a/tests/translations.py +++ b/tests/translations.py @@ -107,7 +107,7 @@ def _resolve_path_to_texts( if lower: texts = [t.lower() for t in texts] - texts = [t.strip() for t in texts] + texts = [t.replace("\xa0", " ").strip() for t in texts] return texts