add registerLocales and make linkResources work with function