aboutsummaryrefslogtreecommitdiff
path: root/src/gotext.go
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-05-14 11:07:22 -0300
committerEuAndreh <eu@euandre.org>2025-05-14 11:07:22 -0300
commitee86438a65583b21153c2e404a9b58f93f85645c (patch)
tree6c9d6a90e89df50314428bb04bb9c2573ff038e0 /src/gotext.go
parentsrc/gotext.go: Move Main() to the end of the file (diff)
downloadgotext-ee86438a65583b21153c2e404a9b58f93f85645c.tar.gz
gotext-ee86438a65583b21153c2e404a9b58f93f85645c.tar.xz
src/gotext.go: Add translatableErrorT
Diffstat (limited to 'src/gotext.go')
-rw-r--r--src/gotext.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gotext.go b/src/gotext.go
index 993e0f1..c236b4b 100644
--- a/src/gotext.go
+++ b/src/gotext.go
@@ -51,6 +51,10 @@ var (
+type translatableErrorT struct{
+ err string
+}
+
type msgIDT struct{
msgidPlural string
comment string
@@ -76,6 +80,10 @@ type envT struct{
+func (e *translatableErrorT) Error() string {
+ return Gettext(e.err)
+}
+
func formatComment(com string) string {
out := ""
for _, rawline := range strings.Split(com, "\n") {