mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-06 13:18:27 +02:00
Refactor Translations
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { getLocale } from "../modules/translation";
|
||||
|
||||
export const AppInterface = window.AppInterface;
|
||||
export const NATIVE_FETCH = window.fetch;
|
||||
export const STATES: BxStates = {
|
||||
@@ -14,9 +12,3 @@ export const STATES: BxStates = {
|
||||
|
||||
export const SCRIPT_VERSION = '3.5.3';
|
||||
export const SCRIPT_HOME = 'https://github.com/redphx/better-xcloud';
|
||||
|
||||
export var LOCALE = getLocale();
|
||||
|
||||
export const refreshLocale = () => {
|
||||
LOCALE = getLocale();
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user