Language selector - nschonni/wet-boew GitHub Wiki

français

This component provides ASP, Javascript, Perl, and PHP approaches for automatically linking to different language versions of the current page.

Table of Contents

Overview

Project lead: Jeff Gordon (@jeffdavidgordon)

Rationale

Benefits

  • Simplifies Web page maintenance by eliminating the need to hard code language links
  • Conforms to WCAG 2.0 AA

Recommended usage

  • Linking to different language versions of the current page

Implementation

  • Modify the language link so it targets the server-side script. The language selector scripts rely on the HTTP_REFERER value but you can append the current URL to the query string when calling the script to improve accuracy:
http://www.gc.ca/cgi-bin/lang?http://www.gc.ca/index-eng.htm
  • To enable secondary jQuery support, add class="wet-boew-langselect" to the language link.
<li id="gcwu-gcnb-lang"><a class="wet-boew-langselect" href="langselect/lang.php" lang="fr">Français</a></li>

Known Issues

  • Some browsers can be configured to block the HTTP_REFERER value
⚠️ **GitHub.com Fallback** ⚠️