feat: add i18n support with configurable language setting#62
Open
ozhangebesoglu wants to merge 1 commit intodavidfowl:mainfrom
Open
feat: add i18n support with configurable language setting#62ozhangebesoglu wants to merge 1 commit intodavidfowl:mainfrom
ozhangebesoglu wants to merge 1 commit intodavidfowl:mainfrom
Conversation
- Add i18n.js with English and Turkish translations - Add language parameter to settings.yaml (default: en) - Update spending_report.html to use t() function for all UI strings - Update spending_report.js with i18n helpers (t, getMonthShort, formatCurrency) - Update report.py to load i18n.js and pass language to spending data - Update run.py to read language from config Supports dynamic language switching via config file: language: tr # Turkish UI Translations include: UI labels, help text, summary cards, chart titles, table headers, popup content, and footer.
PR Build AvailableVersion: Install from this PRLinux / macOS: curl -fsSL https://raw.githubusercontent.com/davidfowl/tally/main/docs/install-pr.sh | bash -s -- 62Windows PowerShell: iex "& { $(irm https://raw.githubusercontent.com/davidfowl/tally/main/docs/install-pr.ps1) } 62"Manual download: View workflow run and download artifacts. Requirements
|
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
This PR adds internationalization (i18n) support to the spending report, allowing users to configure the UI language via
settings.yaml. Currently supports English (default) and Turkish.Changes
New Files
src/tally/i18n.js- Translations and formatting helpers for English and TurkishModified Files
src/tally/report.py- Load i18n.js, pass language to spending datasrc/tally/commands/run.py- Read language from configsrc/tally/spending_report.html- Uset()function for all UI stringssrc/tally/spending_report.js- Add i18n helpers, update formatCurrency/formatDateconfig/settings.yaml.example- Document language settingUsage
Add to
settings.yaml:Default is English (
en).What's Translated
Size Impact
The i18n.js file adds ~285 lines (~8KB unminified). Translations are loaded once and cached. No external dependencies added.
Testing
All existing tests pass (679 passed, 51 skipped for Playwright).
Related
Implements the configurable language feature requested in PR #54 feedback.