You may use this single sed
and avoid any loop:
sed -f <(printf 's/test.%s/www.&.newdomain/g
' $LANG_KEYS) test.txt > /new-2.txt
Or if you want to get only matched lines:
sed -nf <(printf 's/test.%s/www.&.newdomain/gp
' $LANG_KEYS) test.txt > /new-2.txt
Fix to your attempted edited script:
LANG_KEYS="de
at
pl
"
DOMAIN="test"
DOMAIN_SUFFIX="net"
sed -f <(printf "s/$DOMAIN.%s/www.&.$DOMAIN_SUFFIX/g
" $LANG_KEYS) test.txt > /new-2.txt
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…