Skip to content
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

Merged
merged 2 commits into from
Jul 3, 2017

Conversation

lunny
Copy link
Member

@lunny lunny commented Jul 2, 2017

Also I have sent a PR to ini package, see go-ini/ini#110. After these two this PR merged, it's easy to update the translations to local and create a translation PR is easy too. @lafriks

@lunny lunny added this to the 1.2.0 milestone Jul 2, 2017
Copy link
Member

@lafriks lafriks left a 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

@lafriks
Copy link
Member

lafriks commented Jul 2, 2017

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)

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 2, 2017
@lunny
Copy link
Member Author

lunny commented Jul 3, 2017

@lafriks before download, we have to click the build the project on the UI. I haven't find any HTTP method except API key to do that.

@lunny
Copy link
Member Author

lunny commented Jul 3, 2017

@lafriks done.

@lafriks
Copy link
Member

lafriks commented Jul 3, 2017

Just thought that it could be more optimized by piping curl output directly to unzip and than rm gitea.zip is also not needed:

	cd ./translations && curl -L https://crowdin.com/download/project/gitea.zip | unzip

but otherwise LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 3, 2017
@lunny
Copy link
Member Author

lunny commented Jul 3, 2017

@lafriks It didn't work on macOS

@lafriks
Copy link
Member

lafriks commented Jul 3, 2017

oh well, if it is not working on macos than just leave how it is :)

@ethantkoenig
Copy link
Member

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 3, 2017
@lafriks lafriks merged commit dde9a86 into go-gitea:master Jul 3, 2017
@lunny lunny deleted the lunny/add_make_update_translations branch July 3, 2017 13:43
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/translation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants