Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/remonhasan/react-en-bn
react library for english to bangla translation 🐧
https://github.com/remonhasan/react-en-bn
bangla-translator javascript npm-package react
Last synced: 7 days ago
JSON representation
react library for english to bangla translation 🐧
- Host: GitHub
- URL: https://github.com/remonhasan/react-en-bn
- Owner: Remonhasan
- License: mit
- Created: 2023-11-16T12:58:00.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2023-11-28T11:50:31.000Z (10 months ago)
- Last Synced: 2024-09-28T15:42:39.791Z (7 days ago)
- Topics: bangla-translator, javascript, npm-package, react
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/react-en-bn
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# React En to Bn ( English to Bangla) Convertion
A utility package providing functions to convert English numerals and date-time to Bengali numerals and date-time representations in React applications.
## Installation
You can install this package via npm or yarn:
```bash
npm install react-en-bn
# or
yarn add react-en-bn
```## Usage
### `toBN`
Converts English numerals to Bengali numerals.```
import { toBN } from 'react-en-bn';const currentDate = '07-10-2023'
const bnNumber = toBN(currentDate); // Output: '০৭-১০-২০২৩'```
### `toBnDateTime`
Converts English date-time to Bengali date-time representation.```
import { toBnDateTime } from 'react-en-bn';const enDateTime = '2023-11-14 12:45:00';
const bnDateTime = toBnDateTime(enDateTime); // Output: '২০২৩-১১-১৪, ১২:৪৫:০০ অপরাহ্ণ'```
### `toBnMonthDateTime`
Converts English date-time to Bengali date-time with the month name.
```
import { toBnMonthDateTime } from 'react-en-bn';const enDateTime = '2023-11-14 12:45:00';
const bnDateTimeMonth = toBnDateTimeMonth(enDateTime); // Output: '১৪ নভেম্বর ২০২৩, ১২ টা ৪৫ মিনিট অপরাহ্ণ'```