I'm trying to figure out my way with the Django localistion stuff and from what i've understood, the makemessages
command needs to be run every time you change some strings in code. I was thinking of simplifying this process by using a server-side Git hook.
I have no knowledge about Git hooks and couldn't find any resources on the web that did something like this. Is there a reason why one shouldn't have a Git hook to do something like this? If not, could you explain on how I could get the makemessages
command to be run every time someone commits code to the repository?
Thanks
Sure thing!
Add a script called post-receive
to the server side git repository in the .git/hooks/
directory.
Make sure that the file is executable.
Call makemessages from the script.
Done! (I think...)
You'll find some example scripts in the directory already, with most available hooks.
Have a look at the online Pro Git book if you need more information on Git hooks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With