Uh... That's an ugly one...

Wouldn't it be better to include that to the layertree definition... ? Moreover, you should get that out of your language translations files, because they are static files... (and move that into a yaml file or database -> json)