From c036c228269fc30d0df770a7c7713fd9af829df7 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 7 Mar 2019 18:42:49 +0000 Subject: [PATCH] Add $:/info/browser/language to the info mechanism --- core/modules/info/platform.js | 2 ++ editions/tw5.com/tiddlers/mechanisms/InfoMechanism.tid | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/modules/info/platform.js b/core/modules/info/platform.js index ce258daea..94991ea80 100644 --- a/core/modules/info/platform.js +++ b/core/modules/info/platform.js @@ -35,6 +35,8 @@ exports.getInfoTiddlerFields = function() { // Screen size infoTiddlerFields.push({title: "$:/info/browser/screen/width", text: window.screen.width.toString()}); infoTiddlerFields.push({title: "$:/info/browser/screen/height", text: window.screen.height.toString()}); + // Language + infoTiddlerFields.push({title: "$:/info/browser/language", text: navigator.language || ""}); } return infoTiddlerFields; }; diff --git a/editions/tw5.com/tiddlers/mechanisms/InfoMechanism.tid b/editions/tw5.com/tiddlers/mechanisms/InfoMechanism.tid index 3187bea2f..d095b5a61 100644 --- a/editions/tw5.com/tiddlers/mechanisms/InfoMechanism.tid +++ b/editions/tw5.com/tiddlers/mechanisms/InfoMechanism.tid @@ -1,5 +1,5 @@ created: 20140720164948099 -modified: 20161017122011379 +modified: 20190307175403915 tags: Mechanisms title: InfoMechanism type: text/vnd.tiddlywiki @@ -14,6 +14,7 @@ System tiddlers in the namespace `$:/info/` are used to expose information about |!Title |!Description | |[[$:/info/browser]] |Running in the browser? ("yes" or "no") | +|[[$:/info/browser/language]] |<<.from-version "5.1.20">> Language as reported by browser (note that some browsers report two character codes such as `en` while others report full codes such as `en-GB`) | |[[$:/info/browser/screen/width]] |Screen width in pixels | |[[$:/info/browser/screen/height]] |Screen height in pixels | |[[$:/info/node]] |Running under [[Node.js]]? ("yes" or "no") |