MOBILE-3313 about: Do not translate device OS

main
Pau Ferrer Ocaña 2020-01-29 13:22:18 +01:00
parent a3e7c676fb
commit 03e93ff6c8
5 changed files with 14 additions and 22 deletions

View File

@ -1322,7 +1322,6 @@
"core.all": "moodle", "core.all": "moodle",
"core.allgroups": "moodle", "core.allgroups": "moodle",
"core.allparticipants": "moodle", "core.allparticipants": "moodle",
"core.android": "local_moodlemobileapp",
"core.answer": "moodle", "core.answer": "moodle",
"core.answered": "quiz", "core.answered": "quiz",
"core.areyousure": "moodle", "core.areyousure": "moodle",
@ -1653,14 +1652,12 @@
"core.imageviewer": "local_moodlemobileapp", "core.imageviewer": "local_moodlemobileapp",
"core.info": "moodle", "core.info": "moodle",
"core.invalidformdata": "error", "core.invalidformdata": "error",
"core.ios": "local_moodlemobileapp",
"core.labelsep": "langconfig", "core.labelsep": "langconfig",
"core.lastaccess": "moodle", "core.lastaccess": "moodle",
"core.lastdownloaded": "local_moodlemobileapp", "core.lastdownloaded": "local_moodlemobileapp",
"core.lastmodified": "moodle", "core.lastmodified": "moodle",
"core.lastsync": "local_moodlemobileapp", "core.lastsync": "local_moodlemobileapp",
"core.layoutgrid": "workshopform_rubric", "core.layoutgrid": "workshopform_rubric",
"core.linux": "local_moodlemobileapp",
"core.list": "moodle", "core.list": "moodle",
"core.listsep": "langconfig", "core.listsep": "langconfig",
"core.loading": "moodle", "core.loading": "moodle",
@ -1762,7 +1759,6 @@
"core.login.visitchangepassword": "local_moodlemobileapp", "core.login.visitchangepassword": "local_moodlemobileapp",
"core.login.webservicesnotenabled": "local_moodlemobileapp", "core.login.webservicesnotenabled": "local_moodlemobileapp",
"core.lostconnection": "local_moodlemobileapp", "core.lostconnection": "local_moodlemobileapp",
"core.mac": "local_moodlemobileapp",
"core.mainmenu.appsettings": "local_moodlemobileapp", "core.mainmenu.appsettings": "local_moodlemobileapp",
"core.mainmenu.changesite": "local_moodlemobileapp", "core.mainmenu.changesite": "local_moodlemobileapp",
"core.mainmenu.help": "moodle", "core.mainmenu.help": "moodle",
@ -2074,7 +2070,6 @@
"core.whoops": "local_moodlemobileapp", "core.whoops": "local_moodlemobileapp",
"core.whyisthishappening": "local_moodlemobileapp", "core.whyisthishappening": "local_moodlemobileapp",
"core.whyisthisrequired": "moodle", "core.whyisthisrequired": "moodle",
"core.windows": "local_moodlemobileapp",
"core.wsfunctionnotavailable": "local_moodlemobileapp", "core.wsfunctionnotavailable": "local_moodlemobileapp",
"core.year": "moodle", "core.year": "moodle",
"core.years": "moodle", "core.years": "moodle",

View File

@ -1322,7 +1322,6 @@
"core.all": "All", "core.all": "All",
"core.allgroups": "All groups", "core.allgroups": "All groups",
"core.allparticipants": "All participants", "core.allparticipants": "All participants",
"core.android": "Android",
"core.answer": "Answer", "core.answer": "Answer",
"core.answered": "Answered", "core.answered": "Answered",
"core.areyousure": "Are you sure?", "core.areyousure": "Are you sure?",
@ -1653,14 +1652,12 @@
"core.imageviewer": "Image viewer", "core.imageviewer": "Image viewer",
"core.info": "Information", "core.info": "Information",
"core.invalidformdata": "Incorrect form data", "core.invalidformdata": "Incorrect form data",
"core.ios": "iOS",
"core.labelsep": ":", "core.labelsep": ":",
"core.lastaccess": "Last access", "core.lastaccess": "Last access",
"core.lastdownloaded": "Last downloaded", "core.lastdownloaded": "Last downloaded",
"core.lastmodified": "Last modified", "core.lastmodified": "Last modified",
"core.lastsync": "Last synchronisation", "core.lastsync": "Last synchronisation",
"core.layoutgrid": "Grid", "core.layoutgrid": "Grid",
"core.linux": "Linux",
"core.list": "List", "core.list": "List",
"core.listsep": ",", "core.listsep": ",",
"core.loading": "Loading", "core.loading": "Loading",
@ -1762,7 +1759,6 @@
"core.login.visitchangepassword": "Do you want to visit the site to change the password?", "core.login.visitchangepassword": "Do you want to visit the site to change the password?",
"core.login.webservicesnotenabled": "Web services are not enabled in your site. Please contact your site administrator if you think they should be enabled.", "core.login.webservicesnotenabled": "Web services are not enabled in your site. Please contact your site administrator if you think they should be enabled.",
"core.lostconnection": "Your authentication token is invalid or has expired. You will have to reconnect to the site.", "core.lostconnection": "Your authentication token is invalid or has expired. You will have to reconnect to the site.",
"core.mac": "MacOS",
"core.mainmenu.appsettings": "App settings", "core.mainmenu.appsettings": "App settings",
"core.mainmenu.changesite": "Change site", "core.mainmenu.changesite": "Change site",
"core.mainmenu.help": "Help", "core.mainmenu.help": "Help",
@ -2074,7 +2070,6 @@
"core.whoops": "Oops!", "core.whoops": "Oops!",
"core.whyisthishappening": "Why is this happening?", "core.whyisthishappening": "Why is this happening?",
"core.whyisthisrequired": "Why is this required?", "core.whyisthisrequired": "Why is this required?",
"core.windows": "Windows",
"core.wsfunctionnotavailable": "The web service function is not available.", "core.wsfunctionnotavailable": "The web service function is not available.",
"core.year": "year", "core.year": "year",
"core.years": "years", "core.years": "years",

