Hardcode language for /requests/new support page, remove for others
Thanks @82ba10b5e8dc! Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
a8789919e8
commit
cfa8c89077
1 changed files with 45 additions and 4 deletions
49
main.js
49
main.js
|
@ -474,13 +474,55 @@ ipc.once('ready-for-updates', readyForUpdates);
|
||||||
const TEN_MINUTES = 10 * 60 * 1000;
|
const TEN_MINUTES = 10 * 60 * 1000;
|
||||||
setTimeout(readyForUpdates, TEN_MINUTES);
|
setTimeout(readyForUpdates, TEN_MINUTES);
|
||||||
|
|
||||||
|
// the support only provides a subset of languages available within the app
|
||||||
|
// so we have to list them out here and fallback to english if not included
|
||||||
|
|
||||||
|
const SUPPORT_LANGUAGES = [
|
||||||
|
'ar',
|
||||||
|
'bn',
|
||||||
|
'de',
|
||||||
|
'en-us',
|
||||||
|
'es',
|
||||||
|
'fr',
|
||||||
|
'hi',
|
||||||
|
'hi-in',
|
||||||
|
'hc',
|
||||||
|
'id',
|
||||||
|
'it',
|
||||||
|
'ja',
|
||||||
|
'ko',
|
||||||
|
'mr',
|
||||||
|
'ms',
|
||||||
|
'nl',
|
||||||
|
'pl',
|
||||||
|
'pt',
|
||||||
|
'ru',
|
||||||
|
'sv',
|
||||||
|
'ta',
|
||||||
|
'te',
|
||||||
|
'tr',
|
||||||
|
'uk',
|
||||||
|
'ur',
|
||||||
|
'vi',
|
||||||
|
'zh-cn',
|
||||||
|
'zh-tw',
|
||||||
|
];
|
||||||
|
|
||||||
function openContactUs() {
|
function openContactUs() {
|
||||||
|
const userLanguage = app.getLocale();
|
||||||
|
const language = SUPPORT_LANGUAGES.includes(userLanguage)
|
||||||
|
? userLanguage
|
||||||
|
: 'en-us';
|
||||||
|
|
||||||
|
// This URL needs a hardcoded language because the '?desktop' is dropped if the page
|
||||||
|
// auto-redirects to the proper URL
|
||||||
shell.openExternal(
|
shell.openExternal(
|
||||||
'https://support.signal.org/hc/en-us/requests/new?desktop'
|
`https://support.signal.org/hc/${language}/requests/new?desktop`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openJoinTheBeta() {
|
function openJoinTheBeta() {
|
||||||
|
// If we omit the language, the site will detect the language and redirect
|
||||||
shell.openExternal('https://support.signal.org/hc/articles/360007318471');
|
shell.openExternal('https://support.signal.org/hc/articles/360007318471');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,9 +537,8 @@ function openGithub() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function openSupportPage() {
|
function openSupportPage() {
|
||||||
shell.openExternal(
|
// If we omit the language, the site will detect the language and redirect
|
||||||
'https://support.signal.org/hc/en-us/categories/202319038-Desktop'
|
shell.openExternal('https://support.signal.org/hc/sections/360001602812');
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function openForums() {
|
function openForums() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue