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 at app.I18n.Reset(loader i18n.Loader, languages ...string) to change the locales parser
    • ๐Ÿ”ง The Configuration's TranslateFunctionContextKey was replaced by LocaleContextKey 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 by context.Tr as a shortcut for the new context.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 your go.mod file, e.g. replace github.com/flosch/pongo2-addons => github.com/iris-contrib/pongo2-addons v0.0.1.

    ๐Ÿ›  Fixes

    All known issues.

    1. #1395
    2. #1369
    3. #1399 with PR #1400
    4. #1401
    5. #1406
    6. neffos/#20
    7. pio/#5

    ๐Ÿ†• 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

    1. [_examples/i18n](_examples/i18n)
    2. [_examples/sitemap](_examples/sitemap)
    3. [_examples/desktop-app/blink](_examples/desktop-app/blink)
    4. [_examples/desktop-app/lorca](_examples/desktop-app/lorca)
    5. [_examples/desktop-app/webview](_examples/desktop-app/webview)