Skip to content

Commit

Permalink
fix issue silverapp#640 l10n localization of billing documents contex…
Browse files Browse the repository at this point in the history
…t objects (eg. date)
  • Loading branch information
jeromecc committed Feb 8, 2019
1 parent c5f27d7 commit ef86d7d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion silver/models/documents/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from django.db import transaction as db_transaction
from django.db.models import Max, ForeignKey, F
from django.template.loader import select_template
from django.utils import timezone
from django.utils import timezone, translation
from django.utils.encoding import python_2_unicode_compatible, force_text
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
Expand Down Expand Up @@ -444,6 +444,9 @@ def get_template_context(self, state=None):
if state is None:
state = self.state

if settings.USE_I18N:
translation.activate(settings.LANGUAGE_CODE)

return {
'document': self,
'provider': provider,
Expand Down

0 comments on commit ef86d7d

Please sign in to comment.