add localization and toLocal & toGlobal func