Skip to content

Commit

Permalink
Simplify locale generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaizombie1 committed Jan 23, 2025
1 parent 3567719 commit 13ae870
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@
gsettings-desktop-schemas
];


env = { OPENSSL_NO_VENDOR = 1; };

postInstall = ''
mkdir -p $out/share/glib-2.0/schemas && cp org.Waytrogen.Waytrogen.gschema.xml $out/share/glib-2.0/schemas/
glib-compile-schemas $out/share/glib-2.0/schemas
mkdir -p $out/share/locale/en/LC_MESSAGES && msgfmt locales/en/LC_MESSAGES/waytrogen.po -o waytrogen.mo && cp locales/en/LC_MESSAGES/waytrogen.mo $out/share/locale/en/LC_MESSAGES
mkdir -p $out/share/locale/es/LC_MESSAGES && msgfmt locales/es/LC_MESSAGES/waytrogen.po -o waytrogen.mo && cp locales/es/LC_MESSAGES/waytrogen.mo $out/share/locale/es/LC_MESSAGES
while IFS= read -r lang; do
mkdir -p $out/share/locale/$lang/LC_MESSAGES && msgfmt locales/$lang/LC_MESSAGES/waytrogen.po -o locales/$lang/LC_MESSAGES/waytrogen.mo && cp locales/$lang/LC_MESSAGES/waytrogen.mo $out/share/locale/$lang/LC_MESSAGES
done < locales/LINGUAS
mkdir -p $out/share/applications && cp waytrogen.desktop $out/share/applications/
mkdir -p $out/share/icons/hicolor/scalable/apps && cp README-Assets/WaytrogenLogo.svg $out/share/icons/hicolor/scalable/apps/waytrogen.svg
'';
Expand All @@ -52,6 +54,7 @@

devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
glibcLocales
pkg-config
glib
wrapGAppsHook4
Expand All @@ -71,6 +74,8 @@
];

env = { OPENSSL_NO_VENDOR = 1; };

LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
};
});
}
2 changes: 1 addition & 1 deletion locales/LINGUAS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
en
es
es
2 changes: 1 addition & 1 deletion locales/es/LC_MESSAGES/waytrogen.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ msgstr ""
"PO-Revision-Date: 2025-01-08 18:00+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: es_PR\n"
"Language: es_ES\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down

0 comments on commit 13ae870

Please sign in to comment.