]> _ Git - sandvik-apps.git/commitdiff
wip #5330 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Jun 2022 09:31:20 +0000 (11:31 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Jun 2022 09:31:20 +0000 (11:31 +0200)
ScreeningMediaSelection/_doc/data.xlsx
ScreeningMediaSelection/index.html
ScreeningMediaSelection/js/common.js
ScreeningMediaSelection/js/script.js

index 4acaf145bc309c98a89742539ef94cd02421e781..a856ad15e35f1ffa17a2b5182afbfff5d97d9f54 100644 (file)
Binary files a/ScreeningMediaSelection/_doc/data.xlsx and b/ScreeningMediaSelection/_doc/data.xlsx differ
index d90495146d226c68cb96b3bc1e437a87af42a17d..a612c52768240bac4f3691261b1849bd042acc1b 100644 (file)
             <span data-l10n="This selection guide is only to be used for conventional screens such as Sandvik SA, SJ & SL screen models."></span><br>
             <strong data-l10n="Not to be used for Free-fall or Multi slope screens!"></strong>
         </p>
-        <p class="text"
-           data-l10n="It is designed to provide an aperture for a specific separation (cut point) based on a limited number of parameters, except for Flat (Self-supporting) decks, normally used for scalping, then the nearest available aperture is displayed instead. Other parameters may have to be taken into consideration before a final decision is taken. A screening product specialist should always review and approve the aperture selection before an order is placed."></p>
+        <p class="text">
+            <span data-l10n="It is designed to provide an aperture for a specific separation (cut point) based on a limited number of parameters, except for Flat (Self-supporting) decks, normally used for scalping, then the nearest available aperture is displayed instead."></span>
+            <span data-l10n="Other parameters may have to be taken into consideration before a final decision is taken."></span>
+            <span data-l10n="A screening product specialist should always review and approve the aperture selection before an order is placed."></span>
+        </p>
         <p class="text"><strong data-l10n="Apertures - Shapes & Patterns"></strong></p>
         <p class="text">
         <ul>
index 80f8fb1f7c50a3a60b82690b05678027560cbc35..f7c96d0962e43b62641f3488bbb36f38b24402ab 100644 (file)
@@ -10,26 +10,21 @@ if (!window.localStorage) {
                 return null;
             }
             return unescape(document.cookie.replace(new RegExp("(?:^|.*;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"), "$1"));
-        },
-        key: function (nKeyId) {
+        }, key: function (nKeyId) {
             return unescape(document.cookie.replace(/\s*\=(?:.(?!;))*$/, "").split(/\s*\=(?:[^;](?!;))*[^;]?;\s*/)[nKeyId]);
-        },
-        setItem: function (sKey, sValue) {
+        }, setItem: function (sKey, sValue) {
             if (!sKey) {
                 return;
             }
             document.cookie = escape(sKey) + "=" + escape(sValue) + "; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/";
             this.length = document.cookie.match(/\=/g).length;
-        },
-        length: 0,
-        removeItem: function (sKey) {
+        }, length: 0, removeItem: function (sKey) {
             if (!sKey || !this.hasOwnProperty(sKey)) {
                 return;
             }
             document.cookie = escape(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
             this.length--;
-        },
-        hasOwnProperty: function (sKey) {
+        }, hasOwnProperty: function (sKey) {
             return (new RegExp("(?:^|;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie);
         }
     };
@@ -215,9 +210,30 @@ function showHide(show, callback) {
 function exportTranslations() {
     parseDataForTranslations();
     parseScriptForTranslations(function () {
-        post('https://extranet.cubedesigners.com/tools/excelTranslation', {
-            name: APPNAME,
-            str: JSON.stringify(TRANSLATIONS)
+        var T = {};
+        var L = [];
+        $.each(TRANSLATIONS, function (n, str) {
+            T[str] = [];
+            $.each(LOCALES, function (l, tt) {
+                if (n === 0) {
+                    L.push(l);
+                }
+                if (l === 'en') {
+                    T[str].push(str);
+                    return;
+                }
+                var trans = '';
+                if (tt[str] !== undefined && tt[str] !== '') {
+                    trans = tt[str];
+                }
+                T[str].push(trans);
+            });
+        });
+
+        var O = {translations: T, locales: L};
+        console.log(O);
+        post('https://extranet.cubedesigners.com/tools/excelTranslationM', {
+            name: APPNAME, str: JSON.stringify(O),
         });
     });
 
@@ -325,9 +341,18 @@ function addToTranslations(str, force) {
 
     for (var i = 0; i < e.length; i++) {
         var s = e[i];
+        // Skip numbers
+        if (/^[\d\.]*$/.test(s)) {
+            continue;
+        }
+        // Skip existing
         if (window.TRANSLATIONS.indexOf(s) >= 0) {
             continue;
         }
+        // Skip html containing translations
+        if (s.indexOf('data-l10n') >= 0) {
+            continue;
+        }
         if (!force && !/[a-hj-z]+/.test(s)) {
             continue;
         }
index 9cb47e49d8b64bd889c017bebf97b991ccccf1ee..b3a2f0d098f609f0affb3241b064b08474c6138c 100644 (file)
@@ -2,7 +2,6 @@ window.updateFormAgain = false;
 DEV = false;
 
 $(function () {
-    console.log('parse data');
     parseData();
 
     $("section").addClass('hidden');
@@ -117,7 +116,6 @@ function parseTable(table, sheet) {
         f.block = f.block !== '0';
         FIELDS.push(f);
     });
-    console.log(FIELDS);
 }
 
 function parseOptions(table, k, f) {
@@ -185,7 +183,6 @@ function rangeVal(v) {
     }
     res[0] = parseFloat(res[0]);
     res[1] = parseFloat(res[1]);
-    console.log(res);
     return res;
 }