The open-source translation management platform and localization system.
Yuzu is an open-source platform for translation management and localization of codebases. We are building it publicly for everyone to see and use, which helps us get more feedback and input. Most users will only use the command line interface, but you may also self-host the entire application if you prefer.
The hosted version is at yuzujs.com and the command-line interface is at npmjs.com/yuzu.
Yuzu takes an opinionated approach to localization, which saves time and simplifies the process if you are able to follow the guidelines. The primary default assumption that is not common is that for readability and ease of initial adoption, your message id should simply be your default language string.
If you want to learn more about this project or have any questions, send us an email at contact@yuzujs.com.
- Next.js
- Tailwind CSS
- Shadcn/ui
- Clerk
- Codesheets
- Xata
- DeepL
- Google Translate
- next-international
- OpenStatus
The following commands are the core operations of the yuzu npm package. You'll also need to implement an underlying i18n library, such as next-international.
For NextJS, this includes wrapping your strings as messages, adding middleware, and building a UI for language switcher. Examples of each are available in the Yuzu docs.
It's now recommended to run bunx or npx instead of npm -g.
bunx yuzu init # or npxThe initializer will ask you a number of questions and create a yuzu.config.ts file.
TypeScript is recommended but not required.
This will also guide you through the process of creating a project on yuzujs.com.
For projects using NextJS app router, Yuzu uses next-international out of the box, an up-to-date library for i18n.
There are a few other common commands to manage strings and keep them in sync.
Locally sync your yuzu directory to t() wrapped strings.
bunx yuzu build # or npxPush your messages and locales to your Yuzu project.
bunx yuzu push # or npxUse machine translation to fill in any missing translations in your Yuzu project. Yuzu also provides you with a Codesheet that you can make changes too, ask GPT-4 for help with, or share with a multilingual friend or vendor for edits.
bunx yuzu translate # or npxPull down the latest translations from your Yuzu project.
bunx yuzu pull # or npx-
Clone the repository
git clone https://github.com/radishworkshop/yuzu.git
-
Install dependencies
bun i
-
Get your API keys
For everything to work out of the box, you will need API keys for Clerk (Auth), Codesheets (TMS + GPT-4), Xata (DB, see
apps/web/db/xata.tsfor schema), DeepL (ML translation), and Google Translate (ML translation) -
Set up your environment
In
apps/webyou will find .env.example. Change the name to .env.local and add your own values. You'll also want to updateapps/web/.xatarcwith your database URL. -
Add your fonts
yuzujs.com uses a licensed font called Codec Pro, which is not free and therefore included in this repository. In production, Codec Pro is loaded at build time via a script called
scripts/install-fonts.js. It uses the FONTS_API_KEY environment variable and gets the fonts from a secret URL at my personal website, zackrw.com.You can easily get everything working by using
next/font/googleinapps/web/app/layout.tsxor making a fonts folder inapps/weband importing those. You can also purchase Codec Pro yourself if you feel like supporting it, and then copy those files into fonts. Or, you can even make your own server and useFONTS_API_KEYlike we do.If you decide to replace
next/font/localwithnext/font/googleinapps/web/app/layout.tsx, here are more details). For example:// replace 'next/font/local' and delete references to codecPro import { Inter } from 'next/font/google' // replace codecPro.className <body className={inter.className}> ... </body>
-
Start the development server
bun dev
Open http://localhost:3000 with your browser to see your server running.
If you want to help us build the simplest platform for NextJS localization, check out the contributing guidelines
