Creating multiple language versions from single latex source by fetching translation from file

Ok, I managed to put together my own solution by trying around and considering examples I found elsewhere. This is what I currently use, near the start of my project. It works fine so far:

%%%%%%%%%%%%%%%
% 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]{\ifnum\pdfstrcmp{\languagename}{english}=0 {#2}\else{#1}\fi}
\newcommand{\babelDE}[1]{\ifnum\pdfstrcmp{\languagename}{ngerman}=0 {#1}\fi}
\newcommand{\babelEN}[1]{\ifnum\pdfstrcmp{\languagename}{english}=0 {#1}\fi}
% example:   \babel{Deutscher Text}{english text}
% example:   \babelDE{deutscher Text}
% example:   \babelEN{english text}
%%%%%%%%%%%%%%%

Using the iflang package it is possible to write a slightly cleaner command equivalent to the one in the previous answer:

\usepackage[ngerman,english]{babel}
%\usepackage[english,ngerman]{babel}

\usepackage{iflang}

\newcommand{\babel}[2]{\IfLanguageName{english}{#1}{#2}}