Guest User

Untitled

a guest
Nov 17th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. - each token of natural language ("phrase") will be enclosed in a macro
  2. - the macro fetches the translation of the phrase from a local service
  3. - this service could be a script reading translations from a file
  4.  
  5. %%%%%%%%%%%%%%%
  6. % this is a document holding multiple languages
  7. % switch between ENGLISH and GERMAN by commenting one of the following lines:
  8. usepackage[ngerman,english]{babel} % makes ENGLISH content
  9. %usepackage[english,ngerman]{babel} % makes GERMAN content
  10. % this is the macro to define phrases in two languages:
  11. newcommand{babel}[2]{ifnumpdfstrcmp{languagename}{english}=0 {#2}else{#1}fi}
  12. newcommand{babelDE}[1]{ifnumpdfstrcmp{languagename}{ngerman}=0 {#1}fi}
  13. newcommand{babelEN}[1]{ifnumpdfstrcmp{languagename}{english}=0 {#1}fi}
  14. % example: babel{Deutscher Text}{english text}
  15. % example: babelDE{deutscher Text}
  16. % example: babelEN{english text}
  17. %%%%%%%%%%%%%%%
  18.  
  19. usepackage[ngerman,english]{babel}
  20. %usepackage[english,ngerman]{babel}
  21.  
  22. newcommand{babel}[2]{IfLanguageName{english}{#1}{#2}}
Add Comment
Please, Sign In to add comment