This doesn't really have anything to do with the KO mapping plugin. Assuming you are correctly getting the initial data into your viewmodel (whether you are using the mapping plugin or not), all your binding handler is doing is changing what is displayed in the UI.
You can access other members of your view model through the a parameter in your binding handler commonly named as bindingContext
. See this section of the KO docs for more info.
So you could rewrite your binding handler like so:
ko.bindingHandlers.translate = {
init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
console.log(bindingContext.$data.address.city());// the cityName
if (bindingContext.$data.address.street._latestValue == "koeln") {
//set back city to cologne
bindingContext.$data.address.city('cologne');
}
},
/// add your update section if needed
};