PageSourceSearch

https://forgeofgames.com/scripts/locale-management.kto5bvgbu9.js

js forgeofgames.com collected 2026-09-24 14:13:21 UTC 1,143 bytes, 42 lines download raw bytes

1window.Fog = window.Fog || {};
2window.Fog.Webapp = window.Fog.Webapp || {};
3window.Fog.Webapp.LocaleManager = {
4    LOCALE_KEY: '.AspNetCore.Culture',
5
6    getUserLanguages: function () {
7        return navigator.languages;
8    },
9    
10    getLocale: function () {
11        let locale;
12
13        try {
14            return localStorage.getItem(this.LOCALE_KEY);
15        } catch (e) {
16            console.warn('Error accessing localStorage:', e);
17        }
18    },
19
20    setLocale: function (locale) {
21        try {
22            localStorage.setItem(this.LOCALE_KEY, locale);
23        } catch (e) {
24            console.warn('Error accessing localStorage:', e);
25            return;
26        }
27
28        document.cookie = `${this.LOCALE_KEY}=c=${locale}|uic=${locale}; path=/; max-age=31536000; SameSite=Strict; Secure`;
29
30        window.dispatchEvent(new CustomEvent('localeChanged', { detail: locale }));
31        
32        location.reload();
33    },
34
35    init: function () {
36        const currentLocale = this.getLocale();
37        if (currentLocale !== localStorage.getItem(this.LOCALE_KEY)) {
38            this.setLocale(currentLocale);
39        }
40    }
41};
42

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.