MOBILE-2795 ux: Add ago message in coreTimeAgo pipe
parent
bd937fc052
commit
9749ac647f
|
@ -1156,6 +1156,7 @@
|
|||
"core.accounts": "admin",
|
||||
"core.add": "moodle",
|
||||
"core.agelocationverification": "moodle",
|
||||
"core.ago": "message",
|
||||
"core.all": "moodle",
|
||||
"core.allparticipants": "moodle",
|
||||
"core.android": "local_moodlemobileapp",
|
||||
|
|
|
@ -1156,6 +1156,7 @@
|
|||
"core.accounts": "Accounts",
|
||||
"core.add": "Add",
|
||||
"core.agelocationverification": "Age and location verification",
|
||||
"core.ago": "{{$a}} ago",
|
||||
"core.all": "All",
|
||||
"core.allparticipants": "All participants",
|
||||
"core.android": "Android",
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"accounts": "Accounts",
|
||||
"add": "Add",
|
||||
"agelocationverification": "Age and location verification",
|
||||
"ago": "{{$a}} ago",
|
||||
"all": "All",
|
||||
"allparticipants": "All participants",
|
||||
"android": "Android",
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
// limitations under the License.
|
||||
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { CoreLoggerProvider } from '@providers/logger';
|
||||
import * as moment from 'moment';
|
||||
|
||||
|
@ -25,7 +26,7 @@ import * as moment from 'moment';
|
|||
export class CoreTimeAgoPipe implements PipeTransform {
|
||||
protected logger;
|
||||
|
||||
constructor(logger: CoreLoggerProvider) {
|
||||
constructor(logger: CoreLoggerProvider, private translate: TranslateService) {
|
||||
this.logger = logger.getInstance('CoreTimeAgoPipe');
|
||||
}
|
||||
|
||||
|
@ -47,6 +48,6 @@ export class CoreTimeAgoPipe implements PipeTransform {
|
|||
timestamp = numberTimestamp;
|
||||
}
|
||||
|
||||
return moment(timestamp * 1000).fromNow(true);
|
||||
return this.translate.instant('core.ago', {$a: moment(timestamp * 1000).fromNow(true)});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue