Skip to content

Commit

Permalink
Use locale code as param
Browse files Browse the repository at this point in the history
  • Loading branch information
virolea committed Sep 12, 2024
1 parent aa84dd8 commit d14f4cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/rosetta/locales/translations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def index
private

def set_locale
@locale = Locale.find(params[:locale_id])
@locale = Locale.find_by!(code: params[:locale_id])
end
end
end
4 changes: 4 additions & 0 deletions app/models/rosetta/locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def default_locale
end
end

def to_param
code
end

def default_locale?
@default ||= false
end
Expand Down

0 comments on commit d14f4cc

Please sign in to comment.