- Node.js (latest)
- Rust (latest, stable)
- wasm-pack (latest)
Dev Container is available.
$ git clone https://github.com/livewing/mahjong-calc.git
$ cd mahjong-calc
$ npm i
$ npm run build:wasm
$ npm run dev
Vite dev server runs on PORT=5173
. If you are using Dev Container, run npm run dev -- --host
instead of npm run dev
.
$ npm run lint
$ npm run build:wasm
$ npm run build
Bundle output directory is dist/
.
See #153 for discussion on localization.
To translate mahjong-calc to a new language, copy the locales/ja.yml
file to the locale you are translating to. For example, to translate mahjong-calc to Esperanto you would do:
$ cp locales/ja.yml locales/eo.yml
Then edit the file with your translation.
# locales/eo.yml
locale:
name: Esperanto # Language name
translation:
header:
title: Mahjong Poentaro Kalkulilo
update: Ĝisdatigo
# --snip--
mahjong-calc uses i18next, so please refer to the i18next documentation for translation. In the language with plurals, you will see Plurals - i18next documentation.
To update existing translations, just update the yml file with new strings.