[LON-CAPA-cvs] cvs: loncom /html/adm/help/tex Authoring_Multilingual_Problems.tex

bisitz bisitz at source.lon-capa.org
Wed Apr 23 13:40:32 EDT 2014


bisitz		Wed Apr 23 17:40:32 2014 EDT

  Modified files:              
    /loncom/html/adm/help/tex	Authoring_Multilingual_Problems.tex 
  Log:
  - Improve order of paragraphs: Move language function explanation up, directly below translated tag explanation
  - Fix typo
  
  
  
Index: loncom/html/adm/help/tex/Authoring_Multilingual_Problems.tex
diff -u loncom/html/adm/help/tex/Authoring_Multilingual_Problems.tex:1.1 loncom/html/adm/help/tex/Authoring_Multilingual_Problems.tex:1.2
--- loncom/html/adm/help/tex/Authoring_Multilingual_Problems.tex:1.1	Wed Apr 23 17:24:28 2014
+++ loncom/html/adm/help/tex/Authoring_Multilingual_Problems.tex	Wed Apr 23 17:40:32 2014
@@ -58,6 +58,32 @@
 consistent language for all texts in the problem.
 
 
+\textbf{Different languages in options, variables, etc.}
+
+If you use a script block to create dynamic content and it contains text, the
+\textbf{\&languages()} function is used to offer these texts in different
+languages. This function can be called in different ways, see Script Functions
+\ref{Problem_LON-CAPA_Functions}.
+One way is to provide the language codes for the languages you like to support
+in an anonymous array to the function and get back the best fitting language of
+those. Use the returned language code to decide which text in which language
+should be used. 
+
+Example:
+\begin{verbatim}
+<script type="loncapa/perl">
+&bestlanguage = &languages(['en','de','fr']);
+if ($bestlanguage eq 'de') {
+   $optiontext = 'rot';
+} elsif ($bestlanguage eq 'fr') {
+   $optiontext = 'rouge';
+} else { # 'en' and default
+   $optiontext = 'red';
+}
+</script>
+\end{verbatim}
+
+
 \textbf{Interface language vs. problem language}
 
 LON-CAPA supports various languages for the web interface, e.g. for menu items
@@ -92,32 +118,6 @@
 You can use other languages in your problems.
 
 
-\textbf{Different languages in options, variables, etc.}
-
-If you use a script block to create dynamic content and it contains text, the
-\textbf{\&languages()} function is used to offer these texts in different
-languages. This function can be called in different ways, see Script Functions
-\ref{Problem_LON-CAPA_Functions}.
-One way is to provide the language codes for the languages you like to support
-in an anonymous array to the function and get back the best fitting language of
-those. Use the returned language code to decide which text in which language
-should be used. 
-
-Example:
-\begin{verbatim}
-<script type="loncapa/perl">
-&bestlanguage = &languages(['en','de','fr']);
-if ($bestlanguage eq 'de') {
-   $optiontext = 'rot';
-} elsif ($bestlanguage eq 'fr') {
-   $optiontext = 'rouge';
-} else { # 'en' and default
-   $optiontext = 'red';
-}
-</script>
-\end{verbatim}
-
-
 \textbf{Consistent language with <translated> and \&languages()}
 
 If you use both, <translated> and \&languages(), in your problem, always make
@@ -151,7 +151,7 @@
 Example 1:
 
 The server is set to French, the user's preference in LON-CAPA is set to
-prefer Spanish, the problem is programmed to offer Portuguese ans Spanish,
+prefer Spanish, the problem is programmed to offer Portuguese and Spanish,
 and the problem default language is German.
 LON-CAPA shows this problem in Spanish to the student.
 




More information about the LON-CAPA-cvs mailing list