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

Reorganized locale directories and added Transifex for managing the translation process #866

Merged
merged 29 commits into from Mar 12, 2019

Conversation

tobiasmcnulty
Copy link
Member

@tobiasmcnulty tobiasmcnulty commented Feb 18, 2019

We had some old PO files for English and French in the repo, but they were sorely out of date and it's high time we switched to something more modern for managing the translation process. I also discovered recently that we were not running compilemessages during deploy, so the few translations we did have weren't even showing up. That has now been fixed, so let's add and update translations! 😄

This PR:

  • Adds a new locale directories in the dashboard app and at the project level (in addition to docs/locale/ that we already had). This gives us one locale/ directory for each website domain and allows us to map the corresponding PO files to different places in Transifex.
  • Adds transifex-client to the dev requirements, a new .tx/config to do the locale -> resource mapping, and some process docs for managing translations.
  • Updates the one translation that we already had (French) with the updated translation files from Transifex
  • Includes a script to update translations in the future, based on: https://github.com/django/django-docs-translations/blob/stable/2.1.x/manage_translations.py#L54-L72

Much credit due to @m-aciek and @claudep for helping to brainstorm and arrive at this solution!

One question: I copied the list of supported languages from the script in django-docs-translations, but I'm not sure if we need to keep those in sync or not. I guess we should at least aim to support at least those languages but potentially more, for djangoproject.com...(?)

Finally, a few things that can or will happen separately from this PR:

  • I opted not to include translations of other languages in this stage to help keep the size of the PR down. But if/when this is approved and merged, we should pull and commit all the new translations shortly after.
  • I also opted not to add any new strings (yet). There is a separate issue for localizing the fundraising app which could be a good first step after this (Localize the fundraising app #377).
  • We'll need to decide how we want language switching to work for sites other than docs. See disable LocaleMiddleware for docs.djangoproject.com #862.

@tobiasmcnulty tobiasmcnulty changed the base branch from single-local-dir to master February 18, 2019 14:41
Copy link
Contributor

@m-aciek m-aciek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to what I've written in email, it occures that I didn't published my review (can't do it in mobile view, had to switch to desktop). Sorry for confusion.

Publishing now :)

locale/en/LC_MESSAGES/django.po Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
@tobiasmcnulty tobiasmcnulty changed the title [WIP] use Transifex for managing translation process use Transifex for managing translation process Feb 19, 2019
@tobiasmcnulty
Copy link
Member Author

Thanks for all your help and feedback @claudep and @m-aciek.

I think this should be ready for another review.

@tobiasmcnulty
Copy link
Member Author

@tobiasmcnulty
Copy link
Member Author

@m-aciek Would you like to give this another review?

And/or @timgraham would you like to review before merging?

Thanks!

README.rst Outdated Show resolved Hide resolved
README.rst Show resolved Hide resolved
@@ -0,0 +1,26 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs' PO files have sth more similar to:

Suggested change
# This file is distributed under the same license as the PACKAGE package.
# Copyright (C) Django Software Foundation and contributors
# This file is distributed under the same license as the djangoproject.com source files.

here.

Should it be set in Transifex to work automatically?

If it is configurable, I'd also suggest to drop the lines SOME DESCRIPTIVE TITLE. and FIRST AUTHOR <EMAIL@ADDRESS>, YEAR..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is mostly controlled by Transifex, I don't know yet if that can be customized or not. We could also remove French files from this commit, and add them with other languages in a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it can be changed in Transifex that would be great. Do you know if that's possible and where to do it if so? I'm not finding anything in the UI or their documentation...

Or for the Django docs is it handled through post-processing (like removal of the file locations)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Silly me. I just needed to change this in the source file, and then push/pull to update in the translations.

README.rst Outdated Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
requirements/dev.txt Outdated Show resolved Hide resolved
@tobiasmcnulty
Copy link
Member Author

This should be ready for another review.

@tobiasmcnulty tobiasmcnulty changed the title use Transifex for managing translation process Reorganized locale directories and added Transifex for managing the translation process Mar 9, 2019
@tobiasmcnulty tobiasmcnulty merged commit 68ecaee into master Mar 12, 2019
@tobiasmcnulty tobiasmcnulty deleted the transifex branch March 12, 2019 00:33
@tobiasmcnulty
Copy link
Member Author

This has been deployed!

Screenshot 2019-03-11 20 42 56

Screenshot 2019-03-11 20 43 07

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.

None yet

4 participants