Fixes lag in language switch

Does what it says on the tin. Also I've prefixed the global function to avoid any collisions.