Skip to content

Commit

Permalink
Merge pull request #149 from blissd/i18n_dir
Browse files Browse the repository at this point in the history
Move i18n files to be under share/fotema
  • Loading branch information
blissd authored Aug 11, 2024
2 parents 445c0ef + 3fd0e66 commit 88fe848
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ 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'
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()
Expand Down
8 changes: 4 additions & 4 deletions src/languages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ macro_rules! fl {
}

pub fn loader() -> Result<FluentLanguageLoader, I18nEmbedError> {
info!("I18NDIR = {:?}", I18NDIR);

// Get user's preferred languages from OS.
let requested_languages = DesktopLanguageRequester::requested_languages();
info!("Requested languages: {:?}", requested_languages);
Expand All @@ -45,10 +47,8 @@ pub fn loader() -> Result<FluentLanguageLoader, I18nEmbedError> {
"de", "en-US", "fi", "fr", "hi", "id", "it", "nb-NO", "nl", "ru", "tr",
];

let all_languages: Vec<LanguageIdentifier> = all_languages
.into_iter()
.map(|id| id.parse().unwrap())
.collect();
let all_languages: Vec<LanguageIdentifier> =
all_languages.iter().map(|id| id.parse().unwrap()).collect();

let i18n_assets = i18n_embed::FileSystemAssets::try_new(PathBuf::from(I18NDIR))?;

Expand Down

0 comments on commit 88fe848

Please sign in to comment.