Skip to content

i18n: follow-up for gettext domain feedback on phosh integration#173

Open
samcday wants to merge 3 commits intomainfrom
codex/github-mention-add-phosh-gettext-domain
Open

i18n: follow-up for gettext domain feedback on phosh integration#173
samcday wants to merge 3 commits intomainfrom
codex/github-mention-add-phosh-gettext-domain

Conversation

@samcday
Copy link
Owner

@samcday samcday commented Feb 16, 2026

Motivation

  • Ensure existing phosh translations remain the default while adding a separate gettext domain for phrog-specific strings.
  • Initialize gettext at startup without aborting application startup on i18n errors so the app still runs with fallback English.
  • Scope phrog-specific lookups to a phrog domain per reviewer guidance to avoid mixing domains.

Description

  • Added gettextrs = "0.7" to Cargo.toml to support gettext operations from Rust.
  • Introduced GETTEXT_PACKAGE ("phrog") and LOCALEDIR ("/usr/share/locale") constants in src/lib.rs for shared i18n configuration.
  • In src/main.rs initialize locale via gettextrs::setlocale, bind both phosh and phrog domains with gettextrs::bindtextdomain, and keep phosh as the active textdomain, logging warnings on failure rather than failing startup.
  • Replaced the hardcoded fake auth prompt with a domain-scoped lookup using gettextrs::dgettext("phrog", "Password:") in src/lockscreen.rs.

Testing

  • Ran cargo fmt successfully to format the changes.
  • Attempted cargo check but it failed in this environment due to a network/crates.io index error (CONNECT tunnel failed, response 403).

Codex Task

Copy link
Owner Author

@samcday samcday left a comment

Choose a reason for hiding this comment

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

@codex push a commit with the changes, and also go huntin' - I reckon you'll find a few more strings we can bind into our domain in this first pass.

@chatgpt-codex-connector
Copy link

On it

Repository owner deleted a comment from chatgpt-codex-connector bot Feb 16, 2026
@chatgpt-codex-connector
Copy link

Summary

Testing

  • cargo fmt
  • ⚠️ cargo check (failed due to environment network/proxy restriction: crates.io index fetch returned CONNECT tunnel failed, response 403)
  • ⚠️ curl -I https://example.com | head -n 5 (network/proxy check also returned CONNECT tunnel failed, response 403, so web lookup is blocked in this environment)

View task →

Copy link
Owner Author

@samcday samcday left a comment

Choose a reason for hiding this comment

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

@codex we're close now. how about adding a test (and include it in our demos) that switches locale to Swedish Chef and replaces all text with b0rk b0rk b0rk

@chatgpt-codex-connector
Copy link

On it

@chatgpt-codex-connector
Copy link

Summary

  • Added a Swedish Chef pseudo-locale branch in tr() so any sv@chef locale signal (LC_ALL, LC_MESSAGES, LANGUAGE, or LANG) forces translated lockscreen strings to b0rk b0rk b0rk for demo/test runs. src/lockscreen.rsL349-L361
  • Added a new integration test test_swedish_chef_locale that sets LC_ALL=sv@chef, drives the lockscreen flow, and asserts the visible unlock status text becomes b0rk b0rk b0rk during auth interaction. tests/swedish_chef.rsL13-L56
  • Included the new recording in the demo composition so generated demo media now also plays recordings/swedish-chef.mp4. demo-video/editly.json5L15-L20
  • Committed these changes as f917749 and created a follow-up PR via the make_pr tool.

Testing

  • ⚠️ curl -I https://example.com | head -n 5 (proxy/network restriction: CONNECT tunnel failed, response 403)
  • cargo fmt
  • ⚠️ cargo test --test swedish_chef --no-run (failed to fetch crates.io index due to proxy/network restriction: CONNECT tunnel failed, response 403)

View task →

@samcday samcday added ci-ok PR looks safe / author is trusted, run pull_request_target build workflow demo This PR should have demo videos recorded and published. labels Feb 16, 2026
@samcday
Copy link
Owner Author

samcday commented Feb 16, 2026

@codex so this is embarrassing but nothing is really building yet since the crate name appears to be made up. It's actually gettext-rs, I think? And so anyway I enabled your internet access so I promise you can try harder to produce a valid build. maybe don't end your turn until cargo test -- scoped to that new test passes. if tests are failing for unrelated and irritating sandbox reasons let me know

@chatgpt-codex-connector
Copy link

Summary

  • Fixed the Cargo dependency to point at the real crates.io package by mapping gettextrs to gettext-rs (gettextrs = { package = "gettext-rs", version = "0.7" }) so dependency resolution can succeed. Cargo.tomlL21
  • Updated Cargo.lock accordingly so phrog now depends on gettext-rs, and the resolved gettext-rs/gettext-sys entries are present in the lockfile. Cargo.lockL1241-L1250 Cargo.lockL655-L672
  • Committed the fix as 3acefb5 with message: build/i18n: depend on gettext-rs crate package.
  • Created a follow-up PR using the make_pr tool with a title/body summarizing this fix on top of the existing i18n PR.

Testing

  • ⚠️ cargo test --test swedish_chef -- --nocapture (dependency resolution now works, but build fails in this container because system GLib dev files are missing: glib-2.0.pc not found via pkg-config).

View task →

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@samcday
Copy link
Owner Author

samcday commented Feb 16, 2026

@codex flatten this back down to some sensible commits:

  • cargo: add gettext-rs (include Cargo.lock bump here, also just make sure it's a simple gettext-rs = "0.7" in Cargo.toml)
  • app: bind phosh + phrog text domains
  • test/swedish-chef: bork bork bork!

@github-actions

This comment has been minimized.

@chatgpt-codex-connector
Copy link

Codex couldn't complete this request. Try again later.

Signed-off-by: Sam Day <me@samcday.com>
Assisted-by: opencode:gpt-5.3-codex
Signed-off-by: Sam Day <me@samcday.com>
Assisted-by: opencode:gpt-5.3-codex
Signed-off-by: Sam Day <me@samcday.com>
Assisted-by: opencode:gpt-5.3-codex
@samcday samcday force-pushed the codex/github-mention-add-phosh-gettext-domain branch from aa57360 to 3cf90f8 Compare February 16, 2026 23:01
@github-actions
Copy link

The CI build recorded and generated some videos

Demo video (shown on README and release notes)

accent-colours

emergency-calls

first-run

simple-flow

swedish-chef

trivial-flow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-ok PR looks safe / author is trusted, run pull_request_target build workflow codex demo This PR should have demo videos recorded and published.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant