-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Item12482: correct generation of lang and xml:lang attributes
git-svn-id: http://svn.foswiki.org/branches/Release01x01@16682 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
- Loading branch information
CrawfordCurrie
authored and
CrawfordCurrie
committed
May 1, 2013
1 parent
e48c85a
commit 379ab7a
Showing
4 changed files
with
26 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
%META:TOPICINFO{author="ProjectContributor" date="1284885934" format="1.1" version="1"}% | ||
%META:TOPICPARENT{name="Macros"}% | ||
#VarLANG | ||
---+++ LANG -- the =lang= attribute of generated HTML pages | ||
---+++ LANG -- the language specified by the server locale | ||
This macro is used to generate the =lang= (and =xml:lang=) attribute in generated HTML pages. If ={UseLocale}= is enabled, it is calculated from the [[%SCRIPTURLPATH{"configure"}%#Locale$Internationalisation][configure]] setting of ={Site}{Locale}=. Otherwise it defaults to =en= (English). | ||
* In templates the =lang= attribute is defined like this: | ||
<verbatim class="tml"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="%LANG%" lang="%LANG%"></verbatim> | ||
* The value is read from [[%SCRIPTURLPATH{"configure"}%#Locale$Internationalisation][configure]] setting ={Site}{Locale}= | ||
<verbatim><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="%LANG%" lang="%LANG%"></verbatim> | ||
* Do not confuse =LANG= with [[VarLANGUAGE][LANGUAGE]] | ||
* Syntax: =%<nop>LANG%= | ||
* Expands to: =%LANG%= | ||
<!--%JQREQUIRE{"chili"}%--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
%META:TOPICINFO{author="ProjectContributor" date="1231367690" format="1.1" version="1"}% | ||
%META:TOPICPARENT{name="Macros"}% | ||
#VarLANGUAGE | ||
---+++ LANGUAGE -- current user's language | ||
* Returns the language code for the language used as the current user. This is the language actually used by Foswiki (e.g. in user interface). | ||
* The language is detected from the user's browser, unless some site/web/user/session-defined setting overrides it: | ||
* If the =LANGUAGE= preference is set, it's used as user's language instead of any language detected from the browser. | ||
* Avoid defining =LANGUAGE= at a non per-user way, so each user can choose his/her preferred language. | ||
---+++ LANGUAGE -- language code for the current user | ||
* Returns the language code for the current user. This is the language used by Foswiki to generate the user interface. | ||
* The language is detected from the user's browser, unless some site/web/user/session-defined preference setting overrides it: | ||
* If a =LANGUAGE= preference is explicitly set, this will be used as the user language instead of any language detected from the browser. | ||
* %X% Avoid defining =LANGUAGE= in a non- per-user way, otherwise users will not be able to choose their preferred language. | ||
* Do not confuse =LANGUAGE= with [[VarLANG][LANG]] | ||
* Syntax: =%<nop>LANGUAGE%= | ||
* Expands to: %LANGUAGE% | ||
* Related: [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarLANGUAGES][LANGUAGES]] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters