0.0.3 • Published 2 years ago

jlatte v0.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

jlatte ☕

This is a Node.js script that helps you to easily perform language translation on your project's languages .json files using the Google Translate API. It can automatically detect the source language in a specified folder and translate the content in the correspondent files.

No configuration needed.

Nested objects support.

📦 Installation

Install it as a dev dependency in your project.

npm install -D jlatte

or

pnpm add jlatte -D

🧑‍💻 Usage

  1. Inside the folder that you use for your .json languages, create the source language file, for example, en.json with all the translations. Note: you can add after new translation, and if you have change manually any of the translations it will keep it as it is.

  2. Create in the same folder than the source language file, an empty .json file for every of the desired languages. For example es.json. Note: check for the available language codes in Available codes

  3. Execute the CLI in your project

pnpm jlatte

Note: you can create a script on your package.json for convenience as:

scripts{
   "translate": "pnpm jlatte <sourceFilePath> <sort>"
}

Replace <sourceFilePath> with the path to the source JSON file, and <sort> with true or false depending if you want to sort the object keys alphabetically or not, where true es "yes" and false is "not".

Example:

scripts{
   "translate": "pnpm jlatte languages/en.json true"
}

and then just execute:

pnpm translate

Available codes

LanguageCode
Afaraa
Abkhazianab
Afrikaansaf
Akanak
Albaniansq
Amharicam
Arabicar
Aragonesean
Armenianhy
Assameseas
Avaricav
Avestanae
Aymaraay
Azerbaijaniaz
Bashkirba
Bambarabm
Basqueeu
Belarusianbe
Bengalibn
Bihari Languagesbh
Bislamabi
Tibetanbo
Bosnianbs
Bretonbr
Bulgarianbg
Burmesemy
Catalanca
Valencianca
Czechcs
Chamorroch
Chechence
Chinesezh
Church Slaviccu
Old Slavoniccu
Church Slavoniccu
Old Bulgariancu
Old Church Slavoniccu
Chuvashcv
Cornishkw
Corsicanco
Creecr
Welshcy
Danishda
Germande
Divehidv
Dhivehidv
Maldiviandv
Dutchnl
Flemishnl
Dzongkhadz
Greekel
Englishen
Esperantoeo
Estonianet
Eweee
Faroesefo
Persianfa
Fijianfj
Finnishfi
Frenchfr
Western Frisianfy
Fulaff
Georgianka
Gaelicgd
Scottish Gaelicgd
Irishga
Galiciangl
Manxgv
Guaranign
Gujaratigu
Haitianht
Haitian Creoleht
Hausaha
Hebrewhe
Hererohz
Hindihi
Hiri Motuho
Croatianhr
Hungarianhu
Igboig
Icelandicis
Idoio
Sichuan Yiii
Nuosuii
Inuktitutiu
Interlingueie
Occidentalie
Interlinguaia
Indonesianid
Inupiaqik
Italianit
Javanesejv
Japaneseja
Kalaallisutkl
Greenlandickl
Kannadakn
Kashmiriks
Kanurikr
Kazakhkk
Central Khmerkm
Kikuyuki
Gikuyuki
Kinyarwandarw
Kirghizky
Kyrgyzky
Komikv
Kongokg
Koreanko
Kuanyamakj
Kwanyamakj
Kurdishku
Laolo
Latinla
Latvianlv
Limburganli
Limburgerli
Limburgishli
Lingalaln
Lithuanianlt
Luxembourgishlb
Letzeburgeschlb
Luba-Katangalu
Gandalg
Macedonianmk
Marshallesemh
Malayalamml
Maorimi
Marathimr
Malayms
Malagasymg
Maltesemt
Mongolianmn
Nauruna
Navajonv
Navahonv
Ndebele, Southnr
South Ndebelenr
Ndebele, Northnd
North Ndebelend
Ndongang
Nepaline
Norwegian Nynorsknn
Nynorsk, Norwegiannn
Norwegian Bokmålnb
Bokmål, Norwegiannb
Norwegianno
Chichewany
Chewany
Nyanjany
Occitanoc
Ojibwaoj
Oriyaor
Oromoom
Ossetianos
Osseticos
Panjabipa
Punjabipa
Palipi
Polishpl
Portuguesept
Pushtops
Pashtops
Quechuaqu
Romanshrm
Romanianro
Moldavianro
Moldovanro
Rundirn
Russianru
Sangosg
Sanskritsa
Sinhalasi
Sinhalesesi
Slovaksk
Sloveniansl
Northern Samise
Samoansm
Shonasn
Sindhisd
Somaliso
Sotho, Southernst
Spanishes
Sardiniansc
Serbiansr
Swatiss
Sundanesesu
Swahilisw
Swedishsv
Tahitianty
Tamilta
Tatartt
Telugute
Tajiktg
Tagalogtl
Thaith
Tigrinyati
Tongato
Tswanatn
Tsongats
Turkmentk
Turkishtr
Twitw
Uighurug
Ukrainianuk
Urduur
Uzbekuz
Vendave
Vietnamesevi
Volapükvo
Walloonwa
Wolofwo
Xhosaxh
Yiddishyi
Yorubayo
Zhuangza
Chuangza
Zuluzu

🎖️ Credits

Translate as base for the translations.

Clack and picocolors for the command-line interface

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago