From 395d157f35ebc604b151f6bbfb2b7245c850d536 Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Tue, 11 Aug 2026 21:31:01 +0200 Subject: [PATCH] add a configuration variable --- README.md | 4 ++++ public/config.js.sample | 3 +++ public/trivabble.js | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3750e12..03e0564 100644 --- a/README.md +++ b/README.md @@ -288,6 +288,10 @@ Once dictionaries have been build, script 'dict-dists-extractor/make_optimized_b Calculus 'floor((N - 15) / 10))' defines an index to choose parameter 'p' from set '{0.8 0.7 0.65 0.6}'. Letter value is defined by 'min(floor(1 + 9 ceil(r^p) * 100), 10)' +By default, optimized bags are not presented in the bag selector. To activate +this functionality, OPTIMIZED_LANGUAGE_BAG must be set to true in configuration +file. + ### Credits Thanks [Laurent Mazet](http://www.softndesign.org/~mazet/) for many contributions. diff --git a/public/config.js.sample b/public/config.js.sample index e06bc0d..6905410 100644 --- a/public/config.js.sample +++ b/public/config.js.sample @@ -59,6 +59,9 @@ window.TrivabbleConf = { // Enable custom board definitions //ENABLE_CUSTOM_BOARD: false, + // Enable optimized language bags + //OPTIMIZED_LANGUAGE_BAG: false, + // I don't like trailing commas, here is a nice message for you reading this file :-) HAVE_FUN: true }; diff --git a/public/trivabble.js b/public/trivabble.js index b3d65f4..7848233 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -67,6 +67,7 @@ setConf("ENABLE_TIMER", false); setConf("CELL_CAPTIONS", "dots"); // "clip", "dots", "none", "short" setConf("ENABLE_CUSTOM_BOARD", false); + setConf("OPTIMIZED_LANGUAGE_BAG",false); function isSetting(key) { return Object.prototype.hasOwnProperty.call(Conf, key) || @@ -2619,7 +2620,9 @@ boardLangSelect.textContent = ""; for (const key of Object.keys(availableBoardLangs)) { - boardLangSelect.add(new Option(_(availableBoardLangs[key]), key)); + if (getSetting("OPTIMIZED_LANGUAGE_BAG") || !/-opt/.test(key)) { + boardLangSelect.add(new Option(_(availableBoardLangs[key]), key)); + } } Array.prototype.sort.call(boardLangSelect.options, function (a, b) { -- 2.30.2