i18n: Localize Nautilus .py script

This commit is contained in:
David Matos
2025-12-15 10:58:27 +01:00
parent e2be65da8e
commit 35779be65d
28 changed files with 4886 additions and 4560 deletions

View File

@@ -62,8 +62,10 @@ pub fn addStepDependencies(
fn createUpdateStep(b: *std.Build) !*std.Build.Step {
const xgettext = b.addSystemCommand(&.{
// We do not specify specific language since we
// currently need to support `blp` and `python`
// for localization
"xgettext",
"--language=C", // Silence the "unknown extension" errors
"--from-code=UTF-8",
"--add-comments=Translators",
"--keyword=_",
@@ -74,6 +76,8 @@ fn createUpdateStep(b: *std.Build) !*std.Build.Step {
"-o",
"-",
});
// Silences the "unknown extension" errors
_ = xgettext.captureStdErr();
// Not cacheable due to the gresource files
xgettext.has_side_effects = true;
@@ -92,6 +96,11 @@ fn createUpdateStep(b: *std.Build) !*std.Build.Step {
xgettext.addFileInput(b.path(path));
}
// Add suport for localizing our `nautilus` integration
const nautilus_script_path = "dist/linux/ghostty_nautilus.py";
xgettext.addArg(nautilus_script_path);
xgettext.addFileInput(b.path(nautilus_script_path));
{
// Iterate over all of the files underneath `src/apprt/gtk`. We store
// them in an array so that they can be sorted into a determininistic