Don't print debug message if function 'debug' not defined
Fix dependencies (sprintf)
lang(): accept language array as key parameter