Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it good practice to do file versioning on .mo i18n files?

I've just discovered the .po and .mo files with Django.

They are used for internationalization and localization.

It looks like .po are plain text files whereas .mo are optimized byte compiled files from .po.

Process is always compiling to .mo after editing .po files.

What is the best option:

  1. Versionning only .po in git and have an automatic compilation from .po to .mo in the deployment process?
  2. Versionning both .po and .mo (maybe with a precommit hook for automatic compilation)?
like image 200
Benjamin Toueg Avatar asked Aug 30 '25 15:08

Benjamin Toueg


1 Answers

It is generally considered bad practice to version files that can be generated from the files already versioned, especially when those output files are binaries. It clutters the history with files Git is unable to version efficiently.

like image 77
1ace Avatar answered Sep 02 '25 05:09

1ace