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
Show more breadcrumbs
Cassiopée
nghyd
Commits
ce06645a
Commit
ce06645a
authored
2 years ago
by
Dorchies David
Browse files
Options
Downloads
Plain Diff
Merge branch '499-error-404-on-language-files-load' into 'devel'
Resolve "Error 404 on language files load" Closes
#499
See merge request
!149
parents
5dfd1310
1c13e833
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!149
Resolve "Error 404 on language files load"
Pipeline
#139594
passed
2 years ago
Stage: jalhyd
Stage: install
Stage: build
Stage: clean-stale-branches
Stage: deploy-dev
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
jalhyd_branch
+1
-1
1 addition, 1 deletion
jalhyd_branch
src/app/services/internationalisation.service.ts
+7
-2
7 additions, 2 deletions
src/app/services/internationalisation.service.ts
with
8 additions
and
3 deletions
jalhyd_branch
+
1
−
1
View file @
ce06645a
311-parametres-lies-ameliorer-les-informations-sur-la-cible
devel
This diff is collapsed.
Click to expand it.
src/app/services/internationalisation.service.ts
+
7
−
2
View file @
ce06645a
...
@@ -60,6 +60,11 @@ export class I18nService extends Observable implements Observer {
...
@@ -60,6 +60,11 @@ export class I18nService extends Observable implements Observer {
* @param code ISO 639-1 language code
* @param code ISO 639-1 language code
*/
*/
public
async
setLanguage
(
code
:
string
)
{
public
async
setLanguage
(
code
:
string
)
{
/** excluded calculators */
const
childCalculatorType
:
CalculatorType
[]
=
[
CalculatorType
.
Section
,
CalculatorType
.
Structure
,
CalculatorType
.
CloisonAval
,
CalculatorType
.
YAXN
];
// ensure 2-letter language code
// ensure 2-letter language code
code
=
code
.
substring
(
0
,
2
);
code
=
code
.
substring
(
0
,
2
);
// is language supported ?
// is language supported ?
...
@@ -75,7 +80,7 @@ export class I18nService extends Observable implements Observer {
...
@@ -75,7 +80,7 @@ export class I18nService extends Observable implements Observer {
const
promisesList
:
Promise
<
any
>
[]
=
[];
const
promisesList
:
Promise
<
any
>
[]
=
[];
for
(
const
ct
in
CalculatorType
)
{
for
(
const
ct
in
CalculatorType
)
{
const
calcType
=
Number
(
ct
);
const
calcType
=
Number
(
ct
);
if
(
!
isNaN
(
calcType
))
{
if
(
!
isNaN
(
calcType
)
&&
!
childCalculatorType
.
includes
(
calcType
)
)
{
promisesList
.
push
(
this
.
loadLocalisation
(
calcType
).
catch
((
err
)
=>
{
/* silent fail */
}));
promisesList
.
push
(
this
.
loadLocalisation
(
calcType
).
catch
((
err
)
=>
{
/* silent fail */
}));
}
}
}
}
...
@@ -118,7 +123,7 @@ export class I18nService extends Observable implements Observer {
...
@@ -118,7 +123,7 @@ export class I18nService extends Observable implements Observer {
}
}
}
else
{
}
else
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
();
// does nothing but complies with Promise expectation
resolve
(
undefined
);
// does nothing but complies with Promise expectation
});
});
}
}
}
}
...
...
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