mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-19 13:08:14 +00:00
WIP - move translations to a top-level module
This commit is contained in:
parent
9b86d9a829
commit
2ac3da18f5
@ -28,6 +28,8 @@ mod storage;
|
|||||||
mod time;
|
mod time;
|
||||||
#[cfg(feature = "ui_debug")]
|
#[cfg(feature = "ui_debug")]
|
||||||
mod trace;
|
mod trace;
|
||||||
|
#[cfg(feature = "translations")]
|
||||||
|
pub mod translations;
|
||||||
|
|
||||||
#[cfg(feature = "ui")]
|
#[cfg(feature = "ui")]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
error::Error,
|
error::Error,
|
||||||
micropython::{
|
micropython::{
|
||||||
buffer::get_buffer,
|
buffer::{get_buffer, StrBuffer},
|
||||||
ffi,
|
ffi,
|
||||||
gc::Gc,
|
gc::Gc,
|
||||||
map::Map,
|
map::Map,
|
||||||
@ -13,7 +13,13 @@ use crate::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::TranslatedString;
|
use super::translated_string::TranslatedString;
|
||||||
|
|
||||||
|
pub fn tr(item: TranslatedString) -> StrBuffer {
|
||||||
|
// SAFETY:
|
||||||
|
let stored_translations = item.translate(unsafe { super::flash::get() });
|
||||||
|
StrBuffer::alloc(stored_translations)
|
||||||
|
}
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct TrObj {
|
pub struct TrObj {
|
@ -4,7 +4,9 @@ mod generated;
|
|||||||
mod micropython;
|
mod micropython;
|
||||||
mod translated_string;
|
mod translated_string;
|
||||||
|
|
||||||
pub use translated_string::TranslatedString;
|
pub use translated_string::TranslatedString as TR;
|
||||||
|
#[cfg(feature = "micropython")]
|
||||||
|
pub use micropython::tr;
|
||||||
|
|
||||||
use crate::{error::Error, io::InputStream};
|
use crate::{error::Error, io::InputStream};
|
||||||
use core::{ptr::null, str};
|
use core::{ptr::null, str};
|
@ -9,8 +9,6 @@ pub mod event;
|
|||||||
pub mod geometry;
|
pub mod geometry;
|
||||||
pub mod lerp;
|
pub mod lerp;
|
||||||
pub mod screens;
|
pub mod screens;
|
||||||
#[cfg(feature = "translations")]
|
|
||||||
pub mod translations;
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
pub mod util;
|
pub mod util;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user