Improve localization func to support placeholders