-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Core: Make contact language required information (SH-439, SH-428) #897
Conversation
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('shuup', '0010_update_managers'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be dependent on 11 and this migration 12.
elif self.customer: | ||
lang = self.customer.language | ||
|
||
if not is_existing_language(lang): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this if really needed it seems that after the customer doesn't exist the language is settings.LANGUAGE_CODE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking this too, but source.language can be set to something strange thus must be validated. imo.
LGTM after these few issues. Also changelog could be added since there is new things in this PR. |
We are relying on Babel when it comes to translations. It was, however, possible to use languages that were extinct long time ago. These helpers will help you identify valid languages for Shuup coding environment. Refs SH-439
Also fix issue with extinct languages by using the newly introduced helpers in Shuup. Refs SH-439
Refs SH-439
Source language was never transferred back to Order which caused language being lost when Source was used as a base for Order. Refs SH-439, SH-428
Old language was pretty much unused and the value was only applied if the programmer knew that it should be set. Change the functionality so that if the `OrderSource` has no language set, the customers language will be used as a language for `OrderSource` too. `OrderSource` must have a language set, so if no valid languages are found, source will use `settings.LANGUAGE_CODE`. Also add tests to show that this change makes notification emails to be send in proper language. Refs SH-428
Add helpers to identify existing languages
We are relying on Babel when it comes to translations. It was,
however, possible to use languages that were extinct long time ago.
These helpers will help you identify valid languages for Shuup coding
environment.
Add
LanguageFormField
Also fix issue with extinct languages by using the
newly introduced helpers in Shuup.
** Core: Start actually using
Contact.language
**Core: Fix bug with order_source.language
Source language was never transferred back to Order which caused language being lost when Source was used as a base for Order.
Core: Make
OrderSource.language
usableOld language was pretty much unused and the value was
only applied if the programmer knew that it should be set.
Change the functionality so that if the
OrderSource
has no language set, the customers
language will be used as a language for
OrderSource
too.OrderSource
must have a language set, so if no validlanguages are found, source will use
settings.LANGUAGE_CODE
.Also add tests to show that this change makes notification emails to
be send in proper language.
Refs SH-439, SH-428