Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heintayzar-hm/burmese-locale-converter
https://github.com/heintayzar-hm/burmese-locale-converter
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/heintayzar-hm/burmese-locale-converter
- Owner: heintayzar-hm
- Created: 2024-01-05T09:38:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-17T03:15:49.000Z (12 months ago)
- Last Synced: 2024-01-17T10:16:42.450Z (12 months ago)
- Language: TypeScript
- Size: 74.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
### Burmese Locale Converter
A simple TypeScript utility for translating numbers, months, and days into the Burmese language.### Installation
```
npm install burmese-locale-converter
```### Usage
```
const numberText = translateNumbers(123, 'text'); // တစ်ရာ နှစ်ဆယ် သုံး
const number = translateNumbers(123, 'number') // ၁၂၃
const monthText = translateMonth('January'); // ဇန်နဝါရီ
const dayText = translateDay('Mon'); // တနင်္လာconst originalDate = new Date(); // Current date and time
const translatedDate = translateDate(originalDate); // တနင်္လာ ဇန်နဝါရီ ၂၀၂၄
```TranslateNumbers
```
translateNumbers(number: string | number, format: 'text' | 'number' = 'text'): string;
```Translates numbers into Burmese text or number format.
translateMonth
```
translateMonth(month: string | number): string;
```
Translates English month names into Burmese.translateDay
```
translateDay(day: string | number): string;
```
Translates English day abbreviations into Burmese.translateDate
```
translateDate(date: Date): Date;
```
Translates the textual representation of the date components into Burmese and returns a new Date object.Testing
This project uses Jest for testing. Run the following command to execute the tests:```
npm test
```### Contribution
Contribution are welcome. You can suggest new features and find bugs and make issues.
### License
This project is licensed under the MIT License - see the LICENSE file for details.