Skip to content

V2: Translation system refactor#318

Merged
Nielsvanpach merged 1 commit intov2from
feature/translation-refactor
Feb 25, 2026
Merged

V2: Translation system refactor#318
Nielsvanpach merged 1 commit intov2from
feature/translation-refactor

Conversation

@Nielsvanpach
Copy link
Copy Markdown
Collaborator

Summary

  • Remove HasTranslations interface and Translatable trait — translation is now built into the Country base class
  • Translations are loaded once per get() call instead of once per holiday name (N file reads → 1)
  • Translation file paths changed from lang/{hyphenated-class-name}/ to lang/{countryCode}/ (e.g. lang/germany/lang/de/)
  • Any country can now have translations by just adding a JSON file — no code changes needed

Breaking changes

  • HasTranslations interface removed
  • Translatable trait removed
  • defaultLocale() is now a protected method on Country (was public on interface)
  • Translation file paths changed

@Nielsvanpach Nielsvanpach merged commit 658e096 into v2 Feb 25, 2026
12 checks passed
@Nielsvanpach Nielsvanpach deleted the feature/translation-refactor branch February 25, 2026 22:24
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