Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
d53cfc0c
Unverified
Commit
d53cfc0c
authored
Jul 13, 2021
by
Hadi Cheaito
Committed by
GitHub
Jul 13, 2021
Browse files
Options
Downloads
Patches
Plain Diff
Open graph displaying incorrect language bug (#2836)
* Open graph displaying incorrect language bug * Cleaning and Fixes
parent
e082cd2b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/application_controller.rb
+8
-3
8 additions, 3 deletions
app/controllers/application_controller.rb
app/views/layouts/application.html.erb
+1
-0
1 addition, 0 deletions
app/views/layouts/application.html.erb
with
9 additions
and
3 deletions
app/controllers/application_controller.rb
+
8
−
3
View file @
d53cfc0c
...
...
@@ -94,14 +94,18 @@ class ApplicationController < ActionController::Base
render
:migration_error
,
status:
500
unless
ENV
[
"DB_MIGRATE_FAILED"
].
blank?
end
#
S
et
s the appropriate locale.
def
user_locale
(
user
=
current_
user
)
locale
=
if
user
&&
user
.
language
!=
'default'
#
D
et
ermines proper locale to be used by calling user_locale with params based on if room owner exists
def
determine_locale
(
user
)
if
user
&&
user
.
language
!=
'default'
user
.
language
else
Rails
.
configuration
.
default_locale
.
presence
||
http_accept_language
.
language_region_compatible_from
(
I18n
.
available_locales
)
end
end
# Sets the appropriate locale.
def
user_locale
(
user
=
current_user
)
locale
=
determine_locale
(
user
)
begin
I18n
.
locale
=
locale
.
tr
(
'-'
,
'_'
)
unless
locale
.
nil?
rescue
...
...
@@ -110,6 +114,7 @@ class ApplicationController < ActionController::Base
I18n
.
locale
=
"en"
end
end
helper_method
:user_locale
# Checks to make sure that the admin has changed his password from the default
def
check_admin_password
...
...
This diff is collapsed.
Click to expand it.
app/views/layouts/application.html.erb
+
1
−
0
View file @
d53cfc0c
...
...
@@ -31,6 +31,7 @@
<title>
<%=
yield
(
:page_title
).
present?
?
yield
(
:page_title
)
:
t
(
"bigbluebutton"
)
%>
</title>
<meta
property=
"og:title"
content=
"
<%=
yield
(
:page_title
).
present?
?
yield
(
:page_title
)
:
t
(
"bigbluebutton"
)
%>
"
/>
<meta
property=
"og:type"
content=
"website"
/>
<meta
property=
"og:locale"
content=
<%=
user_locale
(
@room
&
.
owner
)
%>
/
>
<meta
property=
"og:description"
content=
"
<%=
yield
(
:page_desc
).
present?
?
yield
(
:page_desc
)
:
t
(
"landing.about"
,
href:
"Greenlight"
,
locale: :en
)
%>
"
/>
<meta
property=
"og:url"
content=
"
<%=
request
.
base_url
%>
"
/>
<meta
property=
"og:image"
content=
"
<%=
logo_image
%>
"
/>
...
...
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