Iris v12.1.0 Release Notes
Release Date: 2019-12-13 // over 4 years ago-
๐ฅ Breaking Changes
Minor as many of you don't even use them but, indeed, they need to be covered here.
- ๐ Old i18n middleware(iris/middleware/i18n) was replaced by the [i18n](i18n) sub-package which lives as field at your application:
app.I18n.Load(globPathPattern string, languages ...string)
(see below) - ๐ Community-driven i18n middleware(iris-contrib/middleware/go-i18n) has a
NewLoader
function which returns a loader which can be passed atapp.I18n.Reset(loader i18n.Loader, languages ...string)
to change the locales parser - ๐ง The Configuration's
TranslateFunctionContextKey
was replaced byLocaleContextKey
which Context store's value (if i18n is used) returns the current Locale which contains the translate function, the language code, the language tag and the index position of it - The
context.Translate
method was replaced bycontext.Tr
as a shortcut for the newcontext.GetLocale().GetMessage(format, args...)
method and it matches the view's function{{tr format args}}
too - If you used Iris Django view engine with
import _ github.com/flosch/pongo2-addons
you must change the import path to_ github.com/iris-contrib/pongo2-addons
or add a go mod replace to yourgo.mod
file, e.g.replace github.com/flosch/pongo2-addons => github.com/iris-contrib/pongo2-addons v0.0.1
.
๐ Fixes
All known issues.
๐ New Features
Internationalization and localization
Support for i18n is now a builtin feature and is being respected across your entire application, per say sitemap and views.
Refer to the wiki section: https://github.com/kataras/iris/wiki/Sitemap for details.
Sitemaps
Iris generates and serves one or more sitemap.xml for your static routes.
Navigate through: https://github.com/kataras/iris/wiki/Sitemap for more.
๐ New Examples
- [_examples/i18n](_examples/i18n)
- [_examples/sitemap](_examples/sitemap)
- [_examples/desktop-app/blink](_examples/desktop-app/blink)
- [_examples/desktop-app/lorca](_examples/desktop-app/lorca)
- [_examples/desktop-app/webview](_examples/desktop-app/webview)
- ๐ Old i18n middleware(iris/middleware/i18n) was replaced by the [i18n](i18n) sub-package which lives as field at your application: