[loc] add localization support

* This is a merge up to commit bd319269aae59fbaead0d3ed6e1d7d340813fd42 of the localization branch
* Also fixes Clang warnings