« get me outta code hell

upd8, data, test: export internal strings path cleanly, fix tests - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-11-09 20:16:30 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-11-09 20:16:30 -0400
commit1d991bb4bc877363532971a74f70e55939c637bb (patch)
tree45f368639455f17ba45c377e770b7763c3a3bd59 /src/data
parentf6a0bf1d7b4652a7dd04ed3340010ee2a6e47b7f (diff)
upd8, data, test: export internal strings path cleanly, fix tests
Diffstat (limited to 'src/data')
-rw-r--r--src/data/language.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/data/language.js b/src/data/language.js
index 6ffc31e0..3fc14da7 100644
--- a/src/data/language.js
+++ b/src/data/language.js
@@ -1,6 +1,7 @@
 import EventEmitter from 'node:events';
 import {readFile} from 'node:fs/promises';
 import path from 'node:path';
+import {fileURLToPath} from 'node:url';
 
 import chokidar from 'chokidar';
 import he from 'he'; // It stands for "HTML Entities", apparently. Cursed.
@@ -18,6 +19,14 @@ import {
 
 const {Language} = T;
 
+export const DEFAULT_STRINGS_FILE = 'strings-default.yaml';
+
+export const internalDefaultStringsFile =
+  path.resolve(
+    path.dirname(fileURLToPath(import.meta.url)),
+    '../',
+    DEFAULT_STRINGS_FILE);
+
 export function processLanguageSpec(spec, {existingCode = null} = {}) {
   const {
     'meta.languageCode': code,