AlvaroAV
AlvaroAV

Reputation: 10563

Django - Rosetta : Ignore .mo files issue

I'm using:

What I'm trying:

I've been using Rosetta and Django for the past year and never had an issue like this. I want to ignore .mo files, but not the .po ones. The .mo files represent the compiled value of the .po files. My goal is when I change any translation in develop, I want git to ignore the .mo files.

I have 9 languages in the actual project, I tried to add in my .gitignore file this:

*.mo

but it doesn't work. I've also tried:

myapp/locale/*/LC_MESSAGES/*.mo

but didn't work neither, I tried:

myapp/locale/en/LC_MESSAGES/*.mo
myapp/locale/fr/LC_MESSAGES/*.mo
myapp/locale/es/LC_MESSAGES/*.mo
myapp/locale/tr/LC_MESSAGES/*.mo

This works but I don't want to add each language path to the .mo files because in the future I'd probably need to add more languages and want to avoid modifying the .gitignore file each time.

Any ideas about how to achieve this ?

More info:

Upvotes: 1

Views: 1549

Answers (2)

Timo
Timo

Reputation: 3227

Steps are

  1. git rm -r --cached . which will ignore already tracked files and which are in your .gitignore
  2. git add .

  3. git commit -m ".gitignore is now working"

Upvotes: 1

user3512925
user3512925

Reputation:

Once I had same issue to remove *.sql files from git, and my problem was that the .sql file was in the repository, so although I delete in develop and add *.sql to gitignore, git never ignore them because they were already in the repository.

So I recommend you to delete all .mo files from repository, and then add *.mo to your .gitignore file and upload it, then it should ignore all your .mo files.

Upvotes: 5

Related Questions