View File

@ -51,8 +51,7 @@
</ion-item> </ion-item>
<ion-item text-wrap *ngIf="deviceInfo.deviceOs" (longPress)="copyItemInfo($event)"> <ion-item text-wrap *ngIf="deviceInfo.deviceOs" (longPress)="copyItemInfo($event)">
<h2>{{ 'core.settings.deviceos' | translate}}</h2> <h2>{{ 'core.settings.deviceos' | translate}}</h2>
<p *ngIf="deviceOSTranslatable">{{ 'core.' + deviceInfo.deviceOs | translate }}</p> <p>{{ deviceInfo.deviceOsTranslated }}</p>
<p *ngIf="!deviceOSTranslatable">{{ deviceInfo.deviceOs }}</p>
</ion-item> </ion-item>
<ion-item text-wrap *ngIf="deviceInfo.screen" (longPress)="copyItemInfo($event)"> <ion-item text-wrap *ngIf="deviceInfo.screen" (longPress)="copyItemInfo($event)">
<h2>{{ 'core.settings.screen' | translate}}</h2> <h2>{{ 'core.settings.screen' | translate}}</h2>

View File

@ -16,6 +16,7 @@ import { Component, NgZone } from '@angular/core';
import { IonicPage, Platform } from 'ionic-angular'; import { IonicPage, Platform } from 'ionic-angular';
import { Device } from '@ionic-native/device'; import { Device } from '@ionic-native/device';
import { Network } from '@ionic-native/network'; import { Network } from '@ionic-native/network';
import { TranslateService } from '@ngx-translate/core';
import { CoreAppProvider } from '@providers/app'; import { CoreAppProvider } from '@providers/app';
import { CoreFileProvider } from '@providers/file'; import { CoreFileProvider } from '@providers/file';
import { CoreInitDelegate } from '@providers/init'; import { CoreInitDelegate } from '@providers/init';
@ -68,9 +69,9 @@ interface CoreSettingsDeviceInfo {
export class CoreSettingsDeviceInfoPage { export class CoreSettingsDeviceInfoPage {
deviceInfo: CoreSettingsDeviceInfo; deviceInfo: CoreSettingsDeviceInfo;
deviceOsTranslated: string;
currentLangName: string; currentLangName: string;
fsClickable: boolean; fsClickable: boolean;
deviceOSTranslatable: boolean;
protected onlineObserver: any; protected onlineObserver: any;
@ -85,7 +86,8 @@ export class CoreSettingsDeviceInfoPage {
sitesProvider: CoreSitesProvider, sitesProvider: CoreSitesProvider,
localNotificationsProvider: CoreLocalNotificationsProvider, localNotificationsProvider: CoreLocalNotificationsProvider,
pushNotificationsProvider: CorePushNotificationsProvider, pushNotificationsProvider: CorePushNotificationsProvider,
protected utils: CoreUtilsProvider) { protected utils: CoreUtilsProvider,
protected translate: TranslateService) {
this.deviceInfo = { this.deviceInfo = {
versionName: CoreConfigConstants.versionname, versionName: CoreConfigConstants.versionname,
@ -132,37 +134,43 @@ export class CoreSettingsDeviceInfoPage {
} }
} }
this.deviceOSTranslatable = true;
if (appProvider.isMobile()) { if (appProvider.isMobile()) {
this.deviceInfo.deviceType = platform.is('tablet') ? 'tablet' : 'phone'; this.deviceInfo.deviceType = platform.is('tablet') ? 'tablet' : 'phone';
if (appProvider.isAndroid()) { if (appProvider.isAndroid()) {
this.deviceInfo.deviceOs = 'android'; this.deviceInfo.deviceOs = 'android';
this.deviceOsTranslated = 'Android';
} else if (appProvider.isIOS()) { } else if (appProvider.isIOS()) {
this.deviceInfo.deviceOs = 'ios'; this.deviceInfo.deviceOs = 'ios';
this.deviceOsTranslated = 'iOS';
} else { } else {
const matches = navigator.userAgent.match(/\(([^\)]*)\)/); const matches = navigator.userAgent.match(/\(([^\)]*)\)/);
if (matches && matches.length > 1) { if (matches && matches.length > 1) {
this.deviceOSTranslatable = false;
this.deviceInfo.deviceOs = matches[1]; this.deviceInfo.deviceOs = matches[1];
this.deviceOsTranslated = matches[1];
} else { } else {
this.deviceInfo.deviceOs = 'unknown'; this.deviceInfo.deviceOs = 'unknown';
this.deviceOsTranslated = this.translate.instant('core.unknown');
} }
} }
} else { } else {
this.deviceInfo.deviceType = appProvider.isDesktop() ? 'desktop' : 'browser'; this.deviceInfo.deviceType = appProvider.isDesktop() ? 'desktop' : 'browser';
if (appProvider.isLinux()) { if (appProvider.isLinux()) {
this.deviceInfo.deviceOs = 'linux'; this.deviceInfo.deviceOs = 'linux';
this.deviceOsTranslated = 'Linux';
} else if (appProvider.isMac()) { } else if (appProvider.isMac()) {
this.deviceInfo.deviceOs = 'mac'; this.deviceInfo.deviceOs = 'mac';
this.deviceOsTranslated = 'MacOS';
} else if (appProvider.isWindows()) { } else if (appProvider.isWindows()) {
this.deviceInfo.deviceOs = 'windows'; this.deviceInfo.deviceOs = 'windows';
this.deviceOsTranslated = 'Windows';
} else { } else {
const matches = navigator.userAgent.match(/\(([^\)]*)\)/); const matches = navigator.userAgent.match(/\(([^\)]*)\)/);
if (matches && matches.length > 1) { if (matches && matches.length > 1) {
this.deviceOSTranslatable = false;
this.deviceInfo.deviceOs = matches[1]; this.deviceInfo.deviceOs = matches[1];
this.deviceOsTranslated = matches[1];
} else { } else {
this.deviceInfo.deviceOs = 'unknown'; this.deviceInfo.deviceOs = 'unknown';
this.deviceOsTranslated = this.translate.instant('core.unknown');
} }
} }
} }

