From b63215a55baa9fc60a8465379baa5270bc28331b Mon Sep 17 00:00:00 2001 From: iacore Date: Wed, 9 Oct 2024 12:26:06 +0000 Subject: [PATCH] [i18n] Add exceptions --- i18n/crawler/main.go | 10 +++------- i18n/exceptions.go | 6 ++++++ 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 i18n/exceptions.go diff --git a/i18n/crawler/main.go b/i18n/crawler/main.go index bfa3e51..79a71a6 100644 --- a/i18n/crawler/main.go +++ b/i18n/crawler/main.go @@ -10,6 +10,8 @@ import ( "github.com/soluble-ai/go-jnode" "github.com/yargevad/filepathx" "golang.org/x/net/html" + + "codeberg.org/vnpower/pixivfe/v2/i18n" ) func main() { @@ -75,13 +77,7 @@ func processFile(filename string, result *jnode.Node) { // manual filter func shouldIgnore(msg string) bool { - if msg == "" { - return true - } - if msg == "»" { - return true - } - return false + return i18n.IgnoreTheseStrings[msg] } func visit(node *html.Node, record func([]*html.Node)) { diff --git a/i18n/exceptions.go b/i18n/exceptions.go new file mode 100644 index 0000000..1a90292 --- /dev/null +++ b/i18n/exceptions.go @@ -0,0 +1,6 @@ +package i18n + +var IgnoreTheseStrings = map[string]bool { + "": true, + "»": true, +}