views:

110

answers:

2

Should I check in *.mo translation files into my version control system?

This is a general question. But in particular I'm working on Django projects with git repositories.

+2  A: 

The general answer is:
if you do need those files to compile or to deploy (in shot: to "work" with) your component (set of files queried from your VCS), then yes, they should be stored in it (here: in Git).
This is the same for other kind of files (like project files for instance)

.mo files are particular:

django-admin.py compilemessages utility.

This tool runs over all available .po files and creates .mo files, which are binary files optimized for use by gettext

Meaning:

  • you should be able to rebuild them every time you need them (guarantying in effect that they are in synch with their .po couterparts)
  • Git is not so good with binary storage and that would avoid it to store a full version for every changes

So the specific answer is not so clear-cut:

  • if your po files are stables and will not evolve too often, you could definitively store the .mo file
  • you should absolutely store a big README file explaning how to generate mo from po files.
VonC
+2  A: 

The general answer is to not store generated contents in version control.

You can include it in tarball, if it requires rare tools, or even have separate repository or disconnected branch with only those generated files (like 'html' and 'man' branches in git.git repository).

Jakub Narębski