From 2e0dee7c096901f07ae33248b27528f7f85426fd Mon Sep 17 00:00:00 2001 From: plastikfan Date: Wed, 9 Oct 2024 11:50:39 +0100 Subject: [PATCH] ref: replace extendio.i18n with li18ngo (#226) --- go.mod | 3 ++- go.sum | 2 ++ src/app/cfg/config-runner.go | 14 ++++++------ src/app/cfg/config-runner_test.go | 7 +++++- src/app/command/bootstrap.go | 22 +++++++++---------- ...nd_suite_test.go => command-suite_test.go} | 0 src/app/command/magick-cmd_test.go | 4 ++-- src/app/command/root-cmd_test.go | 2 ++ src/app/command/shrink-cmd.go | 22 +++++++++---------- src/app/command/shrink-cmd_test.go | 2 ++ ...ing_suite_test.go => filing-suite_test.go} | 0 src/app/proxy/filing/path-finder_test.go | 3 +++ src/app/proxy/pixa-legacy_test.go | 3 +++ ...roxy_suite_test.go => proxy-suite_test.go} | 0 src/internal/helpers/test-utils.go | 15 ++++++------- src/locale/messages-command-errors.go | 14 ++++++------ src/locale/messages-errors.go | 8 +++---- 17 files changed, 69 insertions(+), 52 deletions(-) rename src/app/command/{command_suite_test.go => command-suite_test.go} (100%) rename src/app/proxy/filing/{filing_suite_test.go => filing-suite_test.go} (100%) rename src/app/proxy/{proxy_suite_test.go => proxy-suite_test.go} (100%) diff --git a/go.mod b/go.mod index 3da20fc..7ca4c16 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/snivilised/pixa -go 1.22 +go 1.23.0 require ( github.com/charmbracelet/bubbletea v1.1.1 @@ -11,6 +11,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/samber/lo v1.47.0 github.com/snivilised/extendio v0.7.0 + github.com/snivilised/li18ngo v0.1.4 github.com/snivilised/lorax v0.5.2 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.18.2 diff --git a/go.sum b/go.sum index e108701..c685d22 100644 --- a/go.sum +++ b/go.sum @@ -125,6 +125,8 @@ github.com/snivilised/cobrass v0.4.5 h1:NeU/NwuOuJzotqa4JwnqGqbV1fs1SjB6GF53sXFO github.com/snivilised/cobrass v0.4.5/go.mod h1:hGVu/zjWVG3tRKo3P0tjelm5S44vMTa/w29ygnvi+lY= github.com/snivilised/extendio v0.7.0 h1:MY6w9qCK5wVEvP2WpMT5ywJwpDJe97WHDGuwrsTLpek= github.com/snivilised/extendio v0.7.0/go.mod h1:l8MwJOy9ojMQYJrSKRbQS3WfDylevnRtBp/zwAmFEKc= +github.com/snivilised/li18ngo v0.1.4 h1:y6EECoVFpmkud2yDEeBnMnebPmSvdrEZ/LAq1PoPctE= +github.com/snivilised/li18ngo v0.1.4/go.mod h1:Or3qUhpR6AM1X51i82RtyCvORWy2/hrxY9lg1i1gFTE= github.com/snivilised/lorax v0.5.2 h1:iReIJl63tydiPSSD0YzsNQFX1CctmvMkYx0aSxoZJKo= github.com/snivilised/lorax v0.5.2/go.mod h1:7H1JPgSn4h4p8NSqfl64raacYefdm/FiFkfcZ51PVHY= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= diff --git a/src/app/cfg/config-runner.go b/src/app/cfg/config-runner.go index e91e5b5..702e4df 100644 --- a/src/app/cfg/config-runner.go +++ b/src/app/cfg/config-runner.go @@ -11,8 +11,8 @@ import ( "github.com/snivilised/cobrass/src/assistant/configuration" ci18n "github.com/snivilised/cobrass/src/assistant/i18n" "github.com/snivilised/extendio/collections" - xi18n "github.com/snivilised/extendio/i18n" "github.com/snivilised/extendio/xfs/storage" + "github.com/snivilised/li18ngo" "github.com/snivilised/pixa/src/app/proxy/common" "github.com/spf13/viper" "golang.org/x/text/language" @@ -216,18 +216,18 @@ func (c *configRunner) handleLangSetting(config configuration.ViperConfig) { return parsedTag }, func() language.Tag { - return xi18n.DefaultLanguage.Get() + return li18ngo.DefaultLanguage }, ) - err := xi18n.Use(func(uo *xi18n.UseOptions) { + err := li18ngo.Use(func(uo *li18ngo.UseOptions) { uo.Tag = tag - uo.From = xi18n.LoadFrom{ - Sources: xi18n.TranslationFiles{ - c.sourceID: xi18n.TranslationSource{ + uo.From = li18ngo.LoadFrom{ + Sources: li18ngo.TranslationFiles{ + c.sourceID: li18ngo.TranslationSource{ Name: c.applicationName, }, - ci18n.CobrassSourceID: xi18n.TranslationSource{ + ci18n.CobrassSourceID: li18ngo.TranslationSource{ Name: "cobrass", }, }, diff --git a/src/app/cfg/config-runner_test.go b/src/app/cfg/config-runner_test.go index 782a71f..26d039e 100644 --- a/src/app/cfg/config-runner_test.go +++ b/src/app/cfg/config-runner_test.go @@ -12,6 +12,7 @@ import ( "github.com/snivilised/cobrass/src/assistant/mocks" "github.com/snivilised/extendio/xfs/storage" + "github.com/snivilised/li18ngo" "github.com/snivilised/pixa/src/app/cfg" "github.com/snivilised/pixa/src/app/proxy/common" "github.com/snivilised/pixa/src/internal/helpers" @@ -58,7 +59,7 @@ type runnerTE struct { assert func(entry *runnerTE, runner common.ConfigRunner, err error) } -var _ = Describe("ConfigRunner", func() { +var _ = Describe("ConfigRunner", Ordered, func() { var ( repo string configPath string @@ -67,6 +68,10 @@ var _ = Describe("ConfigRunner", func() { mock *mocks.MockViperConfig ) + BeforeAll(func() { + li18ngo.Use() + }) + BeforeEach(func() { viper.Reset() vfs = storage.UseMemFS() diff --git a/src/app/command/bootstrap.go b/src/app/command/bootstrap.go index aee2ffb..c8bb099 100644 --- a/src/app/command/bootstrap.go +++ b/src/app/command/bootstrap.go @@ -16,9 +16,9 @@ import ( "github.com/snivilised/cobrass/src/assistant" "github.com/snivilised/cobrass/src/assistant/configuration" ci18n "github.com/snivilised/cobrass/src/assistant/i18n" - xi18n "github.com/snivilised/extendio/i18n" "github.com/snivilised/extendio/xfs/storage" "github.com/snivilised/extendio/xfs/utils" + "github.com/snivilised/li18ngo" "github.com/snivilised/pixa/src/app/cfg" "github.com/snivilised/pixa/src/app/plog" "github.com/snivilised/pixa/src/app/proxy" @@ -51,7 +51,7 @@ func validatePositionalArgs(cmd *cobra.Command, args []string) error { directory := utils.ResolvePath(args[0]) if !utils.Exists(directory) { - return xi18n.NewPathNotFoundError("shrink directory", directory) + return li18ngo.NewPathNotFoundError("shrink directory", directory) } return nil @@ -125,8 +125,8 @@ func (b *Bootstrap) Root(options ...ConfigureOptionFn) *cobra.Command { b.Container = assistant.NewCobraContainer( &cobra.Command{ Use: "main", - Short: xi18n.Text(locale.RootCmdShortDescTemplData{}), - Long: xi18n.Text(locale.RootCmdLongDescTemplData{}), + Short: li18ngo.Text(locale.RootCmdShortDescTemplData{}), + Long: li18ngo.Text(locale.RootCmdLongDescTemplData{}), Version: fmt.Sprintf("'%v'", Version), RunE: func(_ *cobra.Command, args []string) error { inputs := b.getRootInputs() @@ -178,7 +178,7 @@ func (b *Bootstrap) Root(options ...ConfigureOptionFn) *cobra.Command { func (b *Bootstrap) configure() { if err := b.OptionsInfo.Runner.Run(); err != nil { - msg := xi18n.Text(locale.UsingConfigFileTemplData{ + msg := li18ngo.Text(locale.UsingConfigFileTemplData{ ConfigFileName: b.OptionsInfo.Config.Viper.ConfigFileUsed(), }) @@ -202,18 +202,18 @@ func handleLangSetting(config configuration.ViperConfig) { return parsedTag }, func() language.Tag { - return xi18n.DefaultLanguage.Get() + return li18ngo.DefaultLanguage }, ) - err := xi18n.Use(func(uo *xi18n.UseOptions) { + err := li18ngo.Use(func(uo *li18ngo.UseOptions) { uo.Tag = tag - uo.From = xi18n.LoadFrom{ - Sources: xi18n.TranslationFiles{ - common.Definitions.Pixa.SourceID: xi18n.TranslationSource{ + uo.From = li18ngo.LoadFrom{ + Sources: li18ngo.TranslationFiles{ + common.Definitions.Pixa.SourceID: li18ngo.TranslationSource{ Name: common.Definitions.Pixa.AppName, }, - ci18n.CobrassSourceID: xi18n.TranslationSource{ + ci18n.CobrassSourceID: li18ngo.TranslationSource{ Name: "cobrass", }, }, diff --git a/src/app/command/command_suite_test.go b/src/app/command/command-suite_test.go similarity index 100% rename from src/app/command/command_suite_test.go rename to src/app/command/command-suite_test.go diff --git a/src/app/command/magick-cmd_test.go b/src/app/command/magick-cmd_test.go index cef2a7b..2421d69 100644 --- a/src/app/command/magick-cmd_test.go +++ b/src/app/command/magick-cmd_test.go @@ -5,8 +5,8 @@ import ( . "github.com/onsi/gomega" //nolint:revive // foo "github.com/snivilised/cobrass/src/assistant/configuration" - xi18n "github.com/snivilised/extendio/i18n" "github.com/snivilised/extendio/xfs/storage" + "github.com/snivilised/li18ngo" "github.com/snivilised/pixa/src/app/command" "github.com/snivilised/pixa/src/app/proxy/common" "github.com/snivilised/pixa/src/internal/helpers" @@ -28,7 +28,7 @@ var _ = Describe("MagickCmd", Ordered, func() { }) BeforeEach(func() { - xi18n.ResetTx() + Expect(li18ngo.Use()).To(Succeed()) vfs, _ = helpers.SetupTest( "nasa-scientist-index.xml", configPath, l10nPath, helpers.Silent, ) diff --git a/src/app/command/root-cmd_test.go b/src/app/command/root-cmd_test.go index 9cedfbc..f45a7ce 100644 --- a/src/app/command/root-cmd_test.go +++ b/src/app/command/root-cmd_test.go @@ -7,6 +7,7 @@ import ( . "github.com/onsi/gomega" //nolint:revive // foo "github.com/snivilised/extendio/xfs/storage" + "github.com/snivilised/li18ngo" "github.com/snivilised/pixa/src/app/command" "github.com/snivilised/pixa/src/app/proxy/common" "github.com/snivilised/pixa/src/internal/helpers" @@ -28,6 +29,7 @@ var _ = Describe("RootCmd", Ordered, func() { ) BeforeAll(func() { + Expect(li18ngo.Use()).To(Succeed()) repo = helpers.Repo("") l10nPath = helpers.Path(repo, "test/data/l10n") configPath = helpers.Path(repo, "test/data/configuration") diff --git a/src/app/command/shrink-cmd.go b/src/app/command/shrink-cmd.go index 57af1ff..f3076d8 100644 --- a/src/app/command/shrink-cmd.go +++ b/src/app/command/shrink-cmd.go @@ -9,8 +9,8 @@ import ( "github.com/snivilised/cobrass" "github.com/snivilised/cobrass/src/assistant" "github.com/snivilised/cobrass/src/store" - xi18n "github.com/snivilised/extendio/i18n" "github.com/snivilised/extendio/xfs/utils" + "github.com/snivilised/li18ngo" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -85,9 +85,9 @@ func (b *Bootstrap) buildShrinkCommand(container *assistant.CobraContainer) *cob Use: "shrink", Short: locale.LeadsWith( "shrink", - xi18n.Text(locale.ShrinkCmdShortDefinitionTemplData{}), + li18ngo.Text(locale.ShrinkCmdShortDefinitionTemplData{}), ), - Long: xi18n.Text(locale.ShrinkLongDefinitionTemplData{}), + Long: li18ngo.Text(locale.ShrinkLongDefinitionTemplData{}), RunE: func(cmd *cobra.Command, args []string) error { var appErr error @@ -168,7 +168,7 @@ func (b *Bootstrap) buildShrinkCommand(container *assistant.CobraContainer) *cob paramSet.BindValidatedString( newShrinkFlagInfoWithShort( - xi18n.Text(locale.ShrinkCmdOutputPathParamUsageTemplData{}), + li18ngo.Text(locale.ShrinkCmdOutputPathParamUsageTemplData{}), defaultOutputPath, ), ¶mSet.Native.OutputPath, func(_ string, _ *pflag.Flag) error { @@ -190,7 +190,7 @@ func (b *Bootstrap) buildShrinkCommand(container *assistant.CobraContainer) *cob paramSet.BindValidatedString( newShrinkFlagInfoWithShort( - xi18n.Text(locale.ShrinkCmdTrashPathParamUsageTemplData{}), + li18ngo.Text(locale.ShrinkCmdTrashPathParamUsageTemplData{}), defaultTrashPath, ), ¶mSet.Native.TrashPath, func(_ string, _ *pflag.Flag) error { @@ -212,7 +212,7 @@ func (b *Bootstrap) buildShrinkCommand(container *assistant.CobraContainer) *cob paramSet.BindBool( newShrinkFlagInfoWithShort( - xi18n.Text(locale.ShrinkCmdCuddleParamUsageTemplData{}), + li18ngo.Text(locale.ShrinkCmdCuddleParamUsageTemplData{}), defaultCuddle, ), ¶mSet.Native.Cuddle, @@ -228,7 +228,7 @@ func (b *Bootstrap) buildShrinkCommand(container *assistant.CobraContainer) *cob paramSet.BindValidatedFloat32Within( newShrinkFlagInfoWithShort( - xi18n.Text(locale.ShrinkCmdGaussianBlurParamUsageTemplData{}), + li18ngo.Text(locale.ShrinkCmdGaussianBlurParamUsageTemplData{}), defaultBlur, ), ¶mSet.Native.ThirdPartySet.GaussianBlur, @@ -246,7 +246,7 @@ func (b *Bootstrap) buildShrinkCommand(container *assistant.CobraContainer) *cob paramSet.BindValidatedEnum( newShrinkFlagInfoWithShort( - xi18n.Text(locale.ShrinkCmdSamplingFactorParamUsageTemplData{}), + li18ngo.Text(locale.ShrinkCmdSamplingFactorParamUsageTemplData{}), defaultSamplingFactor, ), ¶mSet.Native.ThirdPartySet.SamplingFactorEn.Source, @@ -271,7 +271,7 @@ func (b *Bootstrap) buildShrinkCommand(container *assistant.CobraContainer) *cob paramSet.BindValidatedEnum( newShrinkFlagInfoWithShort( - xi18n.Text(locale.ShrinkCmdInterlaceParamUsageTemplData{}), + li18ngo.Text(locale.ShrinkCmdInterlaceParamUsageTemplData{}), defaultInterlace, ), ¶mSet.Native.ThirdPartySet.InterlaceEn.Source, @@ -294,7 +294,7 @@ func (b *Bootstrap) buildShrinkCommand(container *assistant.CobraContainer) *cob paramSet.BindBool( newShrinkFlagInfoWithShort( - xi18n.Text(locale.ShrinkCmdStripParamUsageTemplData{}), + li18ngo.Text(locale.ShrinkCmdStripParamUsageTemplData{}), defaultStrip, ), ¶mSet.Native.ThirdPartySet.Strip, @@ -310,7 +310,7 @@ func (b *Bootstrap) buildShrinkCommand(container *assistant.CobraContainer) *cob paramSet.BindValidatedIntWithin( newShrinkFlagInfoWithShort( - xi18n.Text(locale.ShrinkCmdQualityParamUsageTemplData{}), + li18ngo.Text(locale.ShrinkCmdQualityParamUsageTemplData{}), defaultQuality, ), ¶mSet.Native.ThirdPartySet.Quality, diff --git a/src/app/command/shrink-cmd_test.go b/src/app/command/shrink-cmd_test.go index 24a8541..97f630d 100644 --- a/src/app/command/shrink-cmd_test.go +++ b/src/app/command/shrink-cmd_test.go @@ -6,6 +6,7 @@ import ( . "github.com/onsi/ginkgo/v2" //nolint:revive // foo . "github.com/onsi/gomega" //nolint:revive // foo "github.com/snivilised/cobrass/src/assistant/configuration" + "github.com/snivilised/li18ngo" "github.com/snivilised/pixa/src/app/cfg" "github.com/snivilised/pixa/src/app/command" "github.com/snivilised/pixa/src/app/proxy/common" @@ -92,6 +93,7 @@ var _ = Describe("ShrinkCmd", Ordered, func() { ) BeforeAll(func() { + Expect(li18ngo.Use()).To(Succeed()) repo = helpers.Repo("") l10nPath = helpers.Path(repo, "test/data/l10n") configPath = helpers.Path(repo, "test/data/configuration") diff --git a/src/app/proxy/filing/filing_suite_test.go b/src/app/proxy/filing/filing-suite_test.go similarity index 100% rename from src/app/proxy/filing/filing_suite_test.go rename to src/app/proxy/filing/filing-suite_test.go diff --git a/src/app/proxy/filing/path-finder_test.go b/src/app/proxy/filing/path-finder_test.go index dbf2e5b..ff3e45e 100644 --- a/src/app/proxy/filing/path-finder_test.go +++ b/src/app/proxy/filing/path-finder_test.go @@ -10,6 +10,7 @@ import ( "github.com/samber/lo" "github.com/snivilised/extendio/xfs/nav" + "github.com/snivilised/li18ngo" "github.com/snivilised/pixa/src/app/cfg" "github.com/snivilised/pixa/src/app/proxy/common" "github.com/snivilised/pixa/src/app/proxy/filing" @@ -52,6 +53,8 @@ var _ = Describe("PathFinder", Ordered, func() { ) BeforeAll(func() { + Expect(li18ngo.Use()).To(Succeed()) + schemes = &cfg.MsSchemesConfig{ "blur-sf": &cfg.MsSchemeConfig{ ProfilesData: []string{"blur", "sf"}, diff --git a/src/app/proxy/pixa-legacy_test.go b/src/app/proxy/pixa-legacy_test.go index 27bbaa1..1538933 100644 --- a/src/app/proxy/pixa-legacy_test.go +++ b/src/app/proxy/pixa-legacy_test.go @@ -11,6 +11,7 @@ import ( "github.com/snivilised/cobrass/src/assistant/configuration" "github.com/snivilised/extendio/xfs/storage" "github.com/snivilised/extendio/xfs/utils" + "github.com/snivilised/li18ngo" "github.com/snivilised/pixa/src/app/command" "github.com/snivilised/pixa/src/app/proxy/common" @@ -108,6 +109,8 @@ var _ = Describe("pixa-legacy", Ordered, func() { ) BeforeAll(func() { + Expect(li18ngo.Use()).To(Succeed()) + repo = helpers.Repo("") l10nPath = helpers.Path(repo, "test/data/l10n") configPath = helpers.Path(repo, "test/data/configuration") diff --git a/src/app/proxy/proxy_suite_test.go b/src/app/proxy/proxy-suite_test.go similarity index 100% rename from src/app/proxy/proxy_suite_test.go rename to src/app/proxy/proxy-suite_test.go diff --git a/src/internal/helpers/test-utils.go b/src/internal/helpers/test-utils.go index e2ecc30..9816ec6 100644 --- a/src/internal/helpers/test-utils.go +++ b/src/internal/helpers/test-utils.go @@ -14,12 +14,11 @@ import ( "github.com/pkg/errors" "github.com/snivilised/cobrass/src/assistant/configuration" ci18n "github.com/snivilised/cobrass/src/assistant/i18n" + "github.com/snivilised/extendio/xfs/storage" + "github.com/snivilised/li18ngo" "github.com/snivilised/pixa/src/app/proxy/common" "github.com/snivilised/pixa/src/internal/matchers" "github.com/snivilised/pixa/src/locale" - - xi18n "github.com/snivilised/extendio/i18n" - "github.com/snivilised/extendio/xfs/storage" "golang.org/x/text/language" ) @@ -118,15 +117,15 @@ func SetupTest( } func UseI18n(l10nPath string) error { - return xi18n.Use(func(uo *xi18n.UseOptions) { - uo.From = xi18n.LoadFrom{ + return li18ngo.Use(func(uo *li18ngo.UseOptions) { + uo.From = li18ngo.LoadFrom{ Path: l10nPath, - Sources: xi18n.TranslationFiles{ - locale.PixaSourceID: xi18n.TranslationSource{ + Sources: li18ngo.TranslationFiles{ + locale.PixaSourceID: li18ngo.TranslationSource{ Name: "dummy-cobrass", }, - ci18n.CobrassSourceID: xi18n.TranslationSource{ + ci18n.CobrassSourceID: li18ngo.TranslationSource{ Name: "dummy-cobrass", }, }, diff --git a/src/locale/messages-command-errors.go b/src/locale/messages-command-errors.go index 15bc8c9..5be0338 100644 --- a/src/locale/messages-command-errors.go +++ b/src/locale/messages-command-errors.go @@ -2,7 +2,7 @@ package locale import ( "github.com/nicksnyder/go-i18n/v2/i18n" - xi18n "github.com/snivilised/extendio/i18n" + "github.com/snivilised/li18ngo" ) // ShrinkCmdSamplingFactorInvalidTemplData @@ -28,12 +28,12 @@ type InvalidSamplingFactorErrorBehaviourQuery interface { } type InvalidSamplingFactorError struct { - xi18n.LocalisableError + li18ngo.LocalisableError } func NewInvalidSamplingFactorError(value, acceptable string) InvalidSamplingFactorError { return InvalidSamplingFactorError{ - LocalisableError: xi18n.LocalisableError{ + LocalisableError: li18ngo.LocalisableError{ Data: ShrinkCmdSamplingFactorInvalidTemplData{ Value: value, Acceptable: acceptable, @@ -65,12 +65,12 @@ type InvalidInterlaceErrorBehaviourQuery interface { } type InvalidInterlaceError struct { - xi18n.LocalisableError + li18ngo.LocalisableError } func NewInterlaceError(value, acceptable string) InvalidInterlaceError { return InvalidInterlaceError{ - LocalisableError: xi18n.LocalisableError{ + LocalisableError: li18ngo.LocalisableError{ Data: ShrinkCmdInterlaceInvalidTemplData{ Value: value, Acceptable: acceptable, @@ -101,12 +101,12 @@ type OutputPathDoesNotExistBehaviourQuery interface { } type OutputPathDoesNotExistError struct { - xi18n.LocalisableError + li18ngo.LocalisableError } func NewOutputPathDoesNotExistError(path string) OutputPathDoesNotExistError { return OutputPathDoesNotExistError{ - LocalisableError: xi18n.LocalisableError{ + LocalisableError: li18ngo.LocalisableError{ Data: ShrinkCmdOutputPathDoesNotExistTemplData{ Path: path, }, diff --git a/src/locale/messages-errors.go b/src/locale/messages-errors.go index 067c579..8347cb1 100644 --- a/src/locale/messages-errors.go +++ b/src/locale/messages-errors.go @@ -1,8 +1,8 @@ package locale import ( - i18n "github.com/nicksnyder/go-i18n/v2/i18n" - xi18n "github.com/snivilised/extendio/i18n" + "github.com/nicksnyder/go-i18n/v2/i18n" + "github.com/snivilised/li18ngo" ) // ❌ FooBar @@ -35,7 +35,7 @@ type FooBarErrorBehaviourQuery interface { } type FooBarError struct { - xi18n.LocalisableError + li18ngo.LocalisableError } // FooBar enables the client to check if error is FooBarError @@ -47,7 +47,7 @@ func (e FooBarError) FooBar() bool { // NewFooBarError creates a FooBarError func NewFooBarError(path string, reason error) FooBarError { return FooBarError{ - LocalisableError: xi18n.LocalisableError{ + LocalisableError: li18ngo.LocalisableError{ Data: FooBarTemplData{ Path: path, Reason: reason,