From df5f6048e6a177b5ce3920d10a1249129c669a1f Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 19 Jun 2024 19:50:55 -0300 Subject: client: client modules --- src/static/js/localization-nonsense.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/static/js/localization-nonsense.js (limited to 'src/static/js/localization-nonsense.js') diff --git a/src/static/js/localization-nonsense.js b/src/static/js/localization-nonsense.js new file mode 100644 index 00000000..8b6d1ef0 --- /dev/null +++ b/src/static/js/localization-nonsense.js @@ -0,0 +1,30 @@ +// Another old, unused chunk of code. + +/* +const language = document.documentElement.getAttribute('lang'); + +let list; +if (typeof Intl === 'object' && typeof Intl.ListFormat === 'function') { + const getFormat = (type) => { + const formatter = new Intl.ListFormat(language, {type}); + return formatter.format.bind(formatter); + }; + + list = { + conjunction: getFormat('conjunction'), + disjunction: getFormat('disjunction'), + unit: getFormat('unit'), + }; +} else { + // Not a gr8 mock we've got going here, 8ut it's *mostly* language-free. + // We use the same mock for every list 'cuz we don't have any of the + // necessary CLDR info to appropri8tely distinguish 8etween them. + const arbitraryMock = (array) => array.join(', '); + + list = { + conjunction: arbitraryMock, + disjunction: arbitraryMock, + unit: arbitraryMock, + }; +} +*/ -- cgit 1.3.0-6-gf8a5