No commit activity in last 3 years
No release in over 3 years
Redirects to the appropriate language section based on the content encoding preferred by the Web browser.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.1.3
 Project Readme

Language Redirect

Redirects to the appropriate language section based on the content encoding preferred by the Web browser.

Version History

  • 2/2013 – Radiant 1.1.x compatible, fix deprecations, gemify
  • 5/2011 – Radiant 1.0 compatible
  • 4/2009 – Radiant 0.8 compatible
  • 2/2009 – Radiant 0.7 compatible
  • 1/2007 – Intital Import

Installation

  • add to your Gemfile: gem "radiant-language_redirect-extension"
  • run bundle

Usage

You can add a “config” part to the page which maps languages to URLs
in the following format:

  lang: url
  lang: url
  ...

Where “lang” refers to a language code and “url” refers to the URL
which should be redirected to based on the preferred content
encoding of the Web browser.

The following listing is a sample “config” page part:


en: /en/
ja: /ja/
: /en/

In this example, when the browser prefers English content it will be
redirected to the “/en/” URL. When it prefers Japanese content it will
be redirected to the “/ja/” URL. In the event that the browser prefers
something other than English or Japanese content, they will be
redirected to the “/en/” URL. This is what the "
" in the last entry
does. URLs can be either relative (without “http://hostname.tld”) or
absolute (with “http://hostname.tld”).

If no “config” part is specified the behavior will force the page to
redirect to the “/en/” folder.

Credits

Created by Giovanni Intini, maintained by contributors