Skip to content

isaacdarcilla/filipino-script-translator

Repository files navigation

filipino-script-translator

Translate given text into Baybayin, Buhid, Hanunoo, or Tagbanwa scripts.

js-standard-style npm version codecov

Demonstration

Demo deployed in Vercel

Deploy with Vercel

Installation

npm install filipino-script-translator

Usage

Import the translate() and the enum from the package. Change the script parameter into one of the enums, the default is BAYBAYIN:

import { Script, translate } from 'filipino-script-translator';

const result = translate('maganda', Script.BAYBAYIN);
// Output: αœ‹αœ„αœˆαœ”αœ‡

const result = translate('maganda', Script.TAGBANWA);
// Output: ᝫᝀᝧ

const result = translate('maganda', Script.HANUNOO);
// Output: ᜫᜀᜨ᜴ᜧ

const result = translate('maganda', Script.BUHID);
// Output: ᝋᝄnᝇ

or directly use the translator methods base on the script you want:

import { toBaybayin, toBuhid, toHanunoo, toTagbanwa } from 'filipino-script-translator';

const result = toBaybayin('maganda');
// Output: αœ‹αœ„αœˆαœ”αœ‡

const result = toTagbanwa('maganda');
// Output: ᝫᝀᝧ

const result = toHanunoo('maganda');
// Output: ᜫᜀᜨ᜴ᜧ

const result = toBuhid('maganda');
// Output: ᝋᝄnᝇ

Testing

npm run test

Linting

npm run lint

Building

npm run build

License

This package is open-sourced software licensed under the MIT license.