box / mojito

An automation platform that enables continuous localization.
https://www.mojito.global/
Apache License 2.0
369 stars 74 forks source link

XLF file not processed #807

Open danjor opened 2 years ago

danjor commented 2 years ago

Hello,

I'm facing some issue where .xlf files are not processed even if the readme indicated this format is handled 👍 https://www.mojito.global//docs/refs/mojito-file-formats/

mojito repo-create -n MyRepo -l fr-FR

Create repository: MyRepo
Extracting locale: fr-FR
Extracted RepositoryLocale:
-- bcp47Tag = fr-FR
-- isFullyTranslated = true

created --> repository id: 14
mkdir MyRepo
cd MyRepo 
ls 
resources_fr-FR.xlf

mojito import -r MyRepo

Start importing localized files for repository: MyRepo

Finished

Nothing got imported. I had to rename .xlf to .xliff file to be detected. .xlf should also be handled.

aurambaj commented 2 years ago

Just to clarify did you do a push first to import the source string (your ls command doesn't show a source file, just the localzied french file)? Then you can do the import

danjor commented 2 years ago

Yes I did that. For .xlf :

:/MyRepo# ll
total 776
drwxr-xr-x. 2 root root     58 May 19 07:34 ./
drwxr-xr-x. 1 root root    213 May 18 12:19 ../
-rw-r--r--. 1 root root 455817 May 18 09:32 resources_fr-FR.xlf
-rw-r--r--. 1 root root 333749 May 19 07:33 resources.xliff
root@ea992b8521c6:/MyRepo # mojito repo-create -n MyRepo -l fr-FR
Create repository: MyRepo 
Extracting locale: fr-FR
Extracted RepositoryLocale:
-- bcp47Tag = fr-FR
-- isFullyTranslated = true

created --> repository id: 20
:/MyRepo # mojito push -r MyRepo -s /MyRepo / -sr "^resources.xlf$"

Push assets to repository: MyRepo 

Finished

As you can see, this last step, nothing was imported.

Now doing the same with .xliff :

:/MyRepo# ll
total 776
drwxr-xr-x. 2 root root     58 May 19 07:34 ./
drwxr-xr-x. 1 root root    213 May 18 12:19 ../
-rw-r--r--. 1 root root 455817 May 18 09:32 resources_fr-FR.xliff
-rw-r--r--. 1 root root 333749 May 19 07:33 resources.xliff
:/MyRepo # mojito repo-create -n MyRepo -l fr-FR
Create repository: MyRepo 
Extracting locale: fr-FR
Extracted RepositoryLocale:
-- bcp47Tag = fr-FR
-- isFullyTranslated = true

created --> repository id: 21
:/MyRepo # mojito push -r MyRepo -s /MyRepo / -sr "^resources.xliff$"

Push assets to repository: MyRepo

 - Uploading: resources.xliff
 --> asset id: 13, task: 227

Running, task id: 227
Creating asset: resources.xliff (228) Done
Process asset content, id: 13 (229) Done
  Extracting text units from asset (230) Done
  Create new text units (231) Done
  Updating branch asset text units (233) Done
  Updating merged asset text units (235) Done
  Perform leveraging (236) Done

Finished

.xlif is found and being imported. Which was not the case with .xlf

aurambaj commented 2 years ago

Yes, right now Mojito only support .xliff and not .xlf as extension. We'd need to do some modification to support multiple extension for a given file format.