Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - each token of natural language ("phrase") will be enclosed in a macro
- - the macro fetches the translation of the phrase from a local service
- - this service could be a script reading translations from a file
- %%%%%%%%%%%%%%%
- % this is a document holding multiple languages
- % switch between ENGLISH and GERMAN by commenting one of the following lines:
- usepackage[ngerman,english]{babel} % makes ENGLISH content
- %usepackage[english,ngerman]{babel} % makes GERMAN content
- % this is the macro to define phrases in two languages:
- newcommand{babel}[2]{ifnumpdfstrcmp{languagename}{english}=0 {#2}else{#1}fi}
- newcommand{babelDE}[1]{ifnumpdfstrcmp{languagename}{ngerman}=0 {#1}fi}
- newcommand{babelEN}[1]{ifnumpdfstrcmp{languagename}{english}=0 {#1}fi}
- % example: babel{Deutscher Text}{english text}
- % example: babelDE{deutscher Text}
- % example: babelEN{english text}
- %%%%%%%%%%%%%%%
- usepackage[ngerman,english]{babel}
- %usepackage[english,ngerman]{babel}
- newcommand{babel}[2]{IfLanguageName{english}{#1}{#2}}
Add Comment
Please, Sign In to add comment