Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
The language redirect extension
Ruby
Branch: master

Merge pull request #2 from avonderluft/master

Radiant 1.x compatibility, et al.
latest commit dd8a5e84ca
@intinig authored
Failed to load latest commit information.
app/models accommodate deprecated method
lib fixed if_language and unless_language tags
spec Include any datasets from loaded extensions
.gitignore update gemspec; ignore gem
README.textile update README
Rakefile
VERSION Version bump to 1.0.1
language_redirect_extension.rb update extension meta
radiant-language_redirect-extension.gemspec update gemspec

README.textile

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

Something went wrong with that request. Please try again.