Optimize perfermance

replace the whitespace when calc the rate

Only add lang key when string contain it.