Skip to content

i18n: translation support for command palete - #11641

Merged
mitchellh merged 3 commits into
ghostty-org:mainfrom
EriksRemess:i18n-command-palette
Aug 4, 2026
Merged

mitchellh merged 3 commits into
ghostty-org:mainfrom
EriksRemess:i18n-command-palette

Conversation

@EriksRemess

Copy link
Copy Markdown
Member

Most obvious next step in translating Ghostty is the command palette.
Added support for i18n.N_ (https://docs.gtk.org/glib/i18n.html#macros).
Made a Latvian translation for the command palette to test. Codex did bulk of the translations but I verified them.

@mitchellh mitchellh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely want more reviewers, but this in general makes sense. I made one note.

Comment thread src/os/i18n.zig
@mitchellh mitchellh added this to the 1.4.0 milestone Mar 19, 2026
@00-kat 00-kat added translations Translations of the Ghostty app gtk Issues exclusive to GTK which are not OS-specific and removed gtk Issues exclusive to GTK which are not OS-specific labels Mar 19, 2026
@00-kat

00-kat commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

It would be nice if Latvian translation updates were done in a separate future PR, since that requires a review from a completely different set of people as the rest of the code and is orthogonal to this PR.

@00-kat

00-kat commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Also, I'm not sure how it's done but I believe you need to update all the other translation files to have the untranslated strings placed in them; other PRs that added translations (e.g. #9976) have done so.

@EriksRemess

Copy link
Copy Markdown
Member Author

Ok, I'll remove Latvian translation for now. Should I also remove .pot? That is also generated by the same zig build update-translations.

@00-kat

00-kat commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Definitely keep the .pot changes, having empty strings for the translations is fine; reviewing the translated text themselves is what's problematic (since most maintainers can't review that, so we need to ping the respective localization team).

@00-kat

00-kat commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

I believe you need to update all the other translation files to have the untranslated strings placed in them

zig build update-translations

It looks like update-translations itself should do that:

inline for (locales) |locale| {
const msgmerge = b.addSystemCommand(&.{ "msgmerge", "--quiet", "--no-fuzzy-matching" });
msgmerge.addFileArg(b.path("po/" ++ locale ++ ".po"));
msgmerge.addFileArg(xgettext_merge.captureStdOut());
usf.addCopyFileToSource(msgmerge.captureStdOut(), "po/" ++ locale ++ ".po");
}

If it changed every single translation file to add untranslated strings, you should probably git add that.

@EriksRemess

Copy link
Copy Markdown
Member Author

I guess, test should be retried https://github.com/ghostty-org/ghostty/actions/runs/23306874737/job/67784178019?pr=11641

@00-kat

00-kat commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Thanks!

test should be retried

Done.

@EriksRemess
EriksRemess requested a review from mitchellh March 20, 2026 17:55
@trag1c

trag1c commented Aug 1, 2026

Copy link
Copy Markdown
Member

@EriksRemess Could you rebase? We're looking to merge this before the v1.4 string freeze :)

Copilot AI lite review requested due to automatic review settings August 4, 2026 08:10
@EriksRemess
EriksRemess force-pushed the i18n-command-palette branch from 13ba95f to e0744dd Compare August 4, 2026 08:10
@EriksRemess
EriksRemess requested a review from a team as a code owner August 4, 2026 08:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@mitchellh
mitchellh merged commit 363e6e6 into ghostty-org:main Aug 4, 2026
99 checks passed
@clason

clason commented Aug 4, 2026 •

Copy link
Copy Markdown

Is this something that can be controlled? Because I don't want to be at the mercy of my locale for the command palette muscle memory...

(To be clear, my UI language is set to English, different from the locale. So now the command palette and nothing else is in a different -- undesired -- language...)

@jcollie

jcollie commented Aug 4, 2026

Copy link
Copy Markdown
Member

Is this something that can be controlled? Because I don't want to be at the mercy of my locale for the command palette muscle memory...

Controlled how? Are you searching for a specific English word in the command palette that wouldn't be there if the command palette was localized?

@clason

clason commented Aug 4, 2026 •

Copy link
Copy Markdown
Screenshot 2026-08-04 at 23 20 46

This is how it looks like. u is now a shortcut for "quit", not "update". I would like to force everything to English, at pretty much any cost.

@jcollie

jcollie commented Aug 4, 2026

Copy link
Copy Markdown
Member

This is how it looks like. u is now a shortcut for "quit", not "update". I would like to force everything to English, at pretty much any cost.

Set language = en in your config and it will force Ghostty (and only Ghostty) to use English.

@clason

clason commented Aug 4, 2026 •

Copy link
Copy Markdown

But I am already forcing everything at system level to English, which Ghostty doesn't (fully) respect...

(Sorry, I should make clear that this is on macOS, where interface language and other locale (e.g., date or currency) settings can be set independently. Platform matters here, of course.)

@00-kat

00-kat commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Force everything in Ghostty? https://ghostty.org/docs/config/reference#language

It's not currently possible to only change it for the command palette though.

Edit:

which Ghostty doesn't (fully) respect

That sounds wrong though… maybe it might be worth opening a discussion on that if you care to.

@jcollie

jcollie commented Aug 4, 2026

Copy link
Copy Markdown
Member

(Sorry, I should make clear that this is on macOS. Platform matters here, of course.)

Oh, ah, hm. That does appear to be a regression. We haven't formally started translating the macOS app. The command palette is the first crossplatform code that has had translation added and seems we need to figure that out.

@clason

clason commented Aug 4, 2026

Copy link
Copy Markdown

Set language = en in your config and it will force Ghostty (and only Ghostty) to use English.

Sorry, but that makes no difference.

@jcollie

jcollie commented Aug 4, 2026

Copy link
Copy Markdown
Member

Set language = en in your config and it will force Ghostty (and only Ghostty) to use English.

Sorry, but that makes no difference.

Yeah, that's really a GTK-only config.

@clason

clason commented Aug 4, 2026

Copy link
Copy Markdown

So maybe this feature can be made GTK-only for now?

@jcollie

jcollie commented Aug 4, 2026

Copy link
Copy Markdown
Member

So maybe this feature can be made GTK-only for now?

We'll need to figure out the best way to handle this. Not sure what the best solution will be.

@trag1c trag1c mentioned this pull request Aug 12, 2026
@EriksRemess
EriksRemess deleted the i18n-command-palette branch August 13, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

translations Translations of the Ghostty app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants