diff --git a/CHANGELOG.md b/CHANGELOG.md index a723fef..756d422 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.1] - 2023-01-23 + +### Added + +- Added Dutch translation (#1); thank you Jeroen van de Leur + ## [1.1.0] - 2022-10-24 ### Changed diff --git a/README.md b/README.md index 0d598e2..62e3972 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Please note that `index.html` makes use of `password-om.min.css` by default. ### Translation -The (very) few strings can be translated. The distribution contains strings in English (default), Swedish, and German. The code attempts to guess the language from the **navigator.language** properties. If they do not exist, or cannot be interpreted, the fallback language used is English. +The (very) few strings can be translated. The distribution contains strings in English (default), Swedish, German, and Dutch. The code attempts to guess the language from the **navigator.language** properties. If they do not exist, or cannot be interpreted, the fallback language used is English. The "string setup" is done in the `POM_initialSetup()` function. @@ -76,6 +76,7 @@ If you would like to contribute to the translation, please open an issue and pos ## Credits Thanks to **Peter Hampf** (hello `O/T-Track` :metal:) for the German translation :blush: +Thanks to **Jeroen van de Leur** for the Dutch translation :blush: The "cloud icon" comes from [Streamline](https://streamlinehq.com) @@ -85,7 +86,7 @@ The "cloud icon" comes from [Streamline](https://streamlinehq.com) **POMjs** is licensed under the GPLv2 license. See the [`LICENSE`](LICENSE) file for more details. -Copyright 2022 Joaquim Homrighausen. +Copyright 2022, 2023 Joaquim Homrighausen. ### Demo diff --git a/index.html b/index.html index a2d1e98..7c3ebb3 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ + @@ -13,6 +14,7 @@ POMjs - Random Password Generator POMjs - Slumpmässigt Lösenord POMjs - Zufallsgenerator für Passwörter + POMjs - Willekeurig Wachtwoordgenerator @@ -23,7 +25,6 @@ own website, please be sure to change the fields accordingly, thank you. --> - -

POMjs by Joaquim Homrighausen, get it at GitHub (GPLv2)

