Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Mastodon
Commits
d728fa99
Commit
d728fa99
authored
5 months ago
by
Claire
Browse files
Options
Downloads
Patches
Plain Diff
Fix follow recommendation moderation page default language when using regional variant (#32580)
parent
044dd3f7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models/follow_recommendation_filter.rb
+12
-1
12 additions, 1 deletion
app/models/follow_recommendation_filter.rb
with
12 additions
and
1 deletion
app/models/follow_recommendation_filter.rb
+
12
−
1
View file @
d728fa99
...
...
@@ -11,7 +11,7 @@ class FollowRecommendationFilter
attr_reader
:params
,
:language
def
initialize
(
params
)
@language
=
params
.
delete
(
'language'
)
||
I18n
.
locale
@language
=
usable_language
(
params
.
delete
(
'language'
)
||
I18n
.
locale
)
@params
=
params
end
...
...
@@ -22,4 +22,15 @@ class FollowRecommendationFilter
Account
.
includes
(
:account_stat
).
joins
(
:follow_recommendation
).
merge
(
FollowRecommendation
.
localized
(
@language
).
order
(
rank: :desc
))
end
end
private
def
usable_language
(
locale
)
return
locale
if
Trends
.
available_locales
.
include?
(
locale
)
locale
=
locale
.
to_s
.
split
(
/[_-]/
).
first
return
locale
if
Trends
.
available_locales
.
include?
(
locale
)
nil
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment