PageSourceSearch

https://superads.cn/i18n/i18n.js

js superads.cn collected 2026-10-05 22:55:12 UTC 1,619 bytes, 48 lines download raw bytes

1(function () {
2  function loadProperties (language) {
3    jQuery.i18n.properties({
4      name: 'i18n',
5      path: '../i18n/',
6      cache: true,
7      language: language,
8      mode: 'map',
9      callback: function () {
10        var insertEle = $("[data-i18n]");
11        insertEle.each(function () {
12          try {
13            if (typeof ($(this).attr("placeholder")) != "undefined") {
14              $(this).attr("placeholder", $.i18n.prop($(this).data('i18n')));
15            } else if (typeof ($(this).attr("button")) != "undefined") {
16              $(this).attr("button", $.i18n.prop($(this).data('i18n')));
17            } else {
18              $(this).text($.i18n.prop($(this).data('i18n')));
19            }
20          } catch (e) {
21            console.log("key不存在,请在配置文件中配置对应的key:" + $(this).data('i18n'));
22          }
23        });
24      }
25    });
26  };
27
28
29  // 初始化
30  $(document).ready(function () {
31    let language = window.localStorage.getItem('xj_lang') || (navigator.language.includes('zh') ? 'zh' : 'en');
32    window.localStorage.setItem('xj_lang', language)
33    loadProperties(language);
34    $('#lang').text(language === 'zh' ? 'English' : '中文')
35    $('#lang').attr('data-lang', language === 'zh' ? 'zh' : 'en')
36  });
37
38  // 语言切换
39  $('#language-click').click(function () {
40    if ($('#lang').attr('data-lang') === 'zh') {
41      window.localStorage.setItem('xj_lang', 'en')
42      window.location.reload()
43    } else {
44      window.localStorage.setItem('xj_lang', 'zh')
45      window.location.reload()
46    }
47  })
48})()

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.