portagenetwork / roadmap

Developed by the the Alliance in collaboration with University of Alberta, DMP Assistant a data management planning tool, forking the DMP Roadmap codebase
MIT License
6 stars 1 forks source link

Constants Within `app/models/` Files Not Translating As Expected With Gettext #794

Open aaronskiba opened 2 weeks ago

aaronskiba commented 2 weeks ago

Please complete the following fields as applicable:

What version of the DMPRoadmap code are you running? (e.g. v2.2.0) 4.1.1+portage-4.1.0-uat-3 4.1.1+portage-4.1.0-alpha-2 Expected behaviour: Example:

# app/models/plan.rb
  VISIBILITY_MESSAGE = {
    organisationally_visible: _('organisational'),
    publicly_visible: _('public'),
    is_test: _('test'),
    privately_visible: _('private')
  }.freeze
3.0.5 :001 > I18n.locale
 => :"en-CA" 
3.0.5 :002 > _('organisational')
 => "organizational" 
3.0.5 :003 > I18n.locale = :"fr-CA"
 => :"fr-CA" 
3.0.5 :004 > _('organisational')
 => "organisationnel" 

We would expect expect Plan::VISIBILITY_MESSAGE[:organisationally_visible] to behave the same way when changing the locale.

Actual behaviour:


3.0.5 :001 > I18n.locale
 => :"en-CA" 
3.0.5 :002 > Plan::VISIBILITY_MESSAGE[:organisationally_visible]
 => "organizational" 
3.0.5 :003 > I18n.locale = :"fr-CA"
 => :"fr-CA" 
3.0.5 :004 > Plan::VISIBILITY_MESSAGE[:organisationally_visible]
 => "organizational"
lagoan commented 1 week ago

@aaronskiba will test changes in default locale configuration.