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

Messages in user's language #28

Open
ghost opened this issue Oct 27, 2009 · 3 comments
Open

Messages in user's language #28

ghost opened this issue Oct 27, 2009 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 27, 2009

Users expect to get e-mails in their native languages.
So the notification should somehow know and use user's language.
Does django-notification have this feature?

@jezdez
Copy link
Contributor

jezdez commented Oct 27, 2009

Yes, there is a function called get_notification_language() (https://github.com/jtauber/django-notification/blob/master/notification/models.py#L199). It will use a setting NOTIFICATION_LANGUAGE_MODULE to load the user language from an arbitrary model and should be formatted like <app>.<model>. The model should have two fields: a foreignkey to the User class (user) and a language field (language) which stores the language code (e.g. en).

In Pinax for example we use this model:
https://github.com/pinax/pinax/blob/7118dc9367c75de47be80a6ced2b4afc0dceb573/pinax/apps/account/models.py#L16

@ghost
Copy link
Author

ghost commented Oct 27, 2009

Thank you! Now it's clear. Probably you will want to add this comment to the documentation.

@bjunix
Copy link

bjunix commented Dec 14, 2009

I think there should also be a fallback to the default language code:
LANGUAGE_CODE defined in settings.py

What do you think? I just put up a quick fix at my fork: https://github.com/bjunix/django-notification/commit/da1a81fda93e7c1cd743d0b5f2eac217c05c8668

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

2 participants