The template language is closer to lisp (with "prog") than python, but not all that close.
The following does what I think you want
Code:
program:
lang = test(field('language'), strcat(field('language'), '_'), '');
list_re(field('tags'), ',', '(.*)', strcat(lang, '\1') )
It assumes that there is one language in languages or that you want all languages as the prefix, and that you want the language code instead of the language name.