Convert a given boolean to the equivalent word (Yes/No) in a defined language.
This package does support typescript.
npm i bool-to-yesno
boolToYesNo(true, "en") -> Yes
boolToYesNo(false, "en") -> No
boolToYesNo(false, "de") -> Ja
boolToYesNo(true, "fr", yes) -> oui
const boolToYesNo = require('bool-to-yesno')
boolToYesNo.boolToYesNo(true) // Yes
or
import {boolToYesNo} from "bool-to-yesno"
boolToYesNo(false, "en", true) // no
boolToYesNo(boolean, string, boolean)
boolToYesNo(
converted param,
ISO 639-1 language code ("en", "de", "fr") -> default and fallback "en",
lowercase true/false -> default false
)
- English (en)
- German (de)
- French (fr)
- Spanish (es)
- Dutch (nl)
- Italien (it)
- Czech (cs)
- Polish (pl)
- Portuguese (pt)
If you are able to detect an issue feel free to create an issue. Please add the input value when doing so.