Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
96268e76
Commit
96268e76
authored
7 years ago
by
Eugen
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix wording on admin instances view, fix typos in language detector spec (#2106)
parent
c6a4ab3b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/locales/en.yml
+3
-3
3 additions, 3 deletions
config/locales/en.yml
spec/lib/language_detector_spec.rb
+7
-8
7 additions, 8 deletions
spec/lib/language_detector_spec.rb
with
10 additions
and
11 deletions
config/locales/en.yml
+
3
−
3
View file @
96268e76
...
...
@@ -115,9 +115,9 @@ en:
title
:
Domain Blocks
undo
:
Undo
instances
:
account_count
:
A
ccounts
domain_name
:
Domain
name
title
:
Instances
account_count
:
Known a
ccounts
domain_name
:
Domain
title
:
Known
Instances
pubsubhubbub
:
callback_url
:
Callback URL
confirmed
:
Confirmed
...
...
This diff is collapsed.
Click to expand it.
spec/lib/language_detector_spec.rb
+
7
−
8
View file @
96268e76
# frozen_string_literal: true
require
'rails_helper'
describe
LanguageDetector
do
describe
'to_iso_s'
do
it
'detects english language'
do
string
=
'Hello and welcome to mast
a
don'
string
=
'Hello and welcome to mast
o
don'
result
=
described_class
.
new
(
string
).
to_iso_s
expect
(
result
).
to
eq
:en
end
it
'detects spanish language'
do
string
=
'Obtener un Hola y bienvenidos a Mast
a
don'
string
=
'Obtener un Hola y bienvenidos a Mast
o
don'
result
=
described_class
.
new
(
string
).
to_iso_s
expect
(
result
).
to
eq
:es
end
describe
'when language cant be detected'
do
describe
'when language can
\'
t be detected'
do
it
'confirm language engine cant detect'
do
result
=
WhatLanguage
.
new
(
:all
).
language_iso
(
''
)
expect
(
result
).
to
be_nil
...
...
@@ -26,17 +25,17 @@ describe LanguageDetector do
describe
'with an account'
do
it
'uses the account locale when present'
do
user
=
double
(
:user
,
locale:
'fr'
)
user
=
double
(
:user
,
locale:
'fr'
)
account
=
double
(
:account
,
user:
user
)
result
=
described_class
.
new
(
''
,
account
).
to_iso_s
result
=
described_class
.
new
(
''
,
account
).
to_iso_s
expect
(
result
).
to
eq
:fr
end
it
'uses default locale when account is present but has no locale'
do
user
=
double
(
:user
,
locale:
nil
)
user
=
double
(
:user
,
locale:
nil
)
account
=
double
(
:accunt
,
user:
user
)
result
=
described_class
.
new
(
''
,
account
).
to_iso_s
result
=
described_class
.
new
(
''
,
account
).
to_iso_s
expect
(
result
).
to
eq
:en
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