Config File
Define the babli.json config file in the root of your project.
Example
Section titled “Example”{ "projectId": "1234567890", "translationFiles": ["src/locales/{lang}.json"]}Options:
Section titled “Options:”projectId
stringThe project ID. You can find it in the project settings.
sortBy
enumHow to sort the keys in the file
Default: "original"
Allowed values:
translationFiles
object[]Source files for the translations.
path
stringThe path to the translation file. Use {{lang}} placeholder to define the language code.
languages
string[](optional)Babli will autodetect languages by default, but in case you need different languages with different languages, you can define the languages here.
format
enum(optional)Babli will autodetect format from file extensions. But if using non-standard extensions, you can change format here.
Allowed values:
namespace
string(optional)Fixed namespace for all keys from this file entry. Mutually exclusive with {{namespace}} in path.
mapLocalToRemote
ZodRecord(optional)Maps local file language codes to remote Babli language codes. E.g. { "en": "en-US", "de": "de-DE" }. Unmapped codes pass through as-is.
transform
string(optional)Path to a custom transform file (.ts/.js) for non-standard file formats. The transform handles push/pull for all languages in a single file.
nested
booleanDefine if keys should be exported as nested values `{ "a": { "b": "x"}}` or not nested `{ "a.b": "x" }`
Default: true
topLevelLanguageCode
booleanDefault: false
pullWithEmptyValues
booleanDefault: false
yaml
objectDefault: {}
version
string(optional)sortBy
enumDefault: "original"
Allowed values:
emptyValueString
string(nullable)In case you use some specific value to mark the value is not translated yet, For example 'NOT_TRANSLATED', You can define it here.
Default: null