-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add make command update-translations for update translations from crodwin #2097
Add make command update-translations for update translations from crodwin #2097
Conversation
…wdin to options/locale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code did not work for me as tar can not extract files from zip archives.
How about such code (it does work even without changes in go-ini):
.PHONY: update-translations
update-translations:
mkdir -p ./translations
cd ./translations && curl -L https://crowdin.com/download/project/gitea.zip > gitea.zip && unzip gitea.zip
rm ./translations/gitea.zip
$(SED_INPLACE) -e 's/="/=/g' -e 's/"$$//g' ./translations/*.ini
$(SED_INPLACE) -e 's/\\"/"/g' ./translations/*.ini
mv ./translations/*.ini ./options/locale/
rmdir ./translations
Also changed from wget to curl as curl is also used in other places in Makefile
Also crowdin zip file needs to be regenerated as in Swedish translation there was error that did not allow gitea to start (I fixed it but zip file still contains old broken translation) |
@lafriks before download, we have to click the |
@lafriks done. |
Just thought that it could be more optimized by piping curl output directly to unzip and than
but otherwise LGTM |
@lafriks It didn't work on macOS |
oh well, if it is not working on macos than just leave how it is :) |
LGTM |
Also I have sent a PR to ini package, see go-ini/ini#110. After
these twothis PR merged, it's easy to update the translations to local and create a translation PR is easy too. @lafriks