Changeset fd6da93 in OpenWorkouts-current for ow/models/user.py


Ignore:
Timestamp:
Feb 26, 2019, 11:11:43 AM (5 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current, feature/docs, master
Children:
a4e4799
Parents:
d411dae
Message:

(#56) Add support for different locale/language:

  • Let users choose their lang/locale in the edit profile page
  • Set the currently selected locale as a cookie (following pyramid docs on how to set the locale using the default locale negotiator)
  • Save the locale setting for each user as an attribute on the User model
  • Set the proper locale as a cookie on login
  • Unset the locale cookie on logout

Default available locales for now are en (english) and es (spanish)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/models/user.py

    rd411dae rfd6da93  
    3737        self.picture = kw.get('picture', None)  # blob
    3838        self.timezone = kw.get('timezone', 'UTC')
     39        self.locale = kw.get('locale', 'en')
    3940        self.__password = None
    4041        self.last_workout_id = 0
Note: See TracChangeset for help on using the changeset viewer.