The Translate Core Library is a React-based library designed to provide internationalization (i18n) support for web applications. It includes components and utilities to manage language selection, translations, and accessibility features.
Follow these steps to get the library up and running in your project:
Install the library and its peer dependencies:
npm install @ciscode/ui-translate-core react react-i18next i18next i18next-browser-languagedetector- React 18+
- i18next 25+
- react-i18next 15+
Wrap your application with the I18nProvider and use the LanguageSelectedLang component to enable language selection:
import { I18nProvider, LanguageSelectedLang } from '@ciscode/ui-translate-core';
<I18nProvider resources={resources} lng="en">
<LanguageSelectedLang />
</I18nProvider>;To build the library for production:
npm run buildRun unit and integration tests:
npm testRun tests with coverage:
npm run test:covWe welcome contributions to improve the library. Follow these steps to contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Write tests for your changes.
- Submit a pull request.
For detailed contribution guidelines, refer to the CONTRIBUTING.md file.
This project is licensed under the ISC License.
For more information, refer to the [official documentation].