Languine uses a JSON configuration file (languine.json) to manage your translation setup. This file defines your source and target languages, as well as the files that need to be translated.
Here's a basic example in both formats:
{ "locale": { "source": "en", "targets": ["es", "fr", "de"] }, "files": { "json": { "include": ["locales/[locale].json"] } } }
Let's break down the different sections in the configuration file.
The locale section defines your translation languages:
Languine supports a wide range of language codes, including:
The files section defines which files Languine should translate. You can configure multiple file types and patterns:
files: { json: { include: ["locales/[locale].json"], }, }
files: { md: { include: ["docs/[locale]/*.md"], }, mdx: { include: ["blog/[locale]/*.mdx"], }, }
For iOS (Xcode):
files: { "xcode-xcstrings": { include: ["Example/Localizable.xcstrings"], }, // Or for traditional .strings files "xcode-strings": { include: ["Example/[locale].lproj/Localizable.strings"], }, }
For Android:
files: { android: { include: ["locales/[locale].xml"], }, }
Here's a complete list of file formats supported by Languine:
The [locale] placeholder in file patterns is automatically replaced with the appropriate language code during translation. For example:
You can include multiple patterns for each file type and use glob patterns:
files: { json: { include: [ "src/locales/[locale].json", "src/components/[locale]/*.json" ], }, }
If you're using Languine's cloud services, you can include your project ID in the configuration:
{ "projectId": "prj_your_project_id", "locale": { // ... locale config }, files: { // ... files config }, }
Languine automatically creates and maintains a languine.lock file to track the state of your translations. This file:
You don't need to manually edit the lock file - Languine manages it automatically when you run translation commands.
LANGUINE_PROJECT_ID
environment variable instead.