I would like to know if it is possible to conditionally require, in a given document, the inclusion of a chapter or the input of a particular piece of text, depending on the language set on
babelor inpolyglossia.
I mean something similar to the mechanism used by the package translations for the customization of a document according to the setting of its main language. Precisely, I would like that, after setting the main document language by
\usepackage[lang]{babel}
or
\setmainlanguage{lang},
a language file text_lang is automatically included in the text: : specialist in documentation design call this language conditioned parts "tags".
Is this possible and, if so, could you address me to the relevant packages or show an example code?
babelandpolyglossiahandle language variant/dialects.babelusually assigns a new language name (if you will), for examplengermanfor German with new orthography rules andnaustrianfor Austrian German with new orthography rules. Butpolyglossiawould use the same base language in that case (german) and would handle the new/old orthography rules and German/Austrian/Swiss German with additional properties that are hard to detect from the outside – moewe Jan 12 '19 at 15:17polyglossiait would be more difficult to conditionally import text in different languages sharing a common linguistic root. However this is not a problem for me at present, since I am trying to discriminate between quite different languages. Anyway, thank you so much for the packages you suggested/highlighted. – Daniele Tampieri Jan 12 '19 at 15:24polyglossiahandles these languages. – moewe Jan 12 '19 at 15:29