Difference between revisions of "Languages"

From Wiki
Jump to navigation Jump to search
(Created page with "= Hints by Language = * general: Encodings and Regimes * Arabic and Hebrew * Chinese * Czech * Greek * Russian * Vietnamese")
 
 
(34 intermediate revisions by 4 users not shown)
Line 1: Line 1:
= Hints by Language =
+
= Two commands to set up the language aspects=
* general: [[Encodings and Regimes]]
+
Today, with the international use of the UTF-8 standard for input and output encoding, you only need two commands, with the '''[[#Language tags|language tag]]''' you want in brackets:
 +
; {{cmd|mainlanguage}}[tag]:
 +
:: to set the language of auto-generated language elements, like the title of the table of contents or the appendix,
 +
:: and to change the hyphenation rules, quotation marks, all that sort of thing, to that of a different language.
 +
; {{cmd|language}}[tag]:
 +
:: to change the hyphenation rules, quotation marks, all that sort of thing, to that of a different language. (The default language is English.)
 +
 
 +
{{cmd|mainlanguage}} includes all settings of {{cmd|language}}. {{cmd|language}} is only needed when you use more than 1 language in a document, otherwise {{cmd|mainlanguage}} is enough to change labels and hyphentation patterns.
 +
 
 +
As you can see in the following example {{cmd|mainlanguage}}  change the float label and the quotation marks but {{cmd|language}} changes only the quotation marks and uses the label of the main language.
 +
 
 +
<context source="yes">
 +
\startplacefigure[title=\quotation{English quotes}]
 +
\midaligned{\blackrule[width=6cm,height=1cm,color=red]}
 +
\stopplacefigure
 +
 
 +
\start \mainlanguage[nl]
 +
\startplacefigure[title=\quotation{Dutch quotes}]
 +
\midaligned{\blackrule[width=6cm,height=1cm,color=green]}
 +
\stopplacefigure
 +
\stop
 +
 
 +
\start \language[fr]
 +
\startplacefigure[title=\quotation{French quotes}]
 +
\midaligned{\blackrule[width=6cm,height=1cm,color=blue]}
 +
\stopplacefigure
 +
\stop
 +
</context>
 +
 
 +
 
 +
= ConTeXt's markup =
 +
 
 +
ConTeXt has a multilingual interface to enable users to work in their own language. It is specified by setting the ConTeXt interface value in the first line of your input file:
 +
* <code>% interface=en</code> [http://www.pragma-ade.nl/general/qrcs/setup-en.pdf commands]
 +
* <code>% interface=nl</code> [http://www.pragma-ade.nl/general/qrcs/setup-nl.pdf commando’s]
 +
* <code>% interface=de</code> [http://www.pragma-ade.nl/general/qrcs/setup-de.pdf befehle]
 +
* <code>% interface=cz</code> [http://www.pragma-ade.nl/general/qrcs/setup-cz.pdf přikazy]
 +
* <code>% interface=fr</code> [http://www.pragma-ade.nl/general/qrcs/setup-fr.pdf commandes]
 +
* <code>% interface=it</code> [http://www.pragma-ade.nl/general/qrcs/setup-it.pdf comandi]
 +
* <code>% interface=ro</code> [http://www.pragma-ade.nl/general/qrcs/setup-ro.pdf comenzile]
 +
 
 +
=Language-specific pages=
 +
 
 
* [[Arabic and Hebrew]]
 
* [[Arabic and Hebrew]]
* [[Chinese]]
+
* [[Chinese Japanese and Korean]]
 
* [[Czech]]
 
* [[Czech]]
 
* [[Greek]]
 
* [[Greek]]
 
* [[Russian]]
 
* [[Russian]]
 
* [[Vietnamese]]
 
* [[Vietnamese]]
 +
* [[RTL]] for dealing with Right-To-Left texts as well as BiDi (bidirectional) texts
 +
* French:  [[French Punctuation]] and [[French spacing]] (old)
 +
 +
=Language tags=
 +
 +
Here's the list of ConTeXt's '''language tags''', also available in the [http://www.pragma-ade.nl/general/manuals/languages-mkiv.pdf#&#91;5,{%22name%22:%22Fit%22}&#93; latest official Languages manual]. [https://source.contextgarden.net/tex/context/patterns Sources are available]).
 +
 +
<context source=yes>
 +
\usemodule[languages-system]
 +
\loadinstalledlanguages
 +
\showinstalledlanguages
 +
</context>
 +
 +
=Other links=
 +
 +
Finally, for older content, we keep a page [[Encodings and Regimes - Old Content]] about including accents, composite characters, and how "ä" and alike were produced in LaTeX/ConTeXt mkii. [[Second Step]] gave an example for german language.
 +
 +
 +
[[Category:Languages]]

Latest revision as of 09:31, 2 June 2024

Two commands to set up the language aspects

Today, with the international use of the UTF-8 standard for input and output encoding, you only need two commands, with the language tag you want in brackets:

\mainlanguage[tag]
to set the language of auto-generated language elements, like the title of the table of contents or the appendix,
and to change the hyphenation rules, quotation marks, all that sort of thing, to that of a different language.
\language[tag]
to change the hyphenation rules, quotation marks, all that sort of thing, to that of a different language. (The default language is English.)

\mainlanguage includes all settings of \language. \language is only needed when you use more than 1 language in a document, otherwise \mainlanguage is enough to change labels and hyphentation patterns.

As you can see in the following example \mainlanguage change the float label and the quotation marks but \language changes only the quotation marks and uses the label of the main language.

\startplacefigure[title=\quotation{English quotes}]
\midaligned{\blackrule[width=6cm,height=1cm,color=red]}
\stopplacefigure

\start \mainlanguage[nl]
\startplacefigure[title=\quotation{Dutch quotes}]
\midaligned{\blackrule[width=6cm,height=1cm,color=green]}
\stopplacefigure
\stop

\start \language[fr]
\startplacefigure[title=\quotation{French quotes}]
\midaligned{\blackrule[width=6cm,height=1cm,color=blue]}
\stopplacefigure
\stop


ConTeXt's markup

ConTeXt has a multilingual interface to enable users to work in their own language. It is specified by setting the ConTeXt interface value in the first line of your input file:

Language-specific pages

Language tags

Here's the list of ConTeXt's language tags, also available in the latest official Languages manual. Sources are available).

\usemodule[languages-system]
\loadinstalledlanguages
\showinstalledlanguages

Other links

Finally, for older content, we keep a page Encodings and Regimes - Old Content about including accents, composite characters, and how "ä" and alike were produced in LaTeX/ConTeXt mkii. Second Step gave an example for german language.