Extends internationalization support from 2 languages (EN, DE) to 17 total
languages, meeting the DatesAPI website's advertised language count.
Added languages (15):
- Latin script: ES, FR, IT, PT, NL, PL, RU, TR, VI
- Non-Latin script: JA, KO, ZhCN, ZhTW, HI, TH
Changes:
- Added 15 new Lang constants to date.go (using ZhCN/ZhTW naming convention)
- Extended all 5 i18n maps in i18n.go with CLDR-accurate translations:
* monthNames: 12 months × 15 languages (180 entries)
* monthNamesShort: 12 abbreviated months × 15 languages
* weekdayNames: 7 weekdays × 15 languages (105 entries)
* weekdayNamesShort: 7 abbreviated weekdays × 15 languages
* durationUnits: 7 units × 2 forms × 15 languages (210 entries)
- Documented plural form limitation for PL/RU (complex plural rules)
- Added comprehensive test coverage (135 new test cases)
- Verified UTF-8 encoding for non-Latin scripts
Test results:
- All 955 tests passing
- Coverage: 99.5% (exceeds 95% target)
- No performance regression (static data only)
Closes: quando-cvw
Add internationalization support with translation data for English and
German languages. This provides the foundation for localized formatting
of dates and durations.
Changes:
- Add i18n.go with translation maps for month names, weekday names,
and duration units (both EN and DE)
- Implement helper methods on Lang type: MonthName, MonthNameShort,
WeekdayName, WeekdayNameShort, DurationUnit
- Add automatic fallback to English for unknown languages
- Create comprehensive test suite in i18n_test.go (97.8% coverage)
- Update Lang type documentation with future expansion notes
- Add example tests demonstrating i18n usage
Blocks: quando-10t, quando-5ol, quando-95w