mirror of https://github.com/vector-im/riot-web
[WEBLATE] fix merge issues
commit
9f5a359f10
|
@ -45,10 +45,10 @@ const COMMANDS = [
|
|||
command: '/ddg',
|
||||
args: '<query>',
|
||||
description: 'Searches DuckDuckGo for results',
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
let COMMAND_RE = /(^\/\w*)/g;
|
||||
const COMMAND_RE = /(^\/\w*)/g;
|
||||
|
||||
let instance = null;
|
||||
|
||||
|
@ -62,15 +62,15 @@ export default class CommandProvider extends AutocompleteProvider {
|
|||
|
||||
async getCompletions(query: string, selection: {start: number, end: number}) {
|
||||
let completions = [];
|
||||
let {command, range} = this.getCurrentCommand(query, selection);
|
||||
const {command, range} = this.getCurrentCommand(query, selection);
|
||||
if (command) {
|
||||
completions = this.fuse.search(command[0]).map(result => {
|
||||
completions = this.fuse.search(command[0]).map((result) => {
|
||||
return {
|
||||
completion: result.command + ' ',
|
||||
component: (<TextualCompletion
|
||||
title={result.command}
|
||||
subtitle={result.args}
|
||||
description={ t_(result.description) }
|
||||
description={ _t(result.description) }
|
||||
/>),
|
||||
range,
|
||||
};
|
||||
|
@ -84,8 +84,7 @@ export default class CommandProvider extends AutocompleteProvider {
|
|||
}
|
||||
|
||||
static getInstance(): CommandProvider {
|
||||
if (instance == null)
|
||||
{instance = new CommandProvider();}
|
||||
if (instance === null) instance = new CommandProvider();
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
|
|
@ -154,4 +154,5 @@
|
|||
"The email address linked to your account must be entered.": "必须输入和你账号关联的邮箱地址。",
|
||||
"The file '%(fileName)s' exceeds this home server's size limit for uploads": "文件 '%(fileName)s' 超过了此主服务器的上传大小限制",
|
||||
"The file '%(fileName)s' failed to upload": "文件 '%(fileName)s' 上传失败"
|
||||
"Guests can't use labs features. Please register.": "游客不能使用实验性功能。请注册。"
|
||||
}
|
||||
|
|
|
@ -87,10 +87,10 @@ export function getAllLanguageKeysFromJson() {
|
|||
}
|
||||
|
||||
export function getLanguagesFromBrowser() {
|
||||
if (navigator.languages) return navigator.languages;
|
||||
if (navigator.language) return [navigator.language]
|
||||
if (navigator.languages && navigator.languages.length) return navigator.languages;
|
||||
if (navigator.language) return [navigator.language];
|
||||
return [navigator.userLanguage];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns a language string, normalises it,
|
||||
|
|
Loading…
Reference in New Issue