Skip to content

Commit

Permalink
change name of cancel.svg and use correct language to display language
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Aug 6, 2024
1 parent 40d0431 commit 8ac2e1e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
File renamed without changes
2 changes: 1 addition & 1 deletion app/assets/stylesheets/crud.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ footer {
.icon-list { background-image: url('assets/list.png'); }
.icon-zoom-in { background-image: url('assets/search.svg'); }
.icon-export { background-image: url('assets/export.svg'); }
.icon-close { background-image: url('assets/x.svg'); }
.icon-close { background-image: url('assets/cancel.svg'); }
11 changes: 4 additions & 7 deletions app/helpers/auth_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ def devise?
AuthConfig.keycloak? || Rails.env.test?
end

def language_selector # rubocop:disable Metrics/AbcSize
languages = I18nData.languages(I18n.locale).to_a.map do |e|
[e.second.titleize, e.first.downcase.to_sym]
end
languages = languages.select { |e| I18n.available_locales.include? e.second }
languages = languages.map do |e|
[e.first, url_for(locale: e.second)]
def language_selector
languages = I18n.available_locales.map { |e| e.to_s }.map do |lang_code|
language = I18nData.languages(lang_code)[lang_code.upcase]
[language, url_for(locale: lang_code)]
end
options_for_select(languages, url_for(locale: I18n.locale))
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/routing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
context "Set locale via dropdown" do
before(:each) do
visit people_path
select 'Italienisch', from: "i18n_language"
select 'Italiano', from: "i18n_language"
default_url_options[:locale] = :it
end

Expand Down

0 comments on commit 8ac2e1e

Please sign in to comment.