Last active
April 15, 2018 22:59
-
-
Save jourdanrodrigues/4b0fd69d9526b641fc060f889365da65 to your computer and use it in GitHub Desktop.
A custom "compilemessages" Django 1.11 command to compile only the "LOCALE_PATHS" settings (meant for who uses the environment inside the project).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from django.core.management.commands import compilemessages | |
class Command(compilemessages.Command): | |
def compile_messages(self, locations): | |
# If a received location match a locale set, send to compile | |
if not any(location[0].startswith(locale) for location in locations for locale in settings.LOCALE_PATHS): | |
return | |
super(Command, self).compile_messages(locations) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment