Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
c24a5439
Commit
c24a5439
authored
6 years ago
by
kevin.dezaphi
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #8218 update lang home
parent
b3049dc7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/frontend/lang/lang-en.ts
+3
-0
3 additions, 0 deletions
src/frontend/lang/lang-en.ts
src/frontend/lang/lang-fr.ts
+3
-0
3 additions, 0 deletions
src/frontend/lang/lang-fr.ts
src/frontend/plugins/timeAgo.pipe.ts
+19
-16
19 additions, 16 deletions
src/frontend/plugins/timeAgo.pipe.ts
with
25 additions
and
16 deletions
src/frontend/lang/lang-en.ts
+
3
−
0
View file @
c24a5439
...
@@ -636,5 +636,8 @@ export const LANG_EN = {
...
@@ -636,5 +636,8 @@ export const LANG_EN = {
"
menu
"
:
"
Menu
"
,
"
menu
"
:
"
Menu
"
,
"
visaUser
"
:
"
Visa
"
,
"
visaUser
"
:
"
Visa
"
,
"
signUser
"
:
"
Signatory
"
,
"
signUser
"
:
"
Signatory
"
,
"
fewSeconds
"
:
"
few seconde
"
,
"
oneMinute
"
:
"
one minute
"
,
"
oneHour
"
:
"
one hour
"
,
};
};
This diff is collapsed.
Click to expand it.
src/frontend/lang/lang-fr.ts
+
3
−
0
View file @
c24a5439
...
@@ -661,4 +661,7 @@ export const LANG_FR = {
...
@@ -661,4 +661,7 @@ export const LANG_FR = {
"
menu
"
:
"
Menu
"
,
"
menu
"
:
"
Menu
"
,
"
visaUser
"
:
"
Viseur
"
,
"
visaUser
"
:
"
Viseur
"
,
"
signUser
"
:
"
Signataire
"
,
"
signUser
"
:
"
Signataire
"
,
"
fewSeconds
"
:
"
quelques secondes
"
,
"
oneMinute
"
:
"
une minute
"
,
"
oneHour
"
:
"
une heure
"
,
};
};
This diff is collapsed.
Click to expand it.
src/frontend/plugins/timeAgo.pipe.ts
+
19
−
16
View file @
c24a5439
import
{
Pipe
,
PipeTransform
,
NgZone
,
ChangeDetectorRef
,
OnDestroy
}
from
"
@angular/core
"
;
import
{
Pipe
,
PipeTransform
,
NgZone
,
ChangeDetectorRef
,
OnDestroy
}
from
"
@angular/core
"
;
import
{
LANG
}
from
'
../app/translate.component
'
;
@
Pipe
({
@
Pipe
({
name
:
'
timeAgo
'
,
name
:
'
timeAgo
'
,
pure
:
false
pure
:
false
})
})
export
class
TimeAgoPipe
implements
PipeTransform
,
OnDestroy
{
export
class
TimeAgoPipe
implements
PipeTransform
,
OnDestroy
{
private
timer
:
number
;
private
timer
:
number
;
lang
:
any
=
LANG
;
constructor
(
private
changeDetectorRef
:
ChangeDetectorRef
,
private
ngZone
:
NgZone
)
{}
constructor
(
private
changeDetectorRef
:
ChangeDetectorRef
,
private
ngZone
:
NgZone
)
{}
transform
(
value
:
string
)
{
transform
(
value
:
string
)
{
this
.
removeTimer
();
this
.
removeTimer
();
...
@@ -15,18 +18,18 @@ export class TimeAgoPipe implements PipeTransform, OnDestroy {
...
@@ -15,18 +18,18 @@ export class TimeAgoPipe implements PipeTransform, OnDestroy {
let
minuteNumber
=
(
'
0
'
+
d
.
getMinutes
()).
slice
(
-
2
);
let
minuteNumber
=
(
'
0
'
+
d
.
getMinutes
()).
slice
(
-
2
);
let
now
=
new
Date
();
let
now
=
new
Date
();
let
month
=
[];
let
month
=
[];
month
[
0
]
=
"
Jan.
"
;
month
[
0
]
=
this
.
lang
.
januaryShort
;
month
[
1
]
=
"
Fév.
"
;
month
[
1
]
=
this
.
lang
.
februaryShort
;
month
[
2
]
=
"
Mars
"
;
month
[
2
]
=
this
.
lang
.
marchShort
;
month
[
3
]
=
"
Avr.
"
;
month
[
3
]
=
this
.
lang
.
aprilShort
;
month
[
4
]
=
"
Mai
"
;
month
[
4
]
=
this
.
lang
.
mayShort
;
month
[
5
]
=
"
Juin
"
;
month
[
5
]
=
this
.
lang
.
juneShort
;
month
[
6
]
=
"
Juil.
"
;
month
[
6
]
=
this
.
lang
.
julyShort
;
month
[
7
]
=
"
Août
"
;
month
[
7
]
=
this
.
lang
.
augustShort
;
month
[
8
]
=
"
Sept.
"
;
month
[
8
]
=
this
.
lang
.
septemberShort
;
month
[
9
]
=
"
Oct.
"
;
month
[
9
]
=
this
.
lang
.
octoberShort
;
month
[
10
]
=
"
Nov.
"
;
month
[
10
]
=
this
.
lang
.
novemberShort
;
month
[
11
]
=
"
Déc.
"
;
month
[
11
]
=
this
.
lang
.
decemberShort
;
let
seconds
=
Math
.
round
(
Math
.
abs
((
now
.
getTime
()
-
d
.
getTime
())
/
1000
));
let
seconds
=
Math
.
round
(
Math
.
abs
((
now
.
getTime
()
-
d
.
getTime
())
/
1000
));
let
timeToUpdate
=
(
Number
.
isNaN
(
seconds
))
?
1000
:
this
.
getSecondsUntilUpdate
(
seconds
)
*
1000
;
let
timeToUpdate
=
(
Number
.
isNaN
(
seconds
))
?
1000
:
this
.
getSecondsUntilUpdate
(
seconds
)
*
1000
;
this
.
timer
=
this
.
ngZone
.
runOutsideAngular
(()
=>
{
this
.
timer
=
this
.
ngZone
.
runOutsideAngular
(()
=>
{
...
@@ -45,13 +48,13 @@ export class TimeAgoPipe implements PipeTransform, OnDestroy {
...
@@ -45,13 +48,13 @@ export class TimeAgoPipe implements PipeTransform, OnDestroy {
if
(
Number
.
isNaN
(
seconds
)){
if
(
Number
.
isNaN
(
seconds
)){
return
''
;
return
''
;
}
else
if
(
seconds
<=
45
)
{
}
else
if
(
seconds
<=
45
)
{
return
'
quelques s
econd
es
'
;
return
this
.
lang
.
fewS
econd
s
;
}
else
if
(
seconds
<=
90
)
{
}
else
if
(
seconds
<=
90
)
{
return
'
une m
inute
'
;
return
this
.
lang
.
oneM
inute
;
}
else
if
(
minutes
<=
45
)
{
}
else
if
(
minutes
<=
45
)
{
return
minutes
+
'
minutes
'
;
return
minutes
+
'
'
+
this
.
lang
.
minutes
;
}
else
if
(
minutes
<=
90
)
{
}
else
if
(
minutes
<=
90
)
{
return
'
une heure
'
;
return
this
.
lang
.
oneHour
;
}
else
if
(
hours
<=
22
)
{
}
else
if
(
hours
<=
22
)
{
return
hourNumber
+
'
:
'
+
minuteNumber
;
return
hourNumber
+
'
:
'
+
minuteNumber
;
//return hours + ' heures';
//return hours + ' heures';
...
...
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