Feature: translations, configurable casing, and search box alignment#1
Open
Piero-93 wants to merge 1 commit into
Open
Feature: translations, configurable casing, and search box alignment#1Piero-93 wants to merge 1 commit into
Piero-93 wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds internationalization (i18n) and two appearance options to nirilayout.
.po/.mo, vialeonelquinteros/gotext), with catalogs embedded into the binary viago:embed. English is the source language; Italian is included as the first translation.-langflag (e.g.-lang it) overrides everything;LC_ALL→LC_MESSAGES→LANG(it_IT.UTF-8is matched to its base languageit);-lowercaseflag 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.-leftalignflag left-aligns the search box text (centered by default).Command-line options added
-lang <code>it); overrides the locale-lowercase-leftalignFor maintainers
Compiled
.mofiles are committed and embedded, so building or running nirilayout never requires gettext tooling — only editing translations does.New Makefile targets:
make pot— regenerate the.pottemplate from the sourcesmake update-po— merge the template into existing.pofilesmake i18n— refresh.pofiles and recompile.moAdding 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 ./...— cleango test ./...— passing (i18n_test.gocovers language normalization, English fallback,-lowercase, and the Italian catalog)--helpend to end in English and Italian, and-lowercase