github aralroca/next-translate 0.11.0

4 years ago

This release have some new features, thanks to @justincy and @BjoernRave for these contributions!

🎉 New API things

Proposed by @justincy in #78 and by @BjoernRave in #43, and implemented by @aralroca .

  • Link -> Wrapper of next/link to navigate to any page with the current language. Read more about it here.
  • Router -> Wrapper of next/router with two extra methods pushI18n and replaceI18n to navigate to any page with the current language. Read more about it here.
  • clientSideLang -> Useful in some cases to get the current language outside the components. Caveats: don't use it in server-side. Read more about it here.

Improvement of redirectToDefaultLang config

Before was applied only in the i18nMiddleware, with a custom server, doing a 301 redirect from /some/route to /en/some/route (if en is de default language). However, thanks to @justincy contribution now this config also it applies in static mode, doing a redirect on the browser (Router.replace).

CHANGES

  • Support redirectToDefaultLang in static mode #79 #80 #82
  • Update yarn.lock for security reasons #85
  • Add Link, Router and clientSiteLang to API #84
  • Update docs in README.md #83

Don't miss a new next-translate release

NewReleases is sending notifications on new releases.