.jtranslate.config.jsonWhen you run jtranslate init, the CLI drops a .jtranslate.config.json file in the root of your project.
This file is not a secret, it’s just a bit of context that the commands use to verify:
{
"projectId": "abc123",
"projectName": "My App",
"apiBaseUrl": "https://api.jtranslate.dev/v1",
"localesDir": "src/i18n",
"source": {
"language": "en-gb",
"file": "src/i18n/en-gb.json"
},
"targetLanguages": [
{ "alias": "es", "language": "es" },
{ "alias": "fr", "language": "fr" }
]
}
projectId is the remote project IDprojectName is the name of your remote projectapiBaseUrl is the JTranslate api, no need to worry about this, it's used for testing different environments during developmentlocalesDir is the folder containing your JSON language filessource:
language is the language code of your source languagefile is the file path to your source JSON filetargetLanguages:
alias is the file name of a given target language, must be uniquelanguage is the language code of a given target languageThe CLI leans biased towards the web project, so it will always look to your remote JTranslate project as the source of truth when it comes to what target languages your project supports, and what their file names are.
If you're looking to rename a target language you will need to do it in both the web project as well as locally and ensure the names match - alternatively if you do it just in the web project first, you can then use the jtranslate pull command - which is designed in such a way that it will identify which language has alias changes and update both your config file and rename your local JSON file.
jtranslate pull
The same goes as above when it comes to adding / removing target languages in your project. The simplest way is to just do it within your remote web project and then call jtranslate pull to reflect changes locally. This will not delete your local files though, you will have to do that manually.