Translate src/vector/platform
This commit is contained in:
parent
020d496cb1
commit
52ddcd8a60
5 changed files with 17 additions and 8 deletions
|
@ -278,7 +278,6 @@ async function loadApp() {
|
|||
</div>, document.getElementById('matrixchat'));
|
||||
} else if (validBrowser) {
|
||||
UpdateChecker.start();
|
||||
|
||||
const MatrixChat = sdk.getComponent('structures.MatrixChat');
|
||||
window.matrixChat = ReactDOM.render(
|
||||
<MatrixChat
|
||||
|
|
|
@ -19,6 +19,7 @@ limitations under the License.
|
|||
|
||||
import VectorBasePlatform from './VectorBasePlatform';
|
||||
import dis from 'matrix-react-sdk/lib/dispatcher';
|
||||
import _t from 'matrix-react-sdk/lib/languageHandler';
|
||||
import q from 'q';
|
||||
import electron, {remote, ipcRenderer} from 'electron';
|
||||
|
||||
|
@ -68,7 +69,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
|||
}
|
||||
|
||||
getHumanReadableName(): string {
|
||||
return 'Electron Platform';
|
||||
return 'Electron Platform'; // no translation required: only used for analytics
|
||||
}
|
||||
|
||||
setNotificationCount(count: number) {
|
||||
|
@ -146,7 +147,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
|||
}
|
||||
|
||||
getDefaultDeviceDisplayName(): string {
|
||||
return 'Riot Desktop on ' + platformFriendlyName();
|
||||
return _t('Riot Desktop on %(platformName)s', { platformName: platformFriendlyName() });
|
||||
}
|
||||
|
||||
screenCaptureErrorString(): ?string {
|
||||
|
|
|
@ -18,6 +18,8 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
import BasePlatform from 'matrix-react-sdk/lib/BasePlatform';
|
||||
import _t from 'matrix-react-sdk/lib/languageHandler';
|
||||
|
||||
import Favico from 'favico.js';
|
||||
|
||||
/**
|
||||
|
@ -36,7 +38,7 @@ export default class VectorBasePlatform extends BasePlatform {
|
|||
}
|
||||
|
||||
getHumanReadableName(): string {
|
||||
return 'Vector Base Platform';
|
||||
return 'Vector Base Platform'; // no translation required: only used for analytics
|
||||
}
|
||||
|
||||
_updateFavicon() {
|
||||
|
@ -94,6 +96,6 @@ export default class VectorBasePlatform extends BasePlatform {
|
|||
* device Vector is running on
|
||||
*/
|
||||
getDefaultDeviceDisplayName(): string {
|
||||
return "Unknown device";
|
||||
return _t("Unknown device");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ limitations under the License.
|
|||
import VectorBasePlatform from './VectorBasePlatform';
|
||||
import request from 'browser-request';
|
||||
import dis from 'matrix-react-sdk/lib/dispatcher.js';
|
||||
import { _t } from 'matrix-react-sdk/lib/languageHandler';
|
||||
import q from 'q';
|
||||
|
||||
import url from 'url';
|
||||
|
@ -32,7 +33,7 @@ export default class WebPlatform extends VectorBasePlatform {
|
|||
}
|
||||
|
||||
getHumanReadableName(): string {
|
||||
return 'Web Platform';
|
||||
return 'Web Platform'; // no translation required: only used for analytics
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -159,13 +160,15 @@ export default class WebPlatform extends VectorBasePlatform {
|
|||
const appName = u.format();
|
||||
|
||||
const ua = new UAParser();
|
||||
return `${appName} via ${ua.getBrowser().name} on ${ua.getOS().name}`;
|
||||
const browserName = ua.getBrowser().name;
|
||||
const osName = ua.getOS().name;
|
||||
return _t('%(appName)s via %(browserName)s on %(osName)s', {appName: appName, browserName: browserName, osName: osName});
|
||||
}
|
||||
|
||||
screenCaptureErrorString(): ?string {
|
||||
// it won't work at all if you're not on HTTPS so whine whine whine
|
||||
if (!global.window || global.window.location.protocol !== "https:") {
|
||||
return "You need to be using HTTPS to place a screen-sharing call.";
|
||||
return _t("You need to be using HTTPS to place a screen-sharing call.");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue