msgid "Incorrect dictionary file."
msgstr "Dictionaire incorrect."
+
+msgid "Enable spell checker"
+msgstr "Activer le vérificateur orthographique"
+
+msgid "Spell checking requires Trivabble to download a dictionary. This dictionary is based on Aspell. Do you confirm?"
+msgstr "La vérification orthographique nécessite que Trivabble télécharge un dictionnaire. Ce dictionnaire est construit grâce à Aspell. Confirmez-vous ?"
<p id="help-turn" data-l10n="text-content">Who's turn? Click on the Turn button!</p>
<button id="clear-rack" class="minibutton" data-l10n="text-content">Put back all the tiles of your rack in the bag</button>
<button id="show-rack" class="minibutton" data-l10n="text-content">Show my rack to other players</button>
- <button id="check-spelling" class="minibutton" data-l10n="text-content" disabled="disabled">Check spelling for new words</button>
+ <button id="enable-spell-checker" class="minibutton" data-l10n="text-content">Enable spell checker</button>
+ <button id="check-spelling" class="minibutton" data-l10n="text-content" style="display: none">Check spelling for new words</button>
</div>
</body>
</html>
}
function downloadDictionary(code) {
+ if (localStorage.spellChecker) {
+ document.getElementById("enable-spell-checker").style.display = "none";
+ document.getElementById("check-spelling").style.display = "none";
+ } else {
+ document.getElementById("enable-spell-checker").style.display = "block";
+ document.getElementById("check-spelling").style.display = "none";
+ }
+
/* static variable */
if (downloadDictionary.code === code) {
return;
if ((file.readyState === 4) && (file.status == "200")) {
try {
dictionary = file.responseText.split("\n");
- document.getElementById("check-spelling").disabled = false;
+ document.getElementById("check-spelling").style.display = "block";
} catch (e) {
myAlert(_("Incorrect dictionary file."));
}
file.send(null);
}
+ function enableSpellChecker() {
+ myConfirm(
+ _("Spell checking requires Trivabble to download a dictionary. This dictionary is based on Aspell. Do you confirm?"),
+ function () {
+ localStorage.spellChecker = true;
+ downloadDictionary(localStorage.trivabbleBoardLang);
+ },
+ function () {
+ localStorage.spellChecker = false;
+ downloadDictionary(localStorage.trivabbleBoardLang);
+ });
+ }
+
function removeElem(elem) {
elem.parentNode.removeChild(elem);
}
case "boardLang":
localStorage.trivabbleBoardLang = value;
document.getElementById("board-lang").value = value;
- document.getElementById("check-spelling").disabled = true;
downloadDictionary(value);
break;
}
document.getElementById("join-game").onclick = joinGame;
document.getElementById("clear-rack").onclick = clearRack;
document.getElementById("show-rack").onclick = showRack;
+ document.getElementById("enable-spell-checker").onclick = enableSpellChecker;
document.getElementById("check-spelling").onclick = checkSpelling;
helpClear.onclick = clearGame;
}