Refactor Translations

This commit is contained in:
redphx
2024-04-27 10:10:33 +07:00
parent 4b1428ffd7
commit fc64f0dfa7
5 changed files with 58 additions and 77 deletions

View File

@@ -19,13 +19,12 @@ export class UserAgent {
return (window.navigator as any).orgUserAgent || window.navigator.userAgent;
}
static get(profile: string): string {
static get(profile: UserAgentProfile): string {
const defaultUserAgent = UserAgent.getDefault();
if (profile === UserAgentProfile.CUSTOM) {
return getPref(PrefKey.USER_AGENT_CUSTOM);
}
// TODO: check type
return (UserAgent.#USER_AGENTS as any)[profile] || defaultUserAgent;
}