@localizer: Type-safe localization, formatting and translation library
August 12, 2025 ยท View on GitHub
๐ Official documentation ๐
About the Project
@localizer simplifies localization, formatting, and translation with a type-safe approach. It ensures consistency, reduces runtime errors, and supports multiple languages, dynamic translations, and locale-specific formatting.
Highlights
- Type-safe Localization: Compile-time safety for translations, reducing runtime errors.
- Flexible Formatting: Supports locale-specific date, number, and custom formatting.
- Dynamic Translations: Enables runtime language switching and dynamic content.
- Multi-language Support: Simplifies managing multiple languages.
- Lightweight and Performant: Optimized for performance with minimal overhead.
- Extensible: Easily customizable for specific localization needs.
Modules
Modules Overview
@localizer is modular, offering flexibility for various localization needs:
Core
@localizer/core: Essential utilities for localization.@localizer/transform: Locale-dependent transformations.
Formatters
@localizer/format: Built-in formatting for dates, numbers, and more.@localizer/format-datetime: Date and time formatting.@localizer/format-displayname: Formatting for languages, countries, and currencies.@localizer/format-list: List formatting.@localizer/format-lookup: Lookup table-based formatting.@localizer/format-number: Number, measurement, and currency formatting.@localizer/format-relativetime: Relative time formatting.
Translation
@localizer/translate: TypeScript-native translation library.
Use modules independently or combine them as needed.
Bundle
@localizer/all: A meta-package bundling all the modules.
Versioning
@localizer uses Semantic Versioning, structured as MAJOR.MINOR.PATCH:
- MAJOR: For breaking changes.
- MINOR: For new features.
- PATCH: For bug fixes.
Release Process
- Development: Changes are made in feature branches and merged into
mainafter review. - Testing: Each release is tested for stability and compatibility.
- Version Tagging: Releases are tagged with the appropriate version.
- Publishing: Releases are published to npm.
Compatibility
We aim to keep backward compatibility within a major version. Breaking changes are documented in the change logs of corresponding packages.
Contribution Guide
Contributions are welcome! Fix bugs, add features, or improve documentation by following these steps:
Getting Started
- Fork and Clone: Fork the repository and clone it locally:
git clone https://github.com/<your-username>/localizer.git
cd localizer
- Install Dependencies: Install the required dependencies:
npm install
- Create a Branch:
git checkout -b feature/your-feature-name
-
Make Changes: Update the codebase as needed.
-
Run Tests: Verify your changes:
npx nx test <module>
- Commit Changes: Use a clear commit message:
git commit -m "feat: Add new feature"
Refer to the contribution guide for more details.
Need Help?
For questions or assistance, open an issue or contact the maintainers.
Thank you for supporting @localizer!