Quickstart
Start by installing Babely.
Then, run the following command to initialize Babely.
Terminal
npx @babely/cli@latest init
Follow the steps to set up your project.
First Translation
Now you are ready to translate your code.
Start by adding a key to your source file, for example if you choose to use en.json as your source file, add a key to it.
src/locales/en.json
{ "welcome": "Welcome to our application!", "user": { "greeting": "Hi, {{name}}!", "profile": { "title": "Your profile", "edit": "Edit profile" } }, "notifications": { "messages": "You have {{count}} new message(s).", "empty": "No new notifications." } }
Translate
Run the following command to translate your content:
Terminal
npx @babely/cli@latest translate
This will:
- ◇Create translation files for each target language
- ◇Generate high-quality translations Babely Engine
- ◇Create a
babely.lockfile to track translation states
The lock file helps Babely identify which translations need updates when your source content changes. Make sure to commit this file to your repository.
Next Steps
Now that you have Babely set up, you can:
- ◇Add more languages in your
babely.jsonfile - ◇Integrate Babely into your CI/CD pipeline
- ◇Use our API for programmatic translations
Check out our other guides to learn more about Babely's advanced features.