Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nghyd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
Cassiopée
nghyd
Commits
c74c6510
Commit
c74c6510
authored
4 years ago
by
mathias.chouet
Browse files
Options
Downloads
Patches
Plain Diff
Fix language code detection for more than 2 letters codes
parent
2f42cdb5
No related branches found
No related tags found
1 merge request
!96
WIP: Resolve "Simplifier les composants de résultats"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/services/internationalisation.service.ts
+2
-1
2 additions, 1 deletion
src/app/services/internationalisation.service.ts
with
2 additions
and
1 deletion
src/app/services/internationalisation.service.ts
+
2
−
1
View file @
c74c6510
...
...
@@ -55,11 +55,12 @@ export class I18nService extends Observable implements Observer {
/**
* Defines the current language code from its ISO 639-1 code (2 characters) or locale code
* (ex: "fr", "en", "fr_FR", "en-US")
* @see this.languageCodeFromLocaleCode()
*
* @param code ISO 639-1 language code
*/
public
async
setLanguage
(
code
:
string
)
{
// ensure 2-letter language code
code
=
code
.
substring
(
0
,
2
);
// is language supported ?
if
(
!
Object
.
keys
(
this
.
_availableLanguages
).
includes
(
code
))
{
throw
new
Error
(
`LANGUAGE_UNSUPPORTED "
${
code
}
"`
);
...
...
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