Translation_replace translation filenames with %locale% at the middle

The previous version of the project had translations with wildcard

"translation" : "/old/project/dir/translation/%locale%.xlf"

The translation file location and filename are changed in the new project version to

  "translation" : "/translations/messages.%locale%.xlf",

I tried the configuration below to keep all translation files and names on Crowdin like the previous version had:

  "translation" : "/translations/messages.%locale%.xlf",
  "translation_replace" : {
    "messages.": ""
 "dest" : "/old/project/dir/translation/%file_name%.xlf",

But I got an error when I tried to upload translations:

'translations/ro-RO.xlf' translation file doesn't exist in the specified place

It looks like, the crowdin cli does replace before uploading the file. Of course, the file after replacing in filename doesn’t exist.

I would appreciate it if someone explained to me how translation_replace works and help with my case.

Thank you.

Hi @mgalagan

I will be happy to explain,

The thing is that the translation replace feature works only during the export of translations, not during the translation upload.

Basically, it is used if you need to rename a file with translations after the export.

1 Like

Ok. I see. Thank you