Verified Commit b20a4175 authored by Thomas Rientjes's avatar Thomas Rientjes
Browse files

Implement unsupported locale notice

parent d5e6304b
!function(){"use strict";function c(c){if(null===c||void 0===c)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(c)}function l(c){"function"==typeof V.hooks.addPack?V.hooks.addPack(c,h):V.packs[c]=a({},V.packs[c]||{},h)}var h={cog:[512,512,[],"f013","M444.788 291.1l42.616 24.599c4.867 2.809 7.126 8.618 5.459 13.985-11.07 35.642-29.97 67.842-54.689 94.586a12.016 12.016 0 0 1-14.832 2.254l-42.584-24.595a191.577 191.577 0 0 1-60.759 35.13v49.182a12.01 12.01 0 0 1-9.377 11.718c-34.956 7.85-72.499 8.256-109.219.007-5.49-1.233-9.403-6.096-9.403-11.723v-49.184a191.555 191.555 0 0 1-60.759-35.13l-42.584 24.595a12.016 12.016 0 0 1-14.832-2.254c-24.718-26.744-43.619-58.944-54.689-94.586-1.667-5.366.592-11.175 5.459-13.985L67.212 291.1a193.48 193.48 0 0 1 0-70.199l-42.616-24.599c-4.867-2.809-7.126-8.618-5.459-13.985 11.07-35.642 29.97-67.842 54.689-94.586a12.016 12.016 0 0 1 14.832-2.254l42.584 24.595a191.577 191.577 0 0 1 60.759-35.13V25.759a12.01 12.01 0 0 1 9.377-11.718c34.956-7.85 72.499-8.256 109.219-.007 5.49 1.233 9.403 6.096 9.403 11.723v49.184a191.555 191.555 0 0 1 60.759 35.13l42.584-24.595a12.016 12.016 0 0 1 14.832 2.254c24.718 26.744 43.619 58.944 54.689 94.586 1.667 5.366-.592 11.175-5.459 13.985L444.788 220.9a193.485 193.485 0 0 1 0 70.2zM336 256c0-44.112-35.888-80-80-80s-80 35.888-80 80 35.888 80 80 80 80-35.888 80-80z"],"power-off":[512,512,[],"f011","M400 54.1c63 45 104 118.6 104 201.9 0 136.8-110.8 247.7-247.5 248C120 504.3 8.2 393 8 256.4 7.9 173.1 48.9 99.3 111.8 54.2c11.7-8.3 28-4.8 35 7.7L162.6 90c5.9 10.5 3.1 23.8-6.6 31-41.5 30.8-68 79.6-68 134.9-.1 92.3 74.5 168.1 168 168.1 91.6 0 168.6-74.2 168-169.1-.3-51.8-24.7-101.8-68.1-134-9.7-7.2-12.4-20.5-6.5-30.9l15.8-28.1c7-12.4 23.2-16.1 34.8-7.8zM296 264V24c0-13.3-10.7-24-24-24h-32c-13.3 0-24 10.7-24 24v240c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24z"],globe:[512,512,[],"f0ac","M364.215 192h131.43c5.439 20.419 8.354 41.868 8.354 64s-2.915 43.581-8.354 64h-131.43c5.154-43.049 4.939-86.746 0-128zM185.214 352c10.678 53.68 33.173 112.514 70.125 151.992.221.001.44.008.661.008s.44-.008.661-.008c37.012-39.543 59.467-98.414 70.125-151.992H185.214zm174.13-192h125.385C452.802 84.024 384.128 27.305 300.95 12.075c30.238 43.12 48.821 96.332 58.394 147.925zm-27.35 32H180.006c-5.339 41.914-5.345 86.037 0 128h151.989c5.339-41.915 5.345-86.037-.001-128zM152.656 352H27.271c31.926 75.976 100.6 132.695 183.778 147.925-30.246-43.136-48.823-96.35-58.393-147.925zm206.688 0c-9.575 51.605-28.163 104.814-58.394 147.925 83.178-15.23 151.852-71.949 183.778-147.925H359.344zm-32.558-192c-10.678-53.68-33.174-112.514-70.125-151.992-.221 0-.44-.008-.661-.008s-.44.008-.661.008C218.327 47.551 195.872 106.422 185.214 160h141.572zM16.355 192C10.915 212.419 8 233.868 8 256s2.915 43.581 8.355 64h131.43c-4.939-41.254-5.154-84.951 0-128H16.355zm136.301-32c9.575-51.602 28.161-104.81 58.394-147.925C127.872 27.305 59.198 84.024 27.271 160h125.385z"],"shield-alt":[512,512,[],"f3ca","M496 128c0 221.282-135.934 344.645-221.539 380.308a48 48 0 0 1-36.923 0C130.495 463.713 16 326.487 16 128a48 48 0 0 1 29.539-44.308l192-80a48 48 0 0 1 36.923 0l192 80A48 48 0 0 1 496 128zM256 446.313l.066.034c93.735-46.689 172.497-156.308 175.817-307.729L256 65.333v380.98z"]},v=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,a=function(){try{if(!Object.assign)return!1;var c=new String("abc");if(c[5]="de","5"===Object.getOwnPropertyNames(c)[0])return!1;for(var l={},h=0;h<10;h++)l["_"+String.fromCharCode(h)]=h;if("0123456789"!==Object.getOwnPropertyNames(l).map(function(c){return l[c]}).join(""))return!1;var v={};return"abcdefghijklmnopqrst".split("").forEach(function(c){v[c]=c}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},v)).join("")}catch(c){return!1}}()?Object.assign:function(l,h){for(var a,M,V=c(l),f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var e in a)z.call(a,e)&&(V[e]=a[e]);if(v){M=v(a);for(var m=0;m<M.length;m++)H.call(a,M[m])&&(V[M[m]]=a[M[m]])}}return V},M=a({},{namespace:"___FONT_AWESOME___",familyPrefix:"fa",replacementClass:"svg-inline--fa",autoReplaceSvg:!0,autoA11y:!0,observeMutations:!0,keepOriginalSource:!0,measurePerformance:!1},window.FontAwesomeConfig||{});M.autoReplaceSvg||(M.observeMutations=!1),window[M.namespace]||(window[M.namespace]={}),window[M.namespace].packs||(window[M.namespace].packs={}),window[M.namespace].hooks||(window[M.namespace].hooks={}),window[M.namespace].shims||(window[M.namespace].shims=[]);var V=window[M.namespace];l("fas"),l("fa")}();
!function(){"use strict";function c(c){if(null===c||void 0===c)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(c)}function l(c){"function"==typeof V.hooks.addPack?V.hooks.addPack(c,h):V.packs[c]=a({},V.packs[c]||{},h)}var h={cog:[512,512,[],"f013","M444.788 291.1l42.616 24.599c4.867 2.809 7.126 8.618 5.459 13.985-11.07 35.642-29.97 67.842-54.689 94.586a12.016 12.016 0 0 1-14.832 2.254l-42.584-24.595a191.577 191.577 0 0 1-60.759 35.13v49.182a12.01 12.01 0 0 1-9.377 11.718c-34.956 7.85-72.499 8.256-109.219.007-5.49-1.233-9.403-6.096-9.403-11.723v-49.184a191.555 191.555 0 0 1-60.759-35.13l-42.584 24.595a12.016 12.016 0 0 1-14.832-2.254c-24.718-26.744-43.619-58.944-54.689-94.586-1.667-5.366.592-11.175 5.459-13.985L67.212 291.1a193.48 193.48 0 0 1 0-70.199l-42.616-24.599c-4.867-2.809-7.126-8.618-5.459-13.985 11.07-35.642 29.97-67.842 54.689-94.586a12.016 12.016 0 0 1 14.832-2.254l42.584 24.595a191.577 191.577 0 0 1 60.759-35.13V25.759a12.01 12.01 0 0 1 9.377-11.718c34.956-7.85 72.499-8.256 109.219-.007 5.49 1.233 9.403 6.096 9.403 11.723v49.184a191.555 191.555 0 0 1 60.759 35.13l42.584-24.595a12.016 12.016 0 0 1 14.832 2.254c24.718 26.744 43.619 58.944 54.689 94.586 1.667 5.366-.592 11.175-5.459 13.985L444.788 220.9a193.485 193.485 0 0 1 0 70.2zM336 256c0-44.112-35.888-80-80-80s-80 35.888-80 80 35.888 80 80 80 80-35.888 80-80z"],"exclamation-triangle":[576,512,[],"f071","M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"],"power-off":[512,512,[],"f011","M400 54.1c63 45 104 118.6 104 201.9 0 136.8-110.8 247.7-247.5 248C120 504.3 8.2 393 8 256.4 7.9 173.1 48.9 99.3 111.8 54.2c11.7-8.3 28-4.8 35 7.7L162.6 90c5.9 10.5 3.1 23.8-6.6 31-41.5 30.8-68 79.6-68 134.9-.1 92.3 74.5 168.1 168 168.1 91.6 0 168.6-74.2 168-169.1-.3-51.8-24.7-101.8-68.1-134-9.7-7.2-12.4-20.5-6.5-30.9l15.8-28.1c7-12.4 23.2-16.1 34.8-7.8zM296 264V24c0-13.3-10.7-24-24-24h-32c-13.3 0-24 10.7-24 24v240c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24z"],globe:[512,512,[],"f0ac","M364.215 192h131.43c5.439 20.419 8.354 41.868 8.354 64s-2.915 43.581-8.354 64h-131.43c5.154-43.049 4.939-86.746 0-128zM185.214 352c10.678 53.68 33.173 112.514 70.125 151.992.221.001.44.008.661.008s.44-.008.661-.008c37.012-39.543 59.467-98.414 70.125-151.992H185.214zm174.13-192h125.385C452.802 84.024 384.128 27.305 300.95 12.075c30.238 43.12 48.821 96.332 58.394 147.925zm-27.35 32H180.006c-5.339 41.914-5.345 86.037 0 128h151.989c5.339-41.915 5.345-86.037-.001-128zM152.656 352H27.271c31.926 75.976 100.6 132.695 183.778 147.925-30.246-43.136-48.823-96.35-58.393-147.925zm206.688 0c-9.575 51.605-28.163 104.814-58.394 147.925 83.178-15.23 151.852-71.949 183.778-147.925H359.344zm-32.558-192c-10.678-53.68-33.174-112.514-70.125-151.992-.221 0-.44-.008-.661-.008s-.44.008-.661.008C218.327 47.551 195.872 106.422 185.214 160h141.572zM16.355 192C10.915 212.419 8 233.868 8 256s2.915 43.581 8.355 64h131.43c-4.939-41.254-5.154-84.951 0-128H16.355zm136.301-32c9.575-51.602 28.161-104.81 58.394-147.925C127.872 27.305 59.198 84.024 27.271 160h125.385z"],"shield-alt":[512,512,[],"f3ca","M496 128c0 221.282-135.934 344.645-221.539 380.308a48 48 0 0 1-36.923 0C130.495 463.713 16 326.487 16 128a48 48 0 0 1 29.539-44.308l192-80a48 48 0 0 1 36.923 0l192 80A48 48 0 0 1 496 128zM256 446.313l.066.034c93.735-46.689 172.497-156.308 175.817-307.729L256 65.333v380.98z"]},v=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,a=function(){try{if(!Object.assign)return!1;var c=new String("abc");if(c[5]="de","5"===Object.getOwnPropertyNames(c)[0])return!1;for(var l={},h=0;h<10;h++)l["_"+String.fromCharCode(h)]=h;if("0123456789"!==Object.getOwnPropertyNames(l).map(function(c){return l[c]}).join(""))return!1;var v={};return"abcdefghijklmnopqrst".split("").forEach(function(c){v[c]=c}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},v)).join("")}catch(c){return!1}}()?Object.assign:function(l,h){for(var a,M,V=c(l),f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var e in a)z.call(a,e)&&(V[e]=a[e]);if(v){M=v(a);for(var m=0;m<M.length;m++)H.call(a,M[m])&&(V[M[m]]=a[M[m]])}}return V},M=a({},{namespace:"___FONT_AWESOME___",familyPrefix:"fa",replacementClass:"svg-inline--fa",autoReplaceSvg:!0,autoA11y:!0,observeMutations:!0,keepOriginalSource:!0,measurePerformance:!1},window.FontAwesomeConfig||{});M.autoReplaceSvg||(M.observeMutations=!1),window[M.namespace]||(window[M.namespace]={}),window[M.namespace].packs||(window[M.namespace].packs={}),window[M.namespace].hooks||(window[M.namespace].hooks={}),window[M.namespace].shims||(window[M.namespace].shims=[]);var V=window[M.namespace];l("fas"),l("fa")}();
......@@ -14,6 +14,10 @@ body {
margin-bottom: 22px;
}
.notice {
margin-top: 12px;
}
/**
* Fonts
*/
......@@ -65,6 +69,23 @@ body {
margin-left: 29px;
}
/**
* Icons
*/
.icon {
color: #777;
margin-right: 3px;
}
/**
* Links
*/
.link-text {
color: #999;
}
/**
* Miscellaneous
*/
......@@ -88,11 +109,25 @@ body {
background-color: #ffa500;
}
.hidden {
display: none !important;
}
.label-checkbox {
align-items: center;
display: flex;
}
.notice-body {
background-color: #fbfbfb;
border-radius: 3px;
border: 1px solid #e7e7e7;
color: #595959;
display: inline-block;
font-size: 11px;
padding: 8px 10px;
}
/**
* Right to Left
*/
......
......@@ -11,6 +11,9 @@
<link rel="stylesheet" type="text/css" href="options.css">
<script defer src="../../modules/fontawesome/packs/solid.js"></script>
<script defer src="../../modules/fontawesome/fontawesome.js"></script>
</head>
<body>
......@@ -99,6 +102,20 @@
</section>
<section class="notice hidden" id="notice-locale">
<div class="notice-body" dir="ltr">
<i class="fas fa-exclamation-triangle icon"></i>
Your preferred language is not yet fully supported.
<a class="link-text" href="https://crowdin.com/project/decentraleyes" target="_blank">
Help Translate
</a>
</div>
</section>
</body>
</html>
......@@ -46,6 +46,25 @@ options._determineScriptDirection = function (language) {
return scriptDirection;
};
options._languageIsFullySupported = function (language) {
let languageSupported, supportedLanguages;
languageSupported = false;
supportedLanguages = ['ar', 'bg', 'zh-CN', 'zh-TW', 'nl', 'en', 'fi', 'fr',
'de', 'is', 'id', 'pl', 'pt-PT', 'ro', 'es', 'tr'];
for (let supportedLanguage of supportedLanguages) {
if (language.search(supportedLanguage) !== -1) {
languageSupported = true;
}
}
return languageSupported;
};
options._getOptionElement = function (optionKey) {
return document.querySelector('[data-option=' + optionKey + ']');
};
......@@ -56,12 +75,20 @@ options._getOptionElement = function (optionKey) {
document.addEventListener('DOMContentLoaded', function () {
let i18nElements, scriptDirection, optionElements;
let i18nElements, scriptDirection, languageSupported, optionElements;
i18nElements = document.querySelectorAll('[data-i18n-content]');
scriptDirection = options._determineScriptDirection(navigator.language);
document.body.setAttribute('dir', scriptDirection);
languageSupported = options._languageIsFullySupported(navigator.language);
if (languageSupported === false) {
let localeNoticeElement = document.getElementById('notice-locale');
localeNoticeElement.setAttribute('class', 'notice');
}
i18nElements.forEach(function (i18nElement) {
let i18nMessageName = i18nElement.getAttribute('data-i18n-content');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment