feat(web): unify fonts and refine viewcube
Preload one language-aware font resource across the interface, drawing text, and navigation labels.\n\nRender the navigation cube, ring, outlines, and labels through a 4x MSAA target.
This commit is contained in:
parent
8dc642d40c
commit
53cf31f33d
26 changed files with 1337 additions and 522 deletions
11
src/i18n.rs
11
src/i18n.rs
|
|
@ -122,6 +122,7 @@ fn load_language(
|
|||
if requested.is_empty() {
|
||||
requested.push(loader.fallback_language().clone());
|
||||
}
|
||||
#[allow(unused_variables)]
|
||||
let selected = i18n_embed::select(loader, &Localizations, &requested)?;
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
if let Some(language) = selected.first() {
|
||||
|
|
@ -155,6 +156,16 @@ pub fn set_language(language: Language) -> Result<(), i18n_embed::I18nEmbedError
|
|||
load_language(loader(), language)
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
pub fn active_language_tag() -> String {
|
||||
loader()
|
||||
.current_languages()
|
||||
.into_iter()
|
||||
.next()
|
||||
.unwrap_or_else(|| loader().fallback_language().clone())
|
||||
.to_string()
|
||||
}
|
||||
|
||||
/// Translate an application-facing source label from the complete UI catalog.
|
||||
///
|
||||
/// Stable semantic ids remain preferable for new code. This compatibility
|
||||
|
|
|
|||
Loading…
Reference in a new issue