Skip to content

feat: Add i18n support with configurable language#54

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

feat: Add i18n support with configurable language#54
ozhangebesoglu wants to merge 1 commit intodavidfowl:mainfrom
ozhangebesoglu:feature/i18n-language-support

Conversation

@ozhangebesoglu
Copy link

Summary

Adds internationalization (i18n) support for the HTML report UI, allowing users to choose their preferred language.

Changes

  • New file: src/tally/i18n.js - Contains all translations and i18n helper functions
  • Updated: spending_report.html - All hardcoded strings replaced with t() function calls
  • Updated: spending_report.js - i18n helpers integrated, localized formatting
  • Updated: report.py - Language parameter support added
  • Updated: run.py - Reads language from config and passes to report generation
  • Updated: settings.yaml.example - Documented language setting

Supported Languages

  • English (en) - Default
  • Turkish (tr)

Usage

language: tr # In settings.yaml for Turkish UI

Adding New Languages

New languages can be added by extending the translations object in i18n.js

Features

  • Localized UI labels (headers, buttons, tooltips)
  • Localized month names (Jan/Feb vs Oca/Sub)
  • Localized currency formatting (different thousands separators)
  • Localized date formatting
  • Falls back to English if translation key is missing

No Size Bloat

The i18n.js file adds ~6KB to the report, which is minimal compared to the overall HTML report size.

- Add i18n.js with English and Turkish translations
- Replace all hardcoded UI strings with t() function calls
- Add language setting support in settings.yaml (language: "en" or "tr")
- Pass language parameter from config through to report generation
- Support localized month names, currency formatting, and UI labels

Usage:
```yaml
# settings.yaml
language: "tr"  # Turkish UI
```

Supported languages: English (en), Turkish (tr)
New languages can be added by extending translations in i18n.js
@github-actions
Copy link

github-actions bot commented Jan 1, 2026

PR Build Available

Version: 0.0.54-d7c0563

Install from this PR

Linux / macOS:

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

Windows PowerShell:

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

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

@davidfowl
Copy link
Owner

There was a big refactoring to make this stuff more testable and parallelizable.

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.

2 participants