diff --git a/meson.build b/meson.build index aaf52d9e..2d769e7f 100644 --- a/meson.build +++ b/meson.build @@ -31,13 +31,6 @@ prefix = get_option('prefix') bindir = prefix / get_option('bindir') localedir = prefix / get_option('localedir') -# Why don't we use localdir? Using localdir works perfectly when -# developing locally. However, the Flathub build servers put locale files -# into separate flatpak packages which is breaking my Fluent localisation -# setup. Fotema will fail starting up saying it canot find the localisation -# files. -i18ndir = prefix / 'i18n' - datadir = prefix / get_option('datadir') pkgdatadir = datadir / meson.project_name() iconsdir = datadir / 'icons' @@ -45,6 +38,13 @@ podir = meson.project_source_root() / 'po' gettext_package = meson.project_name() libdir = prefix / 'lib' +# Why don't we use localedir? Using localedir works perfectly when +# developing locally. However, the Flathub build servers put locale files +# into separate flatpak packages which is breaking my Fluent localisation +# setup. Fotema will fail starting up saying it cannot find the localisation +# files. +i18ndir = pkgdatadir / 'i18n' + if get_option('profile') == 'development' profile = 'Devel' vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip() diff --git a/src/languages.rs b/src/languages.rs index 49585d7b..7945e182 100644 --- a/src/languages.rs +++ b/src/languages.rs @@ -35,6 +35,8 @@ macro_rules! fl { } pub fn loader() -> Result { + info!("I18NDIR = {:?}", I18NDIR); + // Get user's preferred languages from OS. let requested_languages = DesktopLanguageRequester::requested_languages(); info!("Requested languages: {:?}", requested_languages); @@ -45,10 +47,8 @@ pub fn loader() -> Result { "de", "en-US", "fi", "fr", "hi", "id", "it", "nb-NO", "nl", "ru", "tr", ]; - let all_languages: Vec = all_languages - .into_iter() - .map(|id| id.parse().unwrap()) - .collect(); + let all_languages: Vec = + all_languages.iter().map(|id| id.parse().unwrap()).collect(); let i18n_assets = i18n_embed::FileSystemAssets::try_new(PathBuf::from(I18NDIR))?;