"Fossies" - the Fresh Open Source Software Archive

Member "hevea-2.35/babel.hva" (16 Jan 2021, 8460 Bytes) of package /linux/www/hevea-2.35.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 \ProvidesPackage{babel}
    2 \RequirePackage{keyval}
    3 %%%%
    4 %%%% A simple command that takes language (say l) and 
    5 %%%%    a) checks for existence and includes l.hva 
    6 %%%%    b) calls the command \l@babel (in l.hva)
    7 %%%%    c) sets current language to l
    8 %
    9 \newcommand{\InitiateOption}[1]{%
   10 \@ifundefined{bbl@#1@loaded}
   11 {\let\csname bbl@#1@loaded\endcsname\relax%
   12 \newenvironment{#1}{\begin{foreign@language@block}{#1}}{\end{foreign@language@block}}%
   13 \newenvironment{#1*}{\begin{foreign@language@block}{#1}}{\end{foreign@language@block}}%
   14 \@iffileexists{#1.hva}
   15   {\input{#1.hva}\def\bbl@main@language{#1}}
   16   {\hva@warn{Hevea babel '#1' not found, loading 'english' instead}%
   17    \input{english.hva}\def\bbl@main@language{english}}}
   18 {}}
   19 %%%Default option (parses main=<lang>)
   20 \define@key{babel}{main}{\def\bbl@realmain@language{#1}\InitiateOption{#1}}
   21 \newcommand{\DefaultOption}[1]{\@setkeys{babel}{#1}}
   22 \DeclareOption{@defopt}{\DefaultOption}%
   23 %
   24 %%%% Processing information for each optional argument
   25 %
   26 \DeclareOption{english}{\InitiateOption{english}}%
   27 \DeclareOption{USenglish}{\InitiateOption{english}}%
   28 \DeclareOption{french}{\InitiateOption{french}}%
   29 \DeclareOption{frenchb}{\InitiateOption{french}}%
   30 \DeclareOption{francais}{\InitiateOption{french}}%
   31 \DeclareOption{german}{\InitiateOption{german}}%
   32 \DeclareOption{greek}{\InitiateOption{greek}}%
   33 \DeclareOption{ngerman}{\InitiateOption{german}}%
   34 \DeclareOption{austrian}{\InitiateOption{austrian}}% 
   35 \DeclareOption{czech}{\InitiateOption{czech}}%
   36 \DeclareOption{american}{\InitiateOption{english}}
   37 \DeclareOption{croatian}{\InitiateOption{croatian}}%
   38 \DeclareOption{catalan}{\InitiateOption{catalan}}%
   39 \DeclareOption{brazil}{\InitiateOption{brazil}}%
   40 \DeclareOption{danish}{\InitiateOption{danish}}%
   41 \DeclareOption{dutch}{\InitiateOption{dutch}}%
   42 \DeclareOption{esperanto}{\InitiateOption{esperanto}}%
   43 \DeclareOption{finnish}{\InitiateOption{finnish}}%
   44 \DeclareOption{galician}{\InitiateOption{galician}}%
   45 \DeclareOption{italian}{\InitiateOption{italian}}%
   46 \DeclareOption{magyar}{\InitiateOption{magyar}}%
   47 \DeclareOption{norsk}{\InitiateOption{norsk}}%
   48 \DeclareOption{nynorsk}{\InitiateOption{nynorsk}}%
   49 \DeclareOption{polish}{\InitiateOption{polish}}%
   50 \DeclareOption{portuguese}{\InitiateOption{portuguese}}%
   51 \DeclareOption{romanian}{\InitiateOption{romanian}}%
   52 \DeclareOption{russian}{\InitiateOption{russian}}%
   53 \DeclareOption{slovak}{\InitiateOption{slovak}}%
   54 \DeclareOption{slovene}{\InitiateOption{slovene}}%
   55 \DeclareOption{spanish}{\InitiateOption{spanish}}%
   56 \DeclareOption{swedish}{\InitiateOption{swedish}}%
   57 \DeclareOption{turkish}{\InitiateOption{turkish}}%
   58 %
   59 %%%% Processing babel options postponed for later
   60 %
   61 %\ProcessOptions*
   62 %
   63 %%%% One variable for each supported language, to keep track of and to 
   64 %%%% change the current language. Might as well have used english itself 
   65 %%%% instead of \english@language!!! 
   66 %
   67 \newcommand\english@language{english}%
   68 \newcommand\french@language{french}%
   69 \newcommand\german@language{german}%
   70 \newcommand\ngerman@language{ngerman}%
   71 \newcommand\greek@language{greek}%
   72 \newcommand\american@language{american}%
   73 \newcommand\austrian@language{austrian}%
   74 \newcommand\brazil@language{brazil}%
   75 \newcommand\catalan@language{catalan}%
   76 \newcommand\croatian@language{croatian}%
   77 \newcommand\czech@language{czech}%
   78 \newcommand\danish@language{danish}%
   79 \newcommand\dutch@language{dutch}%
   80 \newcommand\esperanto@language{esperanto}%
   81 \newcommand\finnish@language{finnish}%
   82 \newcommand\galician@language{galician}%
   83 \newcommand\italian@language{italian}%
   84 \newcommand\magyar@language{magyar}%
   85 \newcommand\norsk@language{norsk}%
   86 \newcommand\nynorsk@language{nynorsk}%
   87 \newcommand\polish@language{polish}%
   88 \newcommand\portuguese@language{portuguese}%
   89 \newcommand\romanian@language{romanian}%
   90 \newcommand\russian@language{russian}%
   91 \newcommand\slovak@language{slovak}%
   92 \newcommand\slovene@language{slovene}%
   93 \newcommand\spanish@language{spanish}%
   94 \newcommand\swedish@language{swedish}%
   95 \newcommand\turkish@language{turkish}%
   96 %
   97 %%%% Initializing \current@language before loading babel language packages.
   98 %
   99 \let\current@language\english@language
  100 %
  101 %%%% Support for the 'babel' command to select languages.
  102 %
  103 %Save definition of double quote (altered by german)
  104 \let\@hevea@saved@dquote\@hevea@dquote
  105 \newcommand{\selectlanguage}[1]{%
  106 \def\language@packages{#1}%
  107 \let\@hevea@dquote\@hevea@saved@dquote%Restore inocuous definition
  108   \ifthenelse{\equal{#1}{german}} {%
  109 	\let\current@language\german@language    \german@babel    } {%
  110   \ifthenelse{\equal{#1}{greek}} {%
  111 	\let\current@language\greek@language    \greek@babel    } {%
  112   \ifthenelse{\equal{#1}{ngerman}} {%
  113 	\let\current@language\ngerman@language   \german@babel    } {%
  114   \ifthenelse{\equal{#1}{english}} {%
  115  	\let\current@language\english@language   \english@babel   } {%
  116   \ifthenelse{\equal{#1}{french}} {%
  117 	\let\current@language\french@language    \french@babel    } {%
  118   \ifthenelse{\equal{#1}{american}} {%
  119 	\let\current@language\american@language  \american@babel  } {%
  120   \ifthenelse{\equal{#1}{austrian}} {%
  121 	\let\current@language\austrian@language  \austrian@babel  } {%
  122   \ifthenelse{\equal{#1}{brazil}} {%
  123 	\let\current@language\brazil@language    \brazil@babel    } {%
  124   \ifthenelse{\equal{#1}{catalan}} {%
  125 	\let\current@language\catalan@language   \catalan@babel   } {%
  126   \ifthenelse{\equal{#1}{croatian}} {%
  127 	\let\current@language\croatian@language  \croatian@babel  } {%
  128   \ifthenelse{\equal{#1}{czech}} {%
  129 	\let\current@language\czech@language     \czech@babel     } {%
  130   \ifthenelse{\equal{#1}{danish}} {%
  131 	\let\current@language\danish@language    \danish@babel    } {%
  132   \ifthenelse{\equal{#1}{dutch}} {%
  133 	\let\current@language\dutch@language     \dutch@babel     } {%
  134   \ifthenelse{\equal{#1}{esperanto}} {%
  135 	\let\current@language\esperanto@language \esperanto@babel } {%
  136   \ifthenelse{\equal{#1}{finnish}} {%
  137 	\let\current@language\finnish@language   \finnish@babel   } {%
  138   \ifthenelse{\equal{#1}{galician}} {%
  139 	\let\current@language\galician@language  \galician@babel  } {%
  140   \ifthenelse{\equal{#1}{italian}} {%
  141 	\let\current@language\italian@language   \italian@babel   } {%
  142   \ifthenelse{\equal{#1}{magyar}} {%
  143 	\let\current@language\magyar@language    \magyar@babel    } {%
  144   \ifthenelse{\equal{#1}{norsk}} {%
  145 	\let\current@language\norsk@language     \norsk@babel     } {%
  146   \ifthenelse{\equal{#1}{nynorsk}} {%
  147 	\let\current@language\nynorsk@language   \nynorsk@babel   } {%
  148   \ifthenelse{\equal{#1}{polish}} {%
  149 	\let\current@languagepolish\@language    \polish@babel    } {%
  150   \ifthenelse{\equal{#1}{portuguese}} {%
  151 	\let\current@language\portuguese@language  \portuguese@babel  } {%
  152   \ifthenelse{\equal{#1}{romanian}} {%
  153 	\let\current@language\romanian@language  \romanian@babel  } {%
  154   \ifthenelse{\equal{#1}{russian}} {%
  155 	\let\current@language\russian@language   \russian@babel   } {%
  156   \ifthenelse{\equal{#1}{slovak}} {%
  157 	\let\current@language\slovak@language    \slovak@babel    } {%
  158   \ifthenelse{\equal{#1}{slovene}} {%
  159 	\let\current@language\slovene@language   \slovene@babel   } {%
  160   \ifthenelse{\equal{#1}{spanish}} {%
  161 	\let\current@language\spanish@language   \spanish@babel   } {%
  162   \ifthenelse{\equal{#1}{swedish}} {%
  163 	\let\current@language\swedish@language   \swedish@babel   } {%
  164   \ifthenelse{\equal{#1}{turkish}} {%
  165 	\let\current@language\turkish@language   \turkish@babel   } {%
  166   }}}}}}}}}}}}}}}}}}}}}}}}}}}}}%
  167 }%
  168 %
  169 \newenvironment{foreign@language@block}[1]%
  170 {\let\outer@language=\current@language%
  171   \@open{div}{class="foreignlanguage" lang="\map@lang@code{#1}"}%
  172   \selectlanguage{#1}}%
  173 {\@close{div}\selectlanguage{\outer@language}}
  174 \newenvironment{foreign@language@inline}[1]%
  175 {\let\outer@language=\current@language%
  176   \@open{span}{class="foreignlanguage" lang="\map@lang@code{#1}"}%
  177   \selectlanguage{#1}}%
  178 {\@close{span}\selectlanguage{\outer@language}}
  179 \newcommand{\foreignlanguage}[2]{%
  180   \begin{foreign@language@inline}{#1}#2\end{foreign@language@inline}
  181 }
  182 \newenvironment{hyphenrules}[1]{\@span{lang="\map@lang@code{#1}"}}{}
  183 %
  184 %%%% Support for the 'babel' command for querying the current language.
  185 %
  186 \newcommand{\iflanguage}[3]{%
  187   \ifthenelse{\equal{#1}{\current@language}}{#2}{#3}%
  188 }%
  189 %
  190 %%%% Processing the optional arguments of the '\usepackage{babel}' command
  191 %%%% For each option (language l), checks for l.hva and 'includes' it.
  192 %
  193 \ProcessOptions*%
  194 \ifu\bbl@realmain@language\else\let\bbl@main@language\bbl@realmain@language\fi
  195 \selectlanguage{\bbl@main@language}