PageSourceSearch

https://www.rcb.lv/wp-content/themes/picostrap5-rcb-www/js/page_translate_widget_client.js

js rcb.lv collected 2026-10-02 04:43:53 UTC 5,241 bytes, 119 lines download raw bytes

1
2// UNUSED CODE
3// Client side code for page translation widget.
4// It needs to be configured and put at the end of the page that needs translation.
5// Generated by: https://localhost/lv/PageTranslateWidget/ClientConfiguration?sourceLanguage=lv&clientId=u-ea7a14f0-d6fa-47b5-b0fe-40825b9dff53&system=smt-4de30726-b454-426e-a918-f59a82ea2d57&system=smt-356ba853-2cb5-458f-a8a9-d9403ad65e52&targetLanguage=en&targetLanguage=uk&languageListAppearance=links&showHeader=false&showBorder=false&languageNameFormat=nativeName&cssLocation=page_translate_widget.css&minify=false&publicAddress=https%3a%2f%2fhugo.lv
6
7if (typeof (Tilde) === 'undefined')
8    Tilde = {};
9
10Tilde.PageTranslateWidgetClientConfiguration = {
11    // LetsMT site address
12    letsmtSite: "https://hugo.lv",
13
14    // url where to get jquery lib if widget detects that no jquery lib is loaded
15    jQueryUrl: "https://hugo.lv/Scripts/jquery-3.0.0.min.js",
16
17    // Url of the place where CSS for translation widget is kept
18    // if you wish to customize the standard letsmt style,
19    // point this to your own css file
20    cssLocation: "/wp-content/themes/premium-pin/css/page_translate_widget.css",
21
22    // client id for authorization
23    clientId: "u-1dfc7dc8-70b2-4ecd-be5b-1362bd49da53",
24
25    // id of the <div> where to draw widget
26    widgetContainerId: "PageTranslateWidget",
27
28    // available translation systems (target languages)
29    translationSystems: [
30        { "id": "smt-4de30726-b454-426e-a918-f59a82ea2d57", "name": "English", "targetLanguage": "en", "sourceLanguage": null },
31        // { "id": "smt-356ba853-2cb5-458f-a8a9-d9403ad65e52", "name": "Українська", "targetLanguage": "uk", "sourceLanguage": null }
32    ],
33
34    // source language of the page that needs to be translated
35    language: "lv",
36
37    // translate widget UI to language that is chosen in target language dropdown
38    translateUItoChosenLanguage: true,
39
40    // translate widget administrative part to language that is chosen in target language dropdown
41    translateAdminUItoChosenLanguage: false,
42
43    uiLanguage: null,
44
45    languageNameFormat: "code",
46
47    // if page was translated and you click on a link
48    // that goes to another page in the same site,
49    // then translate the newly opened page also
50    translateAfterNavigation: true,
51
52    // true - language list is shown as links
53    // false - language list is shown as dropdown list and "translate" button
54    languageListAsLinks: true,
55
56    showHeader: false,
57
58    // after translation show a warning that page is machine translated at the top of the page
59    showMachineTranslationWarningAfterTranslation: true,
60
61    // show all available translation systems instead of just the ones configured in this file
62    showAllTranslationSystems: false,
63
64    // add some pixels to dropdown padding to make it look more similar on different browsers
65    browserSpecificDropdownPadding: true,
66
67    // name of icon set: "default", "white", "grey", "red"
68    iconSet: "default",
69
70    // Possible values: 1, 2, 3. Text for link "Restore original: Latvian" may be made shorter or longer
71    // useful to adapt to small or large screens
72    restoreOriginalLinkLength: 2,
73
74    // enable or disable "Suggest translation" link in popup that shows original text of translated sentence
75    suggestTranslation: true,
76
77    // show message box when error happens?
78    showMessageBoxOnError: true,
79
80    // application identifier
81    appId: "PageTranslateWidget",
82
83    // server will only return systems that are meant for given appId
84    filterSystemsByAppId: false,
85
86    // show help link
87    enableHelp: false,
88
89    // show feedback link
90    enableFeedback: false,
91
92    // allowed system statuses, by default only "running"
93    allowedSystemStatuses: "running",
94
95    // passed to translation service for logging.
96    // "web-embedded" for widget that is embedded in html page,
97    // "web" for widget that can load and translate any website
98    widget: "web-embedded"
99};
100
101// load translation widget as late as possible
102// and don't block page rendering if LetsMT site is unresponsive
103setTimeout(function () {
104    var script = document.createElement("script");
105    script.type = "text/javascript";
106    var brokenCaching = navigator.userAgent.indexOf("MSIE") > 0 // really old IE
107        || navigator.userAgent.indexOf("Trident") > 0;  // IE8 and older
108
109    if (window.location.protocol == "https:" && Tilde.PageTranslateWidgetClientConfiguration.letsmtSite.indexOf("http:") > -1) {
110        // when in https and using cached js that came from http
111        Tilde.PageTranslateWidgetClientConfiguration.letsmtSite = Tilde.PageTranslateWidgetClientConfiguration.letsmtSite.replace("http:", "https:");
112    }
113
114    script.src = (Tilde.PageTranslateWidgetClientConfiguration.letsmtSite ? Tilde.PageTranslateWidgetClientConfiguration.letsmtSite : "")
115        + "/bundles/page-translate-widget?v=zKN3x6FNsOfbtr3f-z6Id0DdbCpyjvMGqYzczbVEKmw1"
116        + (brokenCaching ? ("?" + new Date().getTime()) : "");
117    var head = document.getElementsByTagName("head")[0] || document.documentElement.body;
118    head.appendChild(script);
119}, 0);

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.