From 088c0cefd0f8b5482cc227955cc3057d47ec24b6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:02:01 +0200 Subject: Merging upstream version 126.0.1. Signed-off-by: Daniel Baumann --- .../crashreporter/client/app/src/lang/omnijar.rs | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'toolkit/crashreporter/client/app/src/lang/omnijar.rs') diff --git a/toolkit/crashreporter/client/app/src/lang/omnijar.rs b/toolkit/crashreporter/client/app/src/lang/omnijar.rs index 2d2c34dd8d..b6a4e90aa4 100644 --- a/toolkit/crashreporter/client/app/src/lang/omnijar.rs +++ b/toolkit/crashreporter/client/app/src/lang/omnijar.rs @@ -3,8 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use super::language_info::LanguageInfo; +use crate::config::sibling_path; use crate::std::{ - env::current_exe, fs::File, io::{BufRead, BufReader, Read}, path::Path, @@ -16,9 +16,11 @@ use zip::read::ZipArchive; /// /// Returns (locale name, fluent definitions). pub fn read() -> anyhow::Result { - let mut path = current_exe().context("failed to get current executable")?; - path.pop(); - path.push("omni.ja"); + let mut path = sibling_path(if cfg!(target_os = "macos") { + "../Resources/omni.ja" + } else { + "omni.ja" + }); let mut zip = read_omnijar_file(&path)?; let locales = { @@ -52,11 +54,16 @@ pub fn read() -> anyhow::Result { path.push("omni.ja"); let ftl_branding = 'branding: { - for locale in &locales { - match read_branding(&locale, &mut zip) { - Ok(v) => break 'branding v, - Err(e) => log::warn!("failed to read branding from omnijar: {e:#}"), + match read_omnijar_file(&path) { + Ok(mut zip) => { + for locale in &locales { + match read_branding(&locale, &mut zip) { + Ok(v) => break 'branding v, + Err(e) => log::warn!("failed to read branding from omnijar: {e:#}"), + } + } } + Err(e) => log::warn!("failed to read browser omnijar: {e:#}"), } log::info!("using fallback branding info"); LanguageInfo::default().ftl_branding -- cgit v1.2.3