Skip to content

Commit

Permalink
[#3060] set ckan.locale_default as language for FormEncode
Browse files Browse the repository at this point in the history
- If this is not done FormEncode takes the system LANG for its
  validation messages which might lead to unexpected behaviour.
- This also leads to the tests passing on machines where the LANG is
  set to something other then `en`
- More information can be found at
  http://www.formencode.org/en/latest/Validator.html#localization-of-error-messages-i18n
  • Loading branch information
k-nut committed May 27, 2016
1 parent ed2196b commit 89dab0c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ckan/lib/navl/dictization_functions.py
Expand Up @@ -6,6 +6,9 @@

from ckan.common import _

default_lang = config.get('ckan.locale_default', 'en')
fe.api.set_stdtranslation(domain="FormEncode", languages=default_lang)

class Missing(object):
def __unicode__(self):
raise Invalid(_('Missing value'))
Expand Down

0 comments on commit 89dab0c

Please sign in to comment.