Need a unique gift idea?
A Pastebin account makes a great Christmas gift


a guest Nov 17th, 2018 63 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  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
  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. %%%%%%%%%%%%%%%
  19. usepackage[ngerman,english]{babel}
  20. %usepackage[english,ngerman]{babel}
  22. newcommand{babel}[2]{IfLanguageName{english}{#1}{#2}}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!