[Weblate] Re: Weblate sync with Gitlab
Hi mitja.st...@gmail.com píše v St 15. 04. 2020 v 18:50 + > > Solved the issue. Now I am able to post new translations to Weblate. Great. Would you please share the solution so that others who might hit as well it can find it? Thanks -- Michal Čihař | https://cihar.com/ | https://weblate.org/ ___ Weblate mailing list -- weblate@lists.cihar.com To unsubscribe send an email to weblate-le...@lists.cihar.com
[Weblate] Re: Weblate sync with Gitlab
Hi Michal My idea was to use Weblate without remote repository (to avoid cloning remote repo to Weblate - security issues) and to develop an app that will take care for .properties file synchronization. So I have created multiple translation components in Weblate and for each component added the translations (languages). This is just the configuration and there are no real translations (file) in Weblate yet. Once this completed I have started the app that: 1) Read all projects from Weblate (with the use of Weblate API) - works 2) Read all components for each project from Weblate (with the use of Weblate API) - works 3) Read all translations for each component from Weblate (with the use of Weblate API) - works 4) Take the related . properties file from Gitlab (based on project - component - language internal mapping ) and upload the file to Weblate with the API described above - even if I set "method = replace" I get "400 - Bad Request" Have I done something wrong while configuring components and translations? Thank you. Mitja ___ Weblate mailing list -- weblate@lists.cihar.com To unsubscribe send an email to weblate-le...@lists.cihar.com
[Weblate] Re: Weblate sync with Gitlab
Hi Michal Thank you for your swift response. Regarding the POST for translation upload. The token that I am using belongs to a user with all rights (Groups) available including "Superuser status". I have some questions that might help: 1) Using the API: POST /api/translations/(string: project)/(string: component)/(string: language)/file/ is enough to set the "file" parameter or do I need to set all others (overwrite, email, author, method, fuzzy) ? 2) Do I need to set something on Django level or in "settings.py" configuration in order to solve the "You do not have permission to perform this action." issue? 3) Is there a log I could check for error s? I have already checked the one defined in the documentation but there are no errors available. Thank you for your help. Mitja ___ Weblate mailing list -- weblate@lists.cihar.com To unsubscribe send an email to weblate-le...@lists.cihar.com
[Weblate] Re: Weblate sync with Gitlab
Hi mitja.st...@gmail.com píše v St 08. 04. 2020 v 13:55 +: > When for instance running the curl: > sudo curl -X POST -F > file=@FormsResources.properties > -H "Authorization: Token " > https://hostname/api/translations/project/component/en/file/ > > > I get the error: > {"detail":"You do not have permission to perform this action."} > > Now I have two questions: > 1) Do you have some suggestions hot to do the integration when Gitlab > and Weblate are not in the same network (any similar use case)? There are various options of exposting just the service you want and keeping midex environment: 1. Run Weblate inside your network and make the https port available outside. 2. Run Weblate outside your network and let it access GitLab by ssh. > 2) Do you have some samples (maybe Java client implementation) how to > upload translation files with the use of API and what caused the > error in the example above? You probably want to use method=replace on the when updating, the files, but that's probably not the cause. Probably the user doesn't have permission to upload the template file? In case you are using built in groups on the project, he needs to be member of Template group. Best regards -- Michal Čihař | https://cihar.com/ | https://weblate.org/ ___ Weblate mailing list -- weblate@lists.cihar.com To unsubscribe send an email to weblate-le...@lists.cihar.com