PoC translations

by Jérôme Sengel

HTML

<select id="languages"></select>
<p id="translation"></p>
<br/>
<dl>
    <dt>Reading time for one word (seconds)</dt>
    <dd id="readingTime">0.5</dd>
    <dt>Words (splitted by space)</dt>
    <dd id="words"></dd>
    <dt>Letters (characters without spaces)</dt>
    <dd id="letters"></dd>
    <dt>Letters by word (average)</dt>
    <dd id="lettersByWord"></dd>
    <dt>Time to read the text (seconds)</dt>
    <dd id="timeToRead"></dd>
</dl>

CSS

dl {
  width: 100%;
  overflow: hidden;
  padding: 0;
  margin: 0
}
dt {
  float: left;
  width: 50%;
  font-weight: bold;
  padding: 0;
  margin: 0
}
dd {
  float: left;
  width: 50%;
  /* adjust the width; make sure the total of both is 100% */
  background: #dd0
  padding: 0;
  margin: 0
}

JavaScript

let translations = {

	"en" : "Always subtract, never add is the CHANEL Allure philosophy that inspired the Caliber 1. It is a journey to find artistic purity backed by technical excellence – the powerhouse behind the inner beauty of the Monsieur watch. The Caliber 1 is a mechanical work of art accentuated by two round skeleton bridges deeply entwined into the black movement.",

	"de" : "„Stets etwas entfernen, niemals etwas hinzufügen“ – diese Philosophie des Stils von CHANEL leitete auch die Entwicklung des Kaliber&nbsp;1. Das Streben nach ästhetischer Schlichtheit, gestützt von einer technischen Exzellenz, verleiht der Uhr MONSIEUR DE CHANEL die ganze Kraft ihrer inneren Schönheit. Das Kaliber&nbsp;1 ist ein mechanisches Meisterwerk, das von zwei rund skelettierten Brücken unterstrichen wird, die in den Tiefen des schwarzen Uhrwerks ineinander verschlungen sind.",

	"en_GB" : "Always subtract, never add back is the CHANEL Allure philosophy that inspired the Calibre 1. It is a journey to find artistic purity backed by technical excellence – the powerhouse behind the Monsieur watch's inner beauty. The Calibre 1 is a mechanical work of art accentuated by two round skeleton bridges deeply entwined into the black movement.",

	"en_ME" : "Always subtract, never add back is the CHANEL Allure philosophy that inspired the Calibre 1. It is a journey to find artistic purity backed by technical excellence – the powerhouse behind the Monsieur watch's inner beauty. The Calibre 1 is a mechanical work of art accentuated by two round skeleton bridges deeply entwined into the black movement.",

	"es" : "«Siempre quitar, nunca añadir» es la filosofía del estilo CHANEL que ha guiado la creación del Calibre&nbsp;1. Una búsqueda de pureza estética acentuada por la excelencia de la técnica, que confiere al reloj MONSIEUR DE CHANEL toda la fuerza de su belleza interior. El Calibre&nbsp;1 es una obra mecánica realzada por 2 puentes esqueleto circulares, entrelazados en la profundidad...