« get me outta code hell

add support for localizing index (#123 etc) - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-03-07 18:36:10 -0400
committer(quasar) nebula <towerofnix@gmail.com>2021-03-07 18:36:10 -0400
commitf6c8796571a67111f2070328e806b5a8adbfe9c6 (patch)
treefa45974cdef8332f0631a39a47c20d8ddf4a52e9
parente79bde9baead5d38d07cae8c09f89781f31fc7ed (diff)
add support for localizing index (#123 etc)
-rw-r--r--strings-default.json1
-rwxr-xr-xupd8.js3
2 files changed, 2 insertions, 2 deletions
diff --git a/strings-default.json b/strings-default.json
index d9ab89a7..d611758c 100644
--- a/strings-default.json
+++ b/strings-default.json
@@ -27,6 +27,7 @@
     "count.duration.minutes.withUnit": "{MINUTES}:{SECONDS} minutes",
     "count.duration.approximate": "~{DURATION}",
     "count.duration.missing": "_:__",
+    "count.index": "#{INDEX}",
     "count.words": "{WORDS}",
     "count.words.thousand": "{WORDS}k",
     "count.words.withUnit.singular": "{WORDS} word",
diff --git a/upd8.js b/upd8.js
index 7d191e0d..772573a8 100755
--- a/upd8.js
+++ b/upd8.js
@@ -568,8 +568,7 @@ const count = {
     },
 
     index: (value, {strings}) => {
-        // TODO: Localize...?
-        return '#' + value;
+        return strings('count.index', {index: value});
     },
 
     number: value => strings.intl.number.format(value),