wayvr: Fix default locale fallback not working properly (regression caused by PR #411)

This commit is contained in:
Aleksander 2026-03-31 21:02:44 +02:00
parent 89f43b95ef
commit 5420efa4d3
7 changed files with 5 additions and 14 deletions

View File

@ -154,4 +154,4 @@
</div>
</div>
</elements>
</layout>
</layout>

View File

@ -83,9 +83,6 @@ impl PlayspaceMover {
let offset = (space_transform.transform_vector3a(app.input_state.hmd.translation)
- app.input_state.hmd.translation)
* -1.0;
let mut overlay_transform = Affine3A::from_rotation_y(-rel_y);
overlay_transform.translation = offset;
space_transform.translation = offset;
data.pose *= space_transform;

View File

@ -174,7 +174,7 @@ fn find_translation<'a>(translation: &str, mut val: &'a serde_json::Value) -> Op
impl I18n {
pub fn new(asset_provider: &mut dyn AssetProvider, lang_provider: &dyn LangProvider) -> anyhow::Result<Self> {
let locale = Locale::from_env(lang_provider);
log::info!("Guessed system language: {locale}");
log::info!("Guessed system language: {locale} (matched: {})", locale.get_matched());
let data_english = asset_provider.load_from_path("lang/en.json")?;
let path = format!("lang/{}.json", locale.get_matched());

View File

@ -252,7 +252,7 @@ impl ParserState {
Ok(ctx.data_local)
}
/// Instantinate template by saving all the results into the main `ParserState`
/// Instantiate template by saving all the results into the main `ParserState`
pub fn instantiate_template(
&mut self,
doc_params: &ParseDocumentParams,

View File

@ -60,10 +60,7 @@ pub fn parse_widget_image<'a>(
if let Some(glyph) = glyph {
params.glyph_data = Some(glyph);
} else {
ctx.print_missing_attrib(tag_name, "src");
}
let (widget, _) = ctx.layout.add_child(parent_id, WidgetImage::create(params), style)?;
parse_widget_universal(ctx, &widget, attribs, tag_name);

View File

@ -51,10 +51,7 @@ pub fn parse_widget_sprite<'a>(
if let Some(glyph) = glyph {
params.glyph_data = Some(glyph);
} else {
ctx.print_missing_attrib(tag_name, "src");
}
let (widget, _) = ctx.layout.add_child(parent_id, WidgetSprite::create(params), style)?;
parse_widget_universal(ctx, &widget, attribs, tag_name);

View File

@ -9,7 +9,7 @@ use crate::config::GeneralConfig;
pub enum Language {
#[strum(props(Text = "English"))]
English,
#[strum(props(Text = "English(UK)"))]
#[strum(props(Text = "English (UK)"))]
British,
#[strum(props(Text = "Polski"))]
Polish,
@ -28,7 +28,7 @@ pub enum Language {
impl Language {
pub const fn code(&self) -> &'static str {
match self {
Language::English => "en_US",
Language::English => "en",
Language::British => "en_GB",
Language::Polish => "pl_PL",
Language::Japanese => "ja_JP",