diff --git a/js/password-om.js b/js/password-om.js index caaf39b..c279300 100644 --- a/js/password-om.js +++ b/js/password-om.js @@ -1,5 +1,5 @@ /** - * POMjs 1.1.0 + * POMjs 1.1.1 * * password-om.js * @@ -7,7 +7,7 @@ * generator site (password.oppetmoln.se). For the sake of having a name, it * shall be POMjs. There's really nothing fancy going on here :-) * - * Copyright 2022 Joaquim Homrighausen; All rights reserved. + * Copyright 2022, 2023 Joaquim Homrighausen; All rights reserved. * Development sponsored by WebbPlatsen i Sverige AB * https://www.webbplatsen.se * @@ -332,6 +332,12 @@ function POM_initialSetup() { POM_cfgSlogan = 'Keine Cookies, keine Tracker.
Nur Passwörter.'; POM_cfgGenPasswordHint = 'Passwort generieren'; break; + case 'nl': + /* Thank you Jeroen van de Leur */ + POM_cfgTitle = 'Willekeurig Wachtwoord Generator'; + POM_cfgSlogan = 'Geen cookies, geen trackers.
Uitsluitend wachtwoorden.'; + POM_cfgGenPasswordHint = 'Genereer wachtwoord'; + break; default: POM_cfgTitle = 'Random Password Generator'; POM_cfgSlogan = 'No cookies, no trackers.
Just passwords.'; diff --git a/js/password-om.min.js b/js/password-om.min.js index 2e90185..abb3f56 100644 --- a/js/password-om.min.js +++ b/js/password-om.min.js @@ -1 +1 @@ -var POM_cfgLanguage="noLang?",POM_cfgTitle="noTitle?",POM_cfgSlogan="noSlogan?",POM_cfgGenPasswordHint="noHint?";const POM_strUppercase=POM_genAlphabet(!0),POM_strLowercase=POM_genAlphabet(!1),POM_strDigits=POM_genDigits(),POM_strSpecialOne="-._#$@%!",POM_strSpecialTwo='"+(){}[]?&,*<>|:;^',POM_strUppercase_Default=!0,POM_strLowercase_Default=!0,POM_strDigits_Default=!0,POM_strSpecialOne_Default=!0,POM_strSpecialTwo_Default=!1,POM_mkPasswordOnLoad=!0,POM_changeIsClick=!0,POM_minLength=16,POM_maxLength=256,POM_sliderStep=8,POM_debug=!1;function POM_genAlphabet(e=!1){return[...Array(26)].map(((t,n)=>String.fromCharCode(n+(e?65:97)))).join("")}function POM_genDigits(){return[...Array(10)].map(((e,t)=>String.fromCharCode(t+48))).join("")}function POM_distillString(e){return e=e.split(""),e=new Set(e),e=[...e].join("+")}function POM_escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function POM_validateNumInput(){let e=document.getElementById("mk-password-len-slider");e&&(""===this.value&&(this.value=16),e.value=this.value,e.value<16?e.value=16:e.value>256&&(e.value=256),this.value=e.value),document.getElementById("mk-password-btn").click()}function POM_generatePassword(){let e=document.getElementById("mk-password-strength");e.style.background="inherit",e.style.width="0",e.style.transition="none";let t=document.getElementById("mk-password-field");t.value="",t.classList.remove("mk-password-field-focus");let n=document.getElementById("mk-length-field");if(n&&n.value>=16&&n.value<=256){let a="";if(document.getElementById("mk-uppercase-select").checked&&(a+=POM_strUppercase),document.getElementById("mk-special-one-select").checked&&(a+="-._#$@%!-._#$@%!"),document.getElementById("mk-digits-select").checked&&(a+=POM_strDigits),document.getElementById("mk-lowercase-select").checked&&(a+=POM_strLowercase),document.getElementById("mk-digits-select").checked&&(a+=POM_strDigits),document.getElementById("mk-special-two-select").checked&&(a+=POM_strSpecialTwo+POM_strSpecialTwo),a.length>0){let s="",l="";for(let e=0;e7&&o++,s.length>15&&o++,s.length>31&&(o+=2),s.length>63&&(o+=4),o>8&&(o=8),e.style.background=o>6?"#27ce60":o>5?"#27ae60":o>3?"#FFC300":"#C0392B",e.style.width=12.5*o+"%",e.style.transition="width 0.3s ease-in"}}}function POM_copyPassword(){let e=document.getElementById("mk-password-field");if(e&&e.value.length>0)if(navigator&&navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(e.value).then((function(){e.classList.add("mk-password-field-focus")}),(function(e){alert("Could not copy text: "+e)}));else{var t=document.createElement("textarea");t.value=e.value,t.setAttribute("readonly",""),t.style.position="absolute",t.style.top="-6969px",t.style.left="-6969px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")?e.classList.add("mk-password-field-focus"):alert("That did not work")}catch(e){alert("Could not copy text: "+e.message)}document.body.removeChild(t)}}function POM_initialSetup(){if(navigator.language){let e=(POM_cfgLanguage=navigator.language).indexOf("-");e&&e>0&&(POM_cfgLanguage=POM_cfgLanguage.substring(0,e)),POM_cfgLanguage=POM_cfgLanguage.toLowerCase()}else POM_cfgLanguage="???";switch(POM_cfgLanguage){case"sv":case"se":POM_cfgTitle="Slumpmässigt Lösenord",POM_cfgSlogan='Inga kakor, ingen spårning.
Bara lösenord.',POM_cfgGenPasswordHint="Generera lösenord";break;case"de":POM_cfgTitle="Zufallsgenerator für Passwörter",POM_cfgSlogan='Keine Cookies, keine Tracker.
Nur Passwörter.',POM_cfgGenPasswordHint="Passwort generieren";break;default:POM_cfgTitle="Random Password Generator",POM_cfgSlogan='No cookies, no trackers.
Just passwords.',POM_cfgGenPasswordHint="Generate password"}document.getElementById("cfg-page-title").innerHTML=POM_cfgTitle,document.getElementById("cfg-page-slogan").innerHTML=POM_cfgSlogan,document.getElementById("cfg-page-lang").innerHTML="["+POM_cfgLanguage+"]",document.getElementById("mk-password-btn").title=POM_cfgGenPasswordHint,document.getElementById("mk-uppercase-select").checked=true,document.getElementById("mk-lowercase-select").checked=true,document.getElementById("mk-digits-select").checked=true,document.getElementById("mk-special-one-select").checked=true,document.getElementById("mk-special-two-select").checked=false,document.getElementById("mk-password-field").value="";let e=document.getElementById("mk-password-len-slider");e&&(e.value=16,e.setAttribute("min",16),e.setAttribute("max",256),e.step=8),document.getElementById("mk-length-field").value=16,document.getElementById("gen-uppercase").innerText=POM_strUppercase,document.getElementById("gen-lowercase").innerText=POM_strLowercase,document.getElementById("gen-digits").innerText=POM_strDigits,document.getElementById("gen-special-one").innerText="-._#$@%!",document.getElementById("gen-special-two").innerText=POM_strSpecialTwo,document.getElementById("gen-timestamp").innerText=Date.now(),document.getElementById("mk-password-len-slider").addEventListener("input",(function(){let e=document.getElementById("mk-length-field");e&&(e.value=this.value,e.value<16?e.value=16:e.value>256&&(e.value=256),this.value=e.value)})),document.getElementById("mk-length-field").addEventListener("click",(function(){this.select()})),document.getElementById("mk-length-field").addEventListener("blur",POM_validateNumInput),document.getElementById("mk-length-field").addEventListener("change",POM_validateNumInput),document.getElementById("mk-password-btn").addEventListener("click",POM_generatePassword),document.getElementById("mk-password-field").addEventListener("click",POM_copyPassword),document.getElementById("mk-password-btn").click(),document.getElementById("mk-uppercase-select").addEventListener("click",POM_generatePassword),document.getElementById("mk-special-one-select").addEventListener("click",POM_generatePassword),document.getElementById("mk-digits-select").addEventListener("click",POM_generatePassword),document.getElementById("mk-lowercase-select").addEventListener("click",POM_generatePassword),document.getElementById("mk-digits-select").addEventListener("click",POM_generatePassword),document.getElementById("mk-special-two-select").addEventListener("click",POM_generatePassword),document.getElementById("mk-password-len-slider").addEventListener("change",POM_generatePassword)}"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?POM_initialSetup():document.addEventListener("DOMContentLoaded",POM_initialSetup); \ No newline at end of file +var POM_cfgLanguage="noLang?",POM_cfgTitle="noTitle?",POM_cfgSlogan="noSlogan?",POM_cfgGenPasswordHint="noHint?";const POM_strUppercase=POM_genAlphabet(!0),POM_strLowercase=POM_genAlphabet(!1),POM_strDigits=POM_genDigits(),POM_strSpecialOne="-._#$@%!",POM_strSpecialTwo='"+(){}[]?&,*<>|:;^',POM_strUppercase_Default=!0,POM_strLowercase_Default=!0,POM_strDigits_Default=!0,POM_strSpecialOne_Default=!0,POM_strSpecialTwo_Default=!1,POM_mkPasswordOnLoad=!0,POM_changeIsClick=!0,POM_minLength=16,POM_maxLength=256,POM_sliderStep=8,POM_debug=!1;function POM_genAlphabet(e=!1){return[...Array(26)].map((t,n)=>String.fromCharCode(n+(e?65:97))).join("")}function POM_genDigits(){return[...Array(10)].map((e,t)=>String.fromCharCode(t+48)).join("")}function POM_distillString(e){return e=e.split(""),e=[...e=new Set(e)].join("+")}function POM_escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function POM_validateNumInput(){let e=document.getElementById("mk-password-len-slider");e&&(""===this.value&&(this.value=16),e.value=this.value,e.value<16?e.value=16:e.value>256&&(e.value=256),this.value=e.value),document.getElementById("mk-password-btn").click()}function POM_generatePassword(){let e=document.getElementById("mk-password-strength");e.style.background="inherit",e.style.width="0",e.style.transition="none";let t=document.getElementById("mk-password-field");t.value="",t.classList.remove("mk-password-field-focus");let n=document.getElementById("mk-length-field");if(n&&n.value>=16&&n.value<=256){let s="";if(document.getElementById("mk-uppercase-select").checked&&(s+=POM_strUppercase),document.getElementById("mk-special-one-select").checked&&(s+=POM_strSpecialOne+POM_strSpecialOne),document.getElementById("mk-digits-select").checked&&(s+=POM_strDigits),document.getElementById("mk-lowercase-select").checked&&(s+=POM_strLowercase),document.getElementById("mk-digits-select").checked&&(s+=POM_strDigits),document.getElementById("mk-special-two-select").checked&&(s+=POM_strSpecialTwo+POM_strSpecialTwo),s.length>0){let l="",a="";for(let i=0;i7&&d++,l.length>15&&d++,l.length>31&&(d+=2),l.length>63&&(d+=4),d>8&&(d=8),d>6?e.style.background="#27ce60":d>5?e.style.background="#27ae60":d>3?e.style.background="#FFC300":e.style.background="#C0392B",e.style.width=12.5*d+"%",e.style.transition="width 0.3s ease-in"}}}function POM_copyPassword(){let e=document.getElementById("mk-password-field");if(e&&e.value.length>0){if(navigator&&navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(e.value).then(function(){e.classList.add("mk-password-field-focus")},function(e){alert("Could not copy text: "+e)});else{var t=document.createElement("textarea");t.value=e.value,t.setAttribute("readonly",""),t.style.position="absolute",t.style.top="-6969px",t.style.left="-6969px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")?e.classList.add("mk-password-field-focus"):alert("That did not work")}catch(n){alert("Could not copy text: "+n.message)}document.body.removeChild(t)}}}function POM_initialSetup(){if(navigator.language){let e=(POM_cfgLanguage=navigator.language).indexOf("-");e&&e>0&&(POM_cfgLanguage=POM_cfgLanguage.substring(0,e)),POM_cfgLanguage=POM_cfgLanguage.toLowerCase()}else POM_cfgLanguage="???";switch(POM_cfgLanguage){case"sv":case"se":POM_cfgTitle="Slumpm\xe4ssigt L\xf6senord",POM_cfgSlogan='Inga kakor, ingen sp\xe5rning.
Bara l\xf6senord.',POM_cfgGenPasswordHint="Generera l\xf6senord";break;case"de":POM_cfgTitle="Zufallsgenerator f\xfcr Passw\xf6rter",POM_cfgSlogan='Keine Cookies, keine Tracker.
Nur Passw\xf6rter.',POM_cfgGenPasswordHint="Passwort generieren";break;case"nl":POM_cfgTitle="Willekeurig Wachtwoord Generator",POM_cfgSlogan='Geen cookies, geen trackers.
Uitsluitend wachtwoorden.',POM_cfgGenPasswordHint="Genereer wachtwoord";break;default:POM_cfgTitle="Random Password Generator",POM_cfgSlogan='No cookies, no trackers.
Just passwords.',POM_cfgGenPasswordHint="Generate password"}document.getElementById("cfg-page-title").innerHTML=POM_cfgTitle,document.getElementById("cfg-page-slogan").innerHTML=POM_cfgSlogan,document.getElementById("cfg-page-lang").innerHTML="["+POM_cfgLanguage+"]",document.getElementById("mk-password-btn").title=POM_cfgGenPasswordHint,document.getElementById("mk-uppercase-select").checked=!0,document.getElementById("mk-lowercase-select").checked=!0,document.getElementById("mk-digits-select").checked=!0,document.getElementById("mk-special-one-select").checked=!0,document.getElementById("mk-special-two-select").checked=!1,document.getElementById("mk-password-field").value="";let t=document.getElementById("mk-password-len-slider");t&&(t.value=16,t.setAttribute("min",16),t.setAttribute("max",256),t.step=8),document.getElementById("mk-length-field").value=16,document.getElementById("gen-uppercase").innerText=POM_strUppercase,document.getElementById("gen-lowercase").innerText=POM_strLowercase,document.getElementById("gen-digits").innerText=POM_strDigits,document.getElementById("gen-special-one").innerText=POM_strSpecialOne,document.getElementById("gen-special-two").innerText=POM_strSpecialTwo,document.getElementById("gen-timestamp").innerText=Date.now(),document.getElementById("mk-password-len-slider").addEventListener("input",function(){let e=document.getElementById("mk-length-field");e&&(e.value=this.value,e.value<16?e.value=16:e.value>256&&(e.value=256),this.value=e.value)}),document.getElementById("mk-length-field").addEventListener("click",function(){this.select()}),document.getElementById("mk-length-field").addEventListener("blur",POM_validateNumInput),document.getElementById("mk-length-field").addEventListener("change",POM_validateNumInput),document.getElementById("mk-password-btn").addEventListener("click",POM_generatePassword),document.getElementById("mk-password-field").addEventListener("click",POM_copyPassword),document.getElementById("mk-password-btn").click(),document.getElementById("mk-uppercase-select").addEventListener("click",POM_generatePassword),document.getElementById("mk-special-one-select").addEventListener("click",POM_generatePassword),document.getElementById("mk-digits-select").addEventListener("click",POM_generatePassword),document.getElementById("mk-lowercase-select").addEventListener("click",POM_generatePassword),document.getElementById("mk-digits-select").addEventListener("click",POM_generatePassword),document.getElementById("mk-special-two-select").addEventListener("click",POM_generatePassword),document.getElementById("mk-password-len-slider").addEventListener("change",POM_generatePassword)}"complete"!==document.readyState&&("loading"===document.readyState||document.documentElement.doScroll)?document.addEventListener("DOMContentLoaded",POM_initialSetup):POM_initialSetup(); \ No newline at end of file