Skip to content

Feature: translations, configurable casing, and search box alignment#1

Open
Piero-93 wants to merge 1 commit into
calico32:mainfrom
Piero-93:feature/translations
Open

Feature: translations, configurable casing, and search box alignment#1
Piero-93 wants to merge 1 commit into
calico32:mainfrom
Piero-93:feature/translations

Conversation

@Piero-93

Copy link
Copy Markdown

Summary

Adds internationalization (i18n) and two appearance options to nirilayout.

  • Translations — all interface text is now localizable through gettext (.po/.mo, via leonelquinteros/gotext), with catalogs embedded into the binary via go:embed. English is the source language; Italian is included as the first translation.
  • Language selection — chosen automatically, with this precedence:
    1. the -lang flag (e.g. -lang it) overrides everything;
    2. otherwise the OS locale, from LC_ALLLC_MESSAGESLANG (it_IT.UTF-8 is matched to its base language it);
    3. otherwise English.
  • Casing — interface text now uses standard sentence casing. The new -lowercase flag renders all of nirilayout's own text in lowercase. It only affects nirilayout's interface — your layout and output names are shown exactly as written.
  • Search box alignment — the new -leftalign flag left-aligns the search box text (centered by default).

Command-line options added

Option Description
-lang <code> Interface language code (e.g. it); overrides the locale
-lowercase Render nirilayout's interface text in lowercase
-leftalign Left-align the text in the search box

For maintainers

Compiled .mo files are committed and embedded, so building or running nirilayout never requires gettext tooling — only editing translations does.
New Makefile targets:

  • make pot — regenerate the .pot template from the sources
  • make update-po — merge the template into existing .po files
  • make i18n — refresh .po files and recompile .mo

Adding a language is documented in the README (Localization → Adding a translation).

Docs

README gains Command-line options, Appearance (Casing and Search box alignment), and Localization sections, plus a contributor guide for translations.

Testing

  • go vet ./... — clean
  • go test ./... — passing (i18n_test.go covers language normalization, English fallback, -lowercase, and the Italian catalog)
  • Verified --help end to end in English and Italian, and -lowercase

…sing and input box alignment.

  - i18n via gettext .po/.mo (leonelquinteros/gotext), catalogs embedded with go:embed. English is the source language; Italian (it) added.
  - Language selection precedence: -lang flag > OS locale (LC_ALL/LC_MESSAGES/LANG) > English fallback. Locales like it_IT.UTF-8 are matched to their base language.
  - Interface strings now use standard sentence casing; the new -lowercase flag forces all of nirilayout's own text to lowercase. User-defined layout and output names are never altered.
  - New -leftalign flag left-aligns the search box text (default centered).
  - Makefile targets (pot/update-po/i18n) to maintain translations; compiled .mo files are committed so building needs no gettext tooling.
  - Updated README.md
@Piero-93 Piero-93 changed the title feature: translations, configurable casing, and search box alignment Feature: translations, configurable casing, and search box alignment Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant