Skip to content

feat: add i18n support with configurable language setting#62

Open
ozhangebesoglu wants to merge 1 commit intodavidfowl:mainfrom
ozhangebesoglu:feature/i18n-v2
Open

feat: add i18n support with configurable language setting#62
ozhangebesoglu wants to merge 1 commit intodavidfowl:mainfrom
ozhangebesoglu:feature/i18n-v2

Conversation

@ozhangebesoglu
Copy link

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 Turkish

Modified Files

  • src/tally/report.py - Load i18n.js, pass language to spending data
  • src/tally/commands/run.py - Read language from config
  • src/tally/spending_report.html - Use t() function for all UI strings
  • src/tally/spending_report.js - Add i18n helpers, update formatCurrency/formatDate
  • config/settings.yaml.example - Document language setting

Usage

Add to settings.yaml:

language: tr  # Turkish UI

Default is English (en).

What's Translated

  • Report title and header
  • Theme toggle tooltips
  • Search placeholder and filter labels
  • Help section content
  • Summary cards (Total Spending, Cash Flow, Credits, Excluded)
  • Chart titles
  • View toggle buttons
  • Table headers (Merchant, Category, Count, Tags, Total, etc.)
  • Popup content (Why This Matched, Transaction Details)
  • Footer

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.

- 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.
@github-actions
Copy link

github-actions bot commented Jan 2, 2026

PR Build Available

Version: 0.0.62-01fe29f

Install from this PR

Linux / macOS:

curl -fsSL https://raw.githubusercontent.com/davidfowl/tally/main/docs/install-pr.sh | bash -s -- 62

Windows PowerShell:

iex "& { $(irm https://raw.githubusercontent.com/davidfowl/tally/main/docs/install-pr.ps1) } 62"

Manual download: View workflow run and download artifacts.

Requirements
  • GitHub CLI (gh) must be installed and authenticated
  • Run gh auth login if not already authenticated

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