mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-11-16 14:54:23 +08:00
feat(i18n): add Russian UI and harden localization
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// Names used by renderers are technical tokens, including inside raw examples.
|
||||
export function messageContractTokens(message) {
|
||||
return [
|
||||
...message.matchAll(
|
||||
/\$[\p{L}_][\p{L}\p{N}_]*(?:\.[\p{L}_][\p{L}\p{N}_]*)*/gu,
|
||||
),
|
||||
...message.matchAll(/<\/?[\p{L}][\p{L}\p{N}_-]*(?:\s[^<>]*?)?\s*\/?>/gu),
|
||||
]
|
||||
.map(([token]) =>
|
||||
token.startsWith('<') ? token.match(/^<\/?[^\s/>]+/u)[0] + '>' : token,
|
||||
)
|
||||
.sort();
|
||||
}
|
||||
Reference in New Issue
Block a user