diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:02:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:02:01 +0000 |
commit | 088c0cefd0f8b5482cc227955cc3057d47ec24b6 (patch) | |
tree | 05f2021c7dd804334bcb781bb0c4881e971cd8fe /toolkit/crashreporter/client/app/src/lang/omnijar.rs | |
parent | Adding debian version 126.0-1. (diff) | |
download | firefox-088c0cefd0f8b5482cc227955cc3057d47ec24b6.tar.xz firefox-088c0cefd0f8b5482cc227955cc3057d47ec24b6.zip |
Merging upstream version 126.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/crashreporter/client/app/src/lang/omnijar.rs')
-rw-r--r-- | toolkit/crashreporter/client/app/src/lang/omnijar.rs | 23 |
1 files changed, 15 insertions, 8 deletions
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<LanguageInfo> { - 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<LanguageInfo> { 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 |