forked from wet-boew/wet-boew
-
Notifications
You must be signed in to change notification settings - Fork 0
Language Selector
Jeff Gordon edited this page Jun 6, 2013
·
4 revisions
This component provides ASP, Javascript, Perl, and PHP approaches for automatically linking to different language versions of the current page.
Project lead: Jeff Gordon (@jeffdavidgordon)
- Simplifies Web page maintenance by eliminating the need to hard code language links
- Conforms to WCAG 2.0 AA
- Linking to different language versions of the current page
The language selector is available in both client side and server side implementations. The server side implementation is only required if you want the language selector functionality to work without the use of Javascript.
- 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>
- Modify the language link on your web page so that its URL points to the location of this project's server-side script (e.g. /demos/langselect/lang.php). 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
- See the WET-BOEW/WET-BOEW-SSI project where the language selector has been directly integrated into it.
- Some browsers can be configured to block the HTTP_REFERER value