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

Update/Pull translations from Transifex #4476

Closed
wants to merge 1 commit into from

Conversation

humitos
Copy link
Member

@humitos humitos commented Aug 6, 2018

After reading #4471 and working on #4470 I think we need to improve our flow about our own translations.

The discussion about how to automate this can be tracked under #4471. In the meantime, we should update our app translation manually and that is what this PR does.

$ tx pull --force
tx INFO: Pulling translations for resource readthedocs.readthedocs (source: readthedocs/locale/en/LC_MESSAGES/django.po)
tx WARNING:  -> zh_TW: readthedocs/locale/zh_TW/LC_MESSAGES/django.po
tx WARNING:  -> fr: readthedocs/locale/fr/LC_MESSAGES/django.po
tx WARNING:  -> ja: readthedocs/locale/ja/LC_MESSAGES/django.po
tx WARNING:  -> ru: readthedocs/locale/ru/LC_MESSAGES/django.po
tx WARNING:  -> uk: readthedocs/locale/uk/LC_MESSAGES/django.po
tx WARNING:  -> zh_CN: readthedocs/locale/zh_CN/LC_MESSAGES/django.po
tx WARNING:  -> ca: readthedocs/locale/ca/LC_MESSAGES/django.po
tx WARNING:  -> pl: readthedocs/locale/pl/LC_MESSAGES/django.po
tx WARNING:  -> ar: readthedocs/locale/ar/LC_MESSAGES/django.po
tx WARNING:  -> es: readthedocs/locale/es/LC_MESSAGES/django.po
tx WARNING:  -> vi_VN: readthedocs/locale/vi_VN/LC_MESSAGES/django.po
tx WARNING:  -> gl: readthedocs/locale/gl/LC_MESSAGES/django.po
tx WARNING:  -> pt_BR: readthedocs/locale/pt_BR/LC_MESSAGES/django.po
tx WARNING:  -> it: readthedocs/locale/it/LC_MESSAGES/django.po
tx WARNING:  -> nb: readthedocs/locale/nb/LC_MESSAGES/django.po
tx WARNING:  -> de: readthedocs/locale/de/LC_MESSAGES/django.po
tx WARNING:  -> sk: readthedocs/locale/sk/LC_MESSAGES/django.po
tx WARNING:  -> eu: readthedocs/locale/eu/LC_MESSAGES/django.po
tx INFO: Done.

$ dj makemessages --all
processing locale de
processing locale vi_VN
processing locale fr
processing locale ru
processing locale sk
processing locale pl
processing locale gl
processing locale pt_BR
processing locale uk
processing locale eu
processing locale es
processing locale ca
processing locale nb
processing locale ja
processing locale en
processing locale ar
processing locale zh_TW
processing locale it
processing locale zh_CN

I suppose that I should run this command also, to update our strings under Transifex:

$ tx push --source

Although, before doing this I want to be sure of this and I may need extra permissions that allow me to do this. @ericholscher @agjohnson, is this command correct?

$ tx pull --force
tx INFO: Pulling translations for resource readthedocs.readthedocs (source: readthedocs/locale/en/LC_MESSAGES/django.po)
tx WARNING:  -> zh_TW: readthedocs/locale/zh_TW/LC_MESSAGES/django.po
tx WARNING:  -> fr: readthedocs/locale/fr/LC_MESSAGES/django.po
tx WARNING:  -> ja: readthedocs/locale/ja/LC_MESSAGES/django.po
tx WARNING:  -> ru: readthedocs/locale/ru/LC_MESSAGES/django.po
tx WARNING:  -> uk: readthedocs/locale/uk/LC_MESSAGES/django.po
tx WARNING:  -> zh_CN: readthedocs/locale/zh_CN/LC_MESSAGES/django.po
tx WARNING:  -> ca: readthedocs/locale/ca/LC_MESSAGES/django.po
tx WARNING:  -> pl: readthedocs/locale/pl/LC_MESSAGES/django.po
tx WARNING:  -> ar: readthedocs/locale/ar/LC_MESSAGES/django.po
tx WARNING:  -> es: readthedocs/locale/es/LC_MESSAGES/django.po
tx WARNING:  -> vi_VN: readthedocs/locale/vi_VN/LC_MESSAGES/django.po
tx WARNING:  -> gl: readthedocs/locale/gl/LC_MESSAGES/django.po
tx WARNING:  -> pt_BR: readthedocs/locale/pt_BR/LC_MESSAGES/django.po
tx WARNING:  -> it: readthedocs/locale/it/LC_MESSAGES/django.po
tx WARNING:  -> nb: readthedocs/locale/nb/LC_MESSAGES/django.po
tx WARNING:  -> de: readthedocs/locale/de/LC_MESSAGES/django.po
tx WARNING:  -> sk: readthedocs/locale/sk/LC_MESSAGES/django.po
tx WARNING:  -> eu: readthedocs/locale/eu/LC_MESSAGES/django.po
tx INFO: Done.

