forked from darkreader/darkreader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinks.ts
More file actions
34 lines (30 loc) · 1014 Bytes
/
Copy pathlinks.ts
File metadata and controls
34 lines (30 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import {getUILanguage} from './locales';
export const BLOG_URL = 'https://darkreader.org/blog/';
export const DEVTOOLS_DOCS_URL = 'https://github.com/alexanderby/darkreader#how-to-contribute';
export const DONATE_URL = 'https://opencollective.com/darkreader';
export const GITHUB_URL = 'https://github.com/darkreader/darkreader';
export const PRIVACY_URL = 'https://darkreader.org/privacy/';
export const TWITTER_URL = 'https://twitter.com/darkreaderapp';
export const UNINSTALL_URL = 'https://darkreader.org/goodluck/';
const helpLocales = [
'be',
'cs',
'de',
'en',
'es',
'fr',
'nl',
'it',
'pt',
'ru',
'zh-CN',
'zh-TW',
];
export function getHelpURL() {
const locale = getUILanguage();
const matchLocale = helpLocales.find((hl) => hl === locale) || helpLocales.find((hl) => locale.startsWith(hl)) || 'en';
return `https://darkreader.org/help/${matchLocale}/`;
}
export function getBlogPostURL(postId: string) {
return `${BLOG_URL}${postId}/`;
}