Nick Snyder

Results 88 comments of Nick Snyder

I am not sure what you are trying to do here so I don't know how to help. To use go-i18n all you need to do is import the package...

What is your use case for this? Would it work to export the `getMessageTemplate` on the `Bundle` struct? https://github.com/nicksnyder/go-i18n/blob/57bd175f4eca85b370ebc664ec389a6c40d89d81/v2/i18n/bundle.go#L138-L144

There are two ways to solve your problem. First, you can set the `Funcs` field of `LocalizeConfig` so that go-i18n can execute the template correctly: https://github.com/nicksnyder/go-i18n/blob/main/v2/i18n/localizer.go#L70 Second, you probably don't...

go-i18n doesn’t have any special handling for this so you would just treat these as two separate messages with two separate message ids. ```go localizer.Localize(&i18n.LocalizeConfig{ DefaultMessage: &i18n.Message{ ID: "HelloFormal", Other:...

I wrote it this way intentionally, but I am open to feedback if this isn't intuitive. Right now go-i18n does its best to return a string, but if that string...

> What would need to happen to make a gettext unmarhaller that could seamlessly read in a Django-style collection of po/pm translations? I honestly don't know. There might be a...

The latest CLDR data ([v37](http://cldr.unicode.org/index/downloads)) does not include a plural rule for `oc`. Using `art-x-oc` should work. I verified [this test](https://sourcegraph.com/github.com/nicksnyder/go-i18n/-/blob/v2/i18n/bundle_test.go#L63-99) still passes if I substitute `art-x-oc` for `art-x-klingon`.

Currently for a locale to work with go-i18n, it must either: - Be supported by both https://pkg.go.dev/golang.org/x/text and have a plural rule defined in [CLDR](http://cldr.unicode.org/) OR - Be an artificial...

> `*.json` file only contain `json` formatted data This is already the case. Input files are parsed according to their suffix (e.g. files that have the `.json` extension are parsed...

> Why would you save json data in a file names .toml? You wouldn’t. The name of the output file is determined by the format used. If `-format toml` then...