mk-intl
v1.4.7
Published
## Overview
Readme
mk-intl
Overview
mk-intl is a modular library that provides internationalization (i18n) support through a collection of React components and helpers. The project includes components for formatting dates, messages, and numbers, alongside hooks, providers, and type definitions to streamline i18n implementation in your applications.
Table of Contents
Features
- MKFormattedMessage: Easily format dynamic messages.
- MKFormattedDate: Format dates according to locale settings.
- MKFormattedNumber: Handle number formatting in various locale formats.
- Modular design with centralized definitions, helpers, and custom hooks for seamless internationalization across your React applications.
Project Structure
Below is an outline of the current project directory layout:
This structure is organized to separate components, definitions, helpers, hooks, and providers for easier maintenance, extension, and integration into your projects.
Prerequisites
Before you begin, ensure you have the following installed:
- Node.js (v14 or newer) and your preferred package manager (npm or yarn)
- A modern web browser for development, testing, and usage
Installation
Clone the repository:
git clone https://github.com/yourusername/mk-intl.git cd mk-intlInstall dependencies:
Using npm:
npm installOr, if you prefer yarn:
yarn install
Usage
You can integrate the internationalization components into your React application by importing and using them as needed. For instance, to use the MKFormattedDate component:
import React from 'react';
import { MKFormattedDate } from './components/MKFormattedDate';
const App: React.FC = () => {
return (
<div>
<MKFormattedDate value={new Date()} />
</div>
);
};
export default App;This example demonstrates how to integrate the date formatting component within your application. Similar usage applies to the MKFormattedMessage and MKFormattedNumber components, along with any custom hooks, providers, or helpers available in the library.
License
This project is distributed under the MIT License. See the LICENSE file for more information.
