Comments (3)
Hi @bavdh
Thanks for reporting this!
The current version of the CLI assumes that the upload and download config will use one file per locale rule.
In the attached example, the push command will try to send 3 times the same file (the last specified) for en
locale, which results in a bad request error (the API client closes pushed file after the request, so following requests won't send any file data to server).
I see that there is a space for improvement. Maybe better error handling that will guide users to use one file per locale in config or extending current CLI to support multiple files per locale.
Also, could you share your motives to split translations for one locale in multiple files, so we can better understand the needs.
from localizely-cli.
Hi @lzoran
Thanks for the reply!
I am working with multiple devices, and each device comes with a file containing its own instructions and configuration. Using a script the instructions are separated in a different file (a separate file containing instruction for each device). Now I need to translate these files per locale, and also maintain the separations after the translations(after download).
To make the push work I made some changes in the CLI by using its index rather than locale and it seems to do the trick for multiple files upload. But after a pull, I am getting separate files(as required) but containing all the translations in every of them (this maybe because CLI assumes one file per locale in pull as well).
It would be great if the CLI supports multiple files per locale (for both push and pull).
from localizely-cli.
Thanks for the provided info!
I suggest we leave this issue open so we can better track demand (upvotes) for the proposed functionality.
Until then, is it convenient for you to use tags and independent calls via CLI for the each file you need to translate?
Push translations from foo.po
file:
localizely-cli push \
--api-token <API_TOKEN> \
--project-id <PROJECT_ID> \
--files "file[0]=i18n/templates/foo.po","locale_code[0]=en"
--overwrite \
--reviewed=false \
--tag-added foo \
Pull translations for foo.po
file:
localizely-cli pull \
--api-token <API_TOKEN> \
--project-id <PROJECT_ID> \
--file-type po \
--files "file[0]=i18n/en/foo.po","locale_code[0]=en" \
--export-empty-as empty \
--include-tags foo \
*Note: This requires you to have unique keys across all localization files in case you use single Localizely project
from localizely-cli.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from localizely-cli.