Skip to content
This repository was archived by the owner on Jul 27, 2024. It is now read-only.

Commit 5fa4fb9

Browse files
committed
fix locale string
1 parent d478cd9 commit 5fa4fb9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/background/utils/script.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export function parseMeta(code) {
3030
flag = 0;
3131
}
3232
if (flag === 1 && group1[0] === '@') {
33-
const key = group1.slice(1).replace(/[-_](\w)/g, (m, g) => g.toUpperCase());
33+
const [keyName, locale] = group1.slice(1).split(':');
34+
const camelKey = keyName.replace(/[-_](\w)/g, (m, g) => g.toUpperCase());
35+
const key = locale ? `${camelKey}:${locale.toLowerCase()}` : camelKey;
3436
const val = group2.trim();
3537
const data = meta[key];
3638
// multiple values allowed

0 commit comments

Comments
 (0)