Conversation
spec/features/visitors/i18n_spec.rb
Outdated
There was a problem hiding this comment.
I think we want to drop this I18n.locale = line because it would mask the work that the Accept-Language header should be doing
spec/features/visitors/i18n_spec.rb
Outdated
There was a problem hiding this comment.
I would set an explicit , locale: 'en') inside the t( here
config/application.rb
Outdated
There was a problem hiding this comment.
we might want to make this configurable, or different in the different environments? (ex make it %w[en] for production but then make it %w[en es] for test and development?
The reason is that if somebody visits the IDP today with a Spanish browser, they'd see a bunch of "NOT TRANSLATED YET" strings
|
Based on this build failure we probably need to add an |
config/application.yml.example
Outdated
There was a problem hiding this comment.
Should be plural per:
config.i18n.available_locales = Figaro.env.available_locales.split(' ')
9c1c0f9 to
0f38835
Compare
spec/rails_helper.rb
Outdated
There was a problem hiding this comment.
I don't think this should be an allow, IMO we should just set the locale each time. As written, during a test run, something could set the locale to something other than :en but it would always be read back as :en which is wrong
I18n.locale = :en
|
thanks @zachmargolis, still getting the hang of the semantics of rspec. updated PR w/ your feedback. |
There was a problem hiding this comment.
This method needs to be updated in order to accept the user's selection (URL param) for locale.
There was a problem hiding this comment.
Also, we need to add a method to sanitize the URL parameter. If the URL parameter does not match an available locale, it will throw an error.
There was a problem hiding this comment.
@amoose I am working on implementing the functionality with the params in a different branch, this was just focused on the HTTP headers, but I can roll it all into this one if that is preferred? https://github.com/18F/identity-idp/compare/bh-param-i18n
There was a problem hiding this comment.
ah ok! no problem. Then, let's strip the params[:locale] from this PR and push without my commit in there.
241f46b to
b20a97e
Compare
|
Looks like this needs to be rebased, Bhurst. I'm going to push the DevOps PR through today so I hope to merge this later. Please also squash the fixup commits 👍 |
b20a97e to
def0f9d
Compare
|
@amoose done! |
60a6d51 to
22c981d
Compare
This uses the http_accept_language gem to parse the
Accept-Languageheader and match it up with our available translations.