You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Nick, Found out today my vendored version is not compatible with the new version. Specifically this function of mine does not work anymore because the locale package is gone.
My Call to AddTranslation:
i18n.AddTranslation(locale.MustNew(userLocale), tran)
What is the new mechanism for this. I spent a handful of minutes looking but found nothing obvious.
Thanks
// LoadJSON takes a json document of translations and manually
// loads them into the system
func LoadJSON(userLocale string, translationDocument string) error {
tracelog.Startedf("localize", "LoadJSON", "UserLocale[%s] Length[%d]", userLocale, len(translationDocument))
Sorry for the inconvenience of broken compatibility. I needed to modify some of the APIs to extend the flexibility of language parsing. language.Parse(userLocale) replaces locale.MustNew(userLocale).
The only difference is that it returns all languages that it can parse from the string. It is up to you to decide what to do if it finds 0 or more than 1 languages (probably an error case).
I will mark this as closed, but feel free to reopen if you have additional questions.
Hi Nick, Found out today my vendored version is not compatible with the new version. Specifically this function of mine does not work anymore because the locale package is gone.
My Call to AddTranslation:
i18n.AddTranslation(locale.MustNew(userLocale), tran)
What is the new mechanism for this. I spent a handful of minutes looking but found nothing obvious.
Thanks
// LoadJSON takes a json document of translations and manually
// loads them into the system
func LoadJSON(userLocale string, translationDocument string) error {
tracelog.Startedf("localize", "LoadJSON", "UserLocale[%s] Length[%d]", userLocale, len(translationDocument))
}
The text was updated successfully, but these errors were encountered: