From da12b1a4e8b24570fe6647cd7b1f181fd16f0c72 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Sun, 21 Jun 2015 19:01:05 +0200 Subject: [PATCH] Add Swabian dialect. --- index.html | 1 + qlock.d3.js | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 qlock.d3.js diff --git a/index.html b/index.html index ee84628..df06c3e 100644 --- a/index.html +++ b/index.html @@ -13,6 +13,7 @@ + diff --git a/qlock.d3.js b/qlock.d3.js new file mode 100644 index 0000000..7653011 --- /dev/null +++ b/qlock.d3.js @@ -0,0 +1,78 @@ +// QLOCKTWO Swabian-German Localization +// after the official QlockTwo at http://qlocktwo.com/ +// Script written by Markus Birth + +var qlockLangSwabian = { + 'langCode': 'd3', + 'language': 'Swabian-German', + + 'lines': [ + "ESKISCHFUNK", + "DREIVIERTLA", + "ZEHNBIEFÜNF", + "NACHGERTVOR", + "HALBXFÜNFEI", + "OISECHSELFE", + "ZWOIEACHTED", + "DREIEZWÖLFE", + "ZEHNEUNEUHL", + "SIEBNEVIERE" + ], + + 'pre': 'ES ISCH ', + + 'first': [ + "", + "FÜNF NACH ", + "ZEHN NACH ", + "VIERTL ", + "ZEHN VOR HALB ", + "FÜNF VOR HALB ", + "HALB ", + "FÜNF NACH HALB ", + "ZEHN NACH HALB ", + "DREIVIERTL ", + "ZEHN VOR ", + "FÜNF VOR " + ], + + 'second': [ + "ZWÖLFE", + "OIS", + "ZWOIE", + "DREIE", + "VIERE", + "FÜNFE", + "SECHSE", + "SIEBN", + "ACHTE", + "NEUNE", + "ZEHNE", + "ELFE" + ], + + /** + * @param {Date} time + * @type String + */ + 'makeSentence': function( time ) { + var h = time.getHours(); + var m = time.getMinutes(); + + var h12 = h%12; + var m5 = Math.floor( m/5 ); + if (m5 >= 3) { + h12 += 1; + if (h12 > 11) h12=0; + } + + var sentence = this.pre + this.first[m5] + this.second[h12]; +// if (m5 == 0) { +// sentence = sentence.replace( /OIS/i, 'EI' ); +// } + return sentence; + } + +}; + +qlockTwo.availLangs.push( qlockLangSwabian );