feat: add multi-language (i18n) support with Japanese UI
This commit is contained in:
1 parent
fc8b71956c
commit
3afd6ae447
11 files changed
+647
-80
No files matched your search
@@ -27,11 +27,13 @@ pub mod dialogs_surface;
|
||||
pub mod dim_view;
|
||||
pub mod documents;
|
||||
pub mod drag_snap;
|
||||
pub mod fonts;
|
||||
pub mod frame;
|
||||
pub mod gizmo;
|
||||
pub mod gpu;
|
||||
pub mod help;
|
||||
pub mod home;
|
||||
pub mod i18n;
|
||||
pub mod icons;
|
||||
pub mod inference;
|
||||
pub mod keymap;
|
||||
@@ -288,6 +290,11 @@ impl SolveApp {
|
||||
}
|
||||
}
|
||||
|
||||
/// Translate text using the active language preference.
|
||||
pub fn tr<'a>(&self, text: &'a str) -> &'a str {
|
||||
i18n::tr_for_lang(&self.preferences.language, text)
|
||||
}
|
||||
|
||||
/// Draw the viewport on the GPU (eframe's wgpu render state, with the app's depth and
|
||||
/// stencil buffer bits and MSAA sample count). Without it the viewport renders on the CPU.
|
||||
pub fn set_wgpu(&mut self, rs: &egui_wgpu::RenderState, depth_bits: u8, stencil_bits: u8, samples: u32) {
|
||||
@@ -813,6 +820,7 @@ impl SolveApp {
|
||||
/// Lay out the whole window.
|
||||
pub fn ui(&mut self, ui: &mut egui::Ui) {
|
||||
let t0 = now_ms();
|
||||
crate::i18n::set_current_lang(&self.preferences.language);
|
||||
scenario::clear_handles();
|
||||
toolbar::app_bar(self, ui);
|
||||
file_load::show(self, ui.ctx());
|
||||
|
||||
Reference in new issue
Block a user