$ dj makemessages --all
processing locale de
processing locale vi_VN
processing locale fr
processing locale ru
processing locale sk
processing locale pl
processing locale gl
processing locale pt_BR
processing locale uk
processing locale eu
processing locale es
processing locale ca
processing locale nb
processing locale ja
processing locale en
processing locale ar
processing locale zh_TW
processing locale it
processing locale zh_CN
@humitos humitos requested a review from a team August 6, 2018 14:22
@humitos humitos added this to the I18n improvements milestone Aug 6, 2018
@ericholscher
Copy link
Member

@xrmx would also be useful to have your input here

@xrmx
Copy link
Contributor

xrmx commented Aug 6, 2018

I've updated the fabfile scripts to do what i think is the correct workflow in #4189. First you have to update the english, push it to transifex, after that you can pull the translations. More importantly the push to transifex must be done ideally everytime you update the strings otherwise the translators cannot update the translations.

@humitos
Copy link
Member Author

humitos commented Aug 6, 2018

@xrmx you are right.

Question: is there any problem by pulling from Transifex without pushing first? I thought that in by doing that, I'm bringing newer translations from what already exists in Transifex to our application. Of course, new/updated strings from sources are not pulled because they don't exist yet in Transifex.

I want to know if doing this pull without pushing first could break something.

@humitos
Copy link
Member Author

humitos commented Aug 6, 2018

@xrmx the function for docs does what I was thinking: https://github.com/rtfd/readthedocs.org/blob/master/fabfile.py#L27

  1. pull
  2. update .pot files
  3. push

We may need to split as you did for the app translations, but also, we should include the new resources under the .tx/config file as I did in #4478. What do you think?

@xrmx
Copy link
Contributor

xrmx commented Aug 7, 2018

@humitos I don't think it will break anything, but you'll get strings that don't match the english one which does not make much sense in my opinion.

regarding the docs workflow i really don't see the point to pull outdated strings before pushing an updated source.

I think the optimal workflow is to push the source at each merge and pull before each release.

@humitos
Copy link
Member Author

humitos commented Aug 7, 2018

@xrmx 👍 to all you said :)

I think the optimal workflow is to push the source at each merge and pull before each release.

I'm not sure how to make this automatically in each merge, but I think that we could do this easily on each release at least.

Also, there is an issue #4471 that suggests a way to include a checking in the CI.

@humitos
Copy link
Member Author

humitos commented Aug 7, 2018

I'm closing this PR since I need permissions to push to Transifex first. After that, I will run pull and create a new PR.

@humitos humitos closed this Aug 7, 2018
@humitos humitos deleted the humitos/translations/app-update branch August 7, 2018 15:00
@xrmx
Copy link
Contributor

xrmx commented Aug 7, 2018

The push can be automated in travis, and the source may be commited with the pulled translation at release time?

@ewjoachim
Copy link
Contributor

For the sake of it, the doc on conditional stages on Travis:
https://docs.travis-ci.com/user/conditional-builds-stages-jobs/#conditional-stages

And an example integration of django-oscar that pushes to transifex from travis:
https://searchcode.com/file/92738132/transifex.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants