diff --git a/changelog/unreleased/use-gotext-master.md b/changelog/unreleased/use-gotext-master.md new file mode 100644 index 0000000000..3dc116c1f7 --- /dev/null +++ b/changelog/unreleased/use-gotext-master.md @@ -0,0 +1,5 @@ +Enhancement: Use gotext master + +We needed to use forked version until our upstream changes were merged + +https://github.com/owncloud/ocis/pull/5867 diff --git a/go.mod b/go.mod index cdd0b41a30..cf5a5a1a5d 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/jellydator/ttlcache/v2 v2.11.1 github.com/jellydator/ttlcache/v3 v3.0.1 github.com/justinas/alice v1.2.0 - github.com/leonelquinteros/gotext v1.5.2 + github.com/leonelquinteros/gotext v1.5.3-0.20230317130943-71a59c05b2c1 github.com/libregraph/idm v0.4.1-0.20230221143410-3503963047a5 github.com/libregraph/lico v0.59.4 github.com/mitchellh/mapstructure v1.5.0 @@ -306,5 +306,3 @@ require ( ) replace github.com/cs3org/go-cs3apis => github.com/c0rby/go-cs3apis v0.0.0-20230110100311-5b424f1baa35 - -replace github.com/leonelquinteros/gotext => github.com/kobergj/gotext v0.0.0-20230309141732-b909eb0b8956 diff --git a/go.sum b/go.sum index 45d82a29f8..e07a366e0c 100644 --- a/go.sum +++ b/go.sum @@ -1180,6 +1180,10 @@ github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leonelquinteros/gotext v1.5.2 h1:T2y6ebHli+rMBCjcJlHTXyUrgXqsKBhl/ormgvt7lPo= +github.com/leonelquinteros/gotext v1.5.2/go.mod h1:AT4NpQrOmyj1L/+hLja6aR0lk81yYYL4ePnj2kp7d6M= +github.com/leonelquinteros/gotext v1.5.3-0.20230317130943-71a59c05b2c1 h1:k56sFOOJ0CYuQtGoRSeAMhP1R692+iNH+S1dC/CEz0w= +github.com/leonelquinteros/gotext v1.5.3-0.20230317130943-71a59c05b2c1/go.mod h1:AT4NpQrOmyj1L/+hLja6aR0lk81yYYL4ePnj2kp7d6M= github.com/libregraph/idm v0.4.1-0.20230221143410-3503963047a5 h1:brLMXSjWoWhGXs8LpK+Lx+FQCtGLUa51Mq/ggHv9AV0= github.com/libregraph/idm v0.4.1-0.20230221143410-3503963047a5/go.mod h1:Tnm4pyVJTEbHm3GUNmceWT1DHzdrYqrJmZyt/xh7L+A= github.com/libregraph/lico v0.59.4 h1:aQNwWAtC3hyQeZpP+5U1M7PIrPtvHanRWRfMp33wbUQ= diff --git a/services/userlog/pkg/service/conversion.go b/services/userlog/pkg/service/conversion.go index 15b6600ef0..16788143e4 100644 --- a/services/userlog/pkg/service/conversion.go +++ b/services/userlog/pkg/service/conversion.go @@ -5,6 +5,7 @@ import ( "context" "embed" "errors" + "io/fs" "strings" "text/template" "time" @@ -287,7 +288,8 @@ func loadTemplates(nt NotificationTemplate, locale string, path string) (string, // Create Locale with library path and language code and load default domain var l *gotext.Locale if path == "" { - l = gotext.NewLocaleFS("l10n/locale", locale, _translationFS) + filesystem, _ := fs.Sub(_translationFS, "l10n/locale") + l = gotext.NewLocaleFS(locale, filesystem) } else { // use custom path instead l = gotext.NewLocale(path, locale) }