django.po in the git repository?

362 views
Skip to first unread message

Blanca Mancilla

unread,
Nov 2, 2016, 9:12:10 PM11/2/16
to montrea...@googlegroups.com
Right. So after the talk by Greg Ward: Version control worst practices, yesterday at the Montreal Python Meetup, I am a bit intimidated to ask my question. However, here it goes:

I am working in a bilingual django project, and found that the django.po file is not commited to the git repository. This means that I have to manually update this file in dev, staging and prod to propagate my translations. Uhm, not ideal. I have researched whether I should add this translations file to the repos or not but have not found any conclusive arguments.

Can somebody shed a light, to avoid using my git repo as a backup ;-)

(Greg, thanks for the talk!)

bm

Rory Geoghegan

unread,
Nov 2, 2016, 9:26:25 PM11/2/16
to montrea...@googlegroups.com
Your .po file (as produced from makemessages, right?) does look like a ‘build artifact’ that does not sound like it should be committed, but once you’ve translated the file (and done work on it!), it absolutely should be committed into the repository. Especially since a given translated .po file lines up with a specific version of the code. The only caveat is that since .po files aren’t really well ordered, you have to use special pofile tools to merge different .po files from different branches.

For example, the Montreal Python django web site https://github.com/mtlpy/mtlpyweb keeps it’s po files in source control (https://github.com/mtlpy/mtlpyweb/blob/master/locale/fr/LC_MESSAGES/django.po). Although maybe it should not be taken as an example of best practice because some genius also committed the django.mo file (probably because he can’t write a good .gitignore file), which should not be committed because it’s programatically created from the po file.

—Rory
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "Montréal-Python".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse montrealpytho...@googlegroups.com.
Pour envoyer un message à ce groupe, envoyez un e-mail à l'adresse montrea...@googlegroups.com.
Visitez ce groupe à l'adresse https://groups.google.com/group/montrealpython.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

marco

unread,
Nov 2, 2016, 10:04:57 PM11/2/16
to Montréal-Python
I can't see any way around committing the .po files in order to keep all your translations, buuut .... we started using transifex.com, which stores the translations for you, meaning you don't have to commit the .po files any more. You just push new messages to transifex and then pull the translations whenever you need it. I'm sure there are other services similar to transifex

Blanca Mancilla

unread,
Nov 5, 2016, 11:17:12 AM11/5/16
to montrea...@googlegroups.com
Thanks Rory, that makes sense. The argument I always found was that the .po file was "calculated" so it should not be commited, but it did not make sense to rewrite the translations each time, in each server. The .po file will be commited!

Marco, interesting option. However, not an option for this project. Have you found any caveats with it (transifex, that is)?

bm

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "Montréal-Python".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse montrealpython+unsubscribe@googlegroups.com.
Pour envoyer un message à ce groupe, envoyez un e-mail à l'adresse montrealpython@googlegroups.com.

Visitez ce groupe à l'adresse https://groups.google.com/group/montrealpython.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.



--
Nothing is more expensive than a missed opportunity.

marco

unread,
Nov 20, 2016, 1:45:13 PM11/20/16
to Montréal-Python
hmm .. off the top of my head, the main challenge has been figuring out an effective workflow for integrating the translations. Who pushes the messages to transifex? and when to pull them back into the project? and how to ensure there are no regressions when translations are required on multiple development branches? ... things like that. it's still a huge improvement in many respects to django rosetta. If you can automate the steps required in the workflow, it would be much better eg: http://docs.transifex.com/integrations/jenkins/


On Saturday, 5 November 2016 11:17:12 UTC-4, Blanca Mancilla wrote:
Thanks Rory, that makes sense. The argument I always found was that the .po file was "calculated" so it should not be commited, but it did not make sense to rewrite the translations each time, in each server. The .po file will be commited!

Marco, interesting option. However, not an option for this project. Have you found any caveats with it (transifex, that is)?

bm
On Wed, Nov 2, 2016 at 10:04 PM, marco <notifi...@marco.link> wrote:
I can't see any way around committing the .po files in order to keep all your translations, buuut .... we started using transifex.com, which stores the translations for you, meaning you don't have to commit the .po files any more. You just push new messages to transifex and then pull the translations whenever you need it. I'm sure there are other services similar to transifex


On Wednesday, 2 November 2016 21:12:10 UTC-4, Blanca Mancilla wrote:
Right. So after the talk by Greg Ward: Version control worst practices, yesterday at the Montreal Python Meetup, I am a bit intimidated to ask my question. However, here it goes:

I am working in a bilingual django project, and found that the django.po file is not commited to the git repository. This means that I have to manually update this file in dev, staging and prod to propagate my translations. Uhm, not ideal. I have researched whether I should add this translations file to the repos or not but have not found any conclusive arguments.

Can somebody shed a light, to avoid using my git repo as a backup ;-)

(Greg, thanks for the talk!)

bm

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "Montréal-Python".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse montrealpytho...@googlegroups.com.
Pour envoyer un message à ce groupe, envoyez un e-mail à l'adresse montrea...@googlegroups.com.

Visitez ce groupe à l'adresse https://groups.google.com/group/montrealpython.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages