aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-05 09:13:26 +0200
committerChocobozzz <me@florianbigard.com>2018-06-05 09:13:26 +0200
commit25acef90a85c1584880dec96aa402f896af8364a (patch)
tree5e62e68c2e32a94a289ebd77f0610ed5a085a142 /client/src/app/shared
parent632f9815c6ab87fce3f3f7399cef9f7679fde908 (diff)
downloadPeerTube-25acef90a85c1584880dec96aa402f896af8364a.tar.gz
PeerTube-25acef90a85c1584880dec96aa402f896af8364a.tar.zst
PeerTube-25acef90a85c1584880dec96aa402f896af8364a.zip
Fix i18n in components
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/misc/from-now.pipe.ts22
-rw-r--r--client/src/app/shared/rest/rest-extractor.service.ts2
2 files changed, 12 insertions, 12 deletions
diff --git a/client/src/app/shared/misc/from-now.pipe.ts b/client/src/app/shared/misc/from-now.pipe.ts
index 3a64a4077..33e6d25fe 100644
--- a/client/src/app/shared/misc/from-now.pipe.ts
+++ b/client/src/app/shared/misc/from-now.pipe.ts
@@ -12,28 +12,28 @@ export class FromNowPipe implements PipeTransform {
12 12
13 let interval = Math.floor(seconds / 31536000) 13 let interval = Math.floor(seconds / 31536000)
14 if (interval > 1) { 14 if (interval > 1) {
15 return this.i18n('{{ interval }} years ago', { interval }) 15 return this.i18n('{{interval}} years ago', { interval })
16 } 16 }
17 17
18 interval = Math.floor(seconds / 2592000) 18 interval = Math.floor(seconds / 2592000)
19 if (interval > 1) return this.i18n('{{ interval }} months ago', { interval }) 19 if (interval > 1) return this.i18n('{{interval}} months ago', { interval })
20 if (interval === 1) return this.i18n('{{ interval }} month ago', { interval }) 20 if (interval === 1) return this.i18n('{{interval}} month ago', { interval })
21 21
22 interval = Math.floor(seconds / 604800) 22 interval = Math.floor(seconds / 604800)
23 if (interval > 1) return this.i18n('{{ interval }} weeks ago', { interval }) 23 if (interval > 1) return this.i18n('{{interval}} weeks ago', { interval })
24 if (interval === 1) return this.i18n('{{ interval }} week ago', { interval }) 24 if (interval === 1) return this.i18n('{{interval}} week ago', { interval })
25 25
26 interval = Math.floor(seconds / 86400) 26 interval = Math.floor(seconds / 86400)
27 if (interval > 1) return this.i18n('{{ interval }} days ago', { interval }) 27 if (interval > 1) return this.i18n('{{interval}} days ago', { interval })
28 if (interval === 1) return this.i18n('{{ interval }} day ago', { interval }) 28 if (interval === 1) return this.i18n('{{interval}} day ago', { interval })
29 29
30 interval = Math.floor(seconds / 3600) 30 interval = Math.floor(seconds / 3600)
31 if (interval > 1) return this.i18n('{{ interval }} hours ago', { interval }) 31 if (interval > 1) return this.i18n('{{interval}} hours ago', { interval })
32 if (interval === 1) return this.i18n('{{ interval }} hour ago', { interval }) 32 if (interval === 1) return this.i18n('{{interval}} hour ago', { interval })
33 33
34 interval = Math.floor(seconds / 60) 34 interval = Math.floor(seconds / 60)
35 if (interval >= 1) return this.i18n('{{ interval }} min ago', { interval }) 35 if (interval >= 1) return this.i18n('{{interval}} min ago', { interval })
36 36
37 return this.i18n('{{ interval }} sec ago', { interval: Math.floor(seconds) }) 37 return this.i18n('{{interval}} sec ago', { interval: Math.floor(seconds) })
38 } 38 }
39} 39}
diff --git a/client/src/app/shared/rest/rest-extractor.service.ts b/client/src/app/shared/rest/rest-extractor.service.ts
index 468ac3e32..0d5b6d6f3 100644
--- a/client/src/app/shared/rest/rest-extractor.service.ts
+++ b/client/src/app/shared/rest/rest-extractor.service.ts
@@ -71,7 +71,7 @@ export class RestExtractor {
71 const secondsLeft = err.headers.get('retry-after') 71 const secondsLeft = err.headers.get('retry-after')
72 if (secondsLeft) { 72 if (secondsLeft) {
73 const minutesLeft = Math.floor(parseInt(secondsLeft, 10) / 60) 73 const minutesLeft = Math.floor(parseInt(secondsLeft, 10) / 60)
74 errorMessage = this.i18n('Too many attempts, please try again after {{ minutesLeft }} minutes.', { minutesLeft }) 74 errorMessage = this.i18n('Too many attempts, please try again after {{minutesLeft}} minutes.', { minutesLeft })
75 } else { 75 } else {
76 errorMessage = this.i18n('Too many attempts, please try again later.') 76 errorMessage = this.i18n('Too many attempts, please try again later.')
77 } 77 }