Skip to content

Conversation

@KristjanESPERANTO
Copy link
Collaborator

The core library only needs basic translation support for error messages and warnings in English and German. This PR replaces i18next (40+ KB) with a minimal custom implementation (~60 lines).

Benefits:

  • Production bundle: -40 KB minified (-13%)
  • Faster initialization, reduced memory footprint
  • One less external dependency
  • Full control over translation logic
  • Users of opening_hours.js (without +deps) no longer need to include i18next

Compatibility:

  • All existing tests pass
  • No breaking changes - API remains identical
  • Supports all features currently used: namespace translations, variable interpolation, fallback mechanism

Note: i18next remains in dependencies for the web evaluation tool which supports 12 languages.

- Remove i18next dependency from core library (still used by website)
- Add custom i18n implementation (~60 lines vs ~40KB)
- Reduce minified bundle size by 40KB (-13%)
@KristjanESPERANTO KristjanESPERANTO merged commit 60c74b0 into opening-hours:develop Dec 26, 2025
5 checks passed
@KristjanESPERANTO KristjanESPERANTO deleted the i18n branch December 27, 2025 21:31
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