Word parameterized messages at the sender with omarchy-text and translate only exact text in the shell
This commit is contained in:
1 parent
619979a716
commit
051952600d
38 files changed
+198
-156
No files matched your search
+1
-6
@@ -13,7 +13,7 @@ function tr(text) {
|
||||
})
|
||||
}
|
||||
|
||||
// Text built elsewhere around a name: the first English template that matches is translated with what %1.. captured.
|
||||
// Text a panel's own model builds in known formats: the first matching template is translated with what %1.. captured.
|
||||
function trMatch(text, templates) {
|
||||
for (var i = 0; i < templates.length; i++) {
|
||||
var pattern = "^" + templates[i].replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/%\d/g, "(.+)") + "$"
|
||||
@@ -22,8 +22,3 @@ function trMatch(text, templates) {
|
||||
}
|
||||
return tr(text)
|
||||
}
|
||||
|
||||
// Finished messages from other programs (notifications, collectors) that carry a name or number.
|
||||
function trMessage(text) {
|
||||
return trMatch(text, Zh.templates)
|
||||
}
|
||||
Reference in new issue
Block a user