View File

@ -6,7 +6,6 @@
"all": "All", "all": "All",
"allgroups": "All groups", "allgroups": "All groups",
"allparticipants": "All participants", "allparticipants": "All participants",
"android": "Android",
"answer": "Answer", "answer": "Answer",
"answered": "Answered", "answered": "Answered",
"areyousure": "Are you sure?", "areyousure": "Are you sure?",
@ -120,7 +119,6 @@
"imageviewer": "Image viewer", "imageviewer": "Image viewer",
"info": "Information", "info": "Information",
"invalidformdata": "Incorrect form data", "invalidformdata": "Incorrect form data",
"ios": "iOS",
"labelsep": ":", "labelsep": ":",
"filter": "Filter", "filter": "Filter",
"lastaccess": "Last access", "lastaccess": "Last access",
@ -128,14 +126,12 @@
"lastmodified": "Last modified", "lastmodified": "Last modified",
"lastsync": "Last synchronisation", "lastsync": "Last synchronisation",
"layoutgrid": "Grid", "layoutgrid": "Grid",
"linux": "Linux",
"list": "List", "list": "List",
"listsep": ",", "listsep": ",",
"loading": "Loading", "loading": "Loading",
"loadmore": "Load more", "loadmore": "Load more",
"location": "Location", "location": "Location",
"lostconnection": "Your authentication token is invalid or has expired. You will have to reconnect to the site.", "lostconnection": "Your authentication token is invalid or has expired. You will have to reconnect to the site.",
"mac": "MacOS",
"maxsizeandattachments": "Maximum file size: {{$a.size}}, maximum number of files: {{$a.attachments}}", "maxsizeandattachments": "Maximum file size: {{$a.size}}, maximum number of files: {{$a.attachments}}",
"min": "min", "min": "min",
"mins": "mins", "mins": "mins",
@ -299,7 +295,6 @@
"whoops": "Oops!", "whoops": "Oops!",
"whyisthishappening": "Why is this happening?", "whyisthishappening": "Why is this happening?",
"whyisthisrequired": "Why is this required?", "whyisthisrequired": "Why is this required?",
"windows": "Windows",
"wsfunctionnotavailable": "The web service function is not available.", "wsfunctionnotavailable": "The web service function is not available.",
"year": "year", "year": "year",
"years": "years", "years": "years",