Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translations of Form Fields and Error Messages Not Working #23

Open
andre-fuchs opened this issue May 15, 2023 · 2 comments
Open

Translations of Form Fields and Error Messages Not Working #23

andre-fuchs opened this issue May 15, 2023 · 2 comments

Comments

@andre-fuchs
Copy link

I use this package to implement an IBAN and a BIC field in a form. The multilingual site is based on the Wagtail CMS and the Django framework, of course. The two fields are working like a charm, only the translations are missing. I have seen the locale directory of this package and found all necessary translations in the .PO-files. How do I get them to work? Here are my language settings, to give a bit more context:

# settings.py
LANGUAGE_CODE = 'en'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True

WAGTAIL_CONTENT_LANGUAGES = LANGUAGES = [
    ('en', _('English')),
    ('de', _('German')),
]

LOCALE_PATHS = (
    os.path.join(BASE_DIR, 'locale'),
)
# forms.py
class SubscriptionForm(forms.Form):
    iban = IBANFormField(required=False, label=_('IBAN'))
    bic = BICFormField(required=False, label=_('BIC'))
@ralphje
Copy link
Owner

ralphje commented Jun 22, 2023

Could you elaborate which translations are missing exactly?

The translations for IBAN, BIC, English and German will be missing because you probably have a po file with these defined as well. The other translations should work from what I can see, though perhaps the locale path override provides issues.

@toabi
Copy link

toabi commented Oct 9, 2023

I just integrated this to my project, which uses

LANGUAGE_CODE = 'de-de'
TIME_ZONE = 'Europe/Berlin'
USE_I18N = True
USE_TZ = True

on validation errors I still get an english error strings for the VATNumberField.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants