Translate given text into Baybayin, Buhid, Hanunoo, or Tagbanwa scripts.
Demo deployed in Vercel
npm install filipino-script-translator
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α
npm run test
npm run lint
npm run build
This package is open-sourced software licensed under the MIT license.