@grams-dev/i18n
TypeScript icon, indicating that this package has built-in type declarations

0.0.23 • Public • Published

@grams-dev/i18n

npm version npm downloads License

A localization and internationalization library for Grams applications.

Overview

The @grams-dev/i18n library provides a simple and efficient way to manage translations and internationalization in Grams applications. It stores translation strings in JSON files and exports these translations to other libraries or frameworks.

Installation

Install the library using npm:

npm install "@grams-dev/i18n" --save

Usage

1. Import the i18n Object

In your index.html, import the i18n object from @grams-dev/i18n to access the translation strings

import '@grams-dev/i18n';

2. Using the hook

Using the hook in functional components is one of the options you have. The t function is the main function in i18next to translate content.

import React from 'react';

// the hook
import { useTranslation } from 'react-i18next';

function MyComponent () {
  const { t, i18n } = useTranslation();
  return <h1>{t('Welcome to React')}</h1>
}

Learn more about the hook useTranslation.

Contributing

We welcome contributions from the community to improve and expand the functionality of the @grams-dev/i18n library. If you find any issues or have suggestions, please create a pull request or open an issue on our GitHub repository.

License

This library is open-source and available under the Apache-2.0 License. Feel free to use, modify, and distribute it as needed.

Readme

Keywords

none

Package Sidebar

Install

npm i @grams-dev/i18n

Weekly Downloads

3

Version

0.0.23

License

Apache-2.0

Unpacked Size

52.6 kB

Total Files

17

Last publish

Collaborators

  • atmohamedamer