From 244bdbec19e82da5bd9900049534432b83d8ab97 Mon Sep 17 00:00:00 2001 From: Martin Ndegwa Date: Thu, 26 May 2022 15:41:18 +0300 Subject: [PATCH] Revert Location translations - Revert the translation locations #870 --- .../org/smartregister/view/LocationPickerView.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/opensrp-core/src/main/java/org/smartregister/view/LocationPickerView.java b/opensrp-core/src/main/java/org/smartregister/view/LocationPickerView.java index 799c16d74..e67917310 100644 --- a/opensrp-core/src/main/java/org/smartregister/view/LocationPickerView.java +++ b/opensrp-core/src/main/java/org/smartregister/view/LocationPickerView.java @@ -16,7 +16,6 @@ import org.smartregister.R; import org.smartregister.adapter.ServiceLocationsAdapter; import org.smartregister.location.helper.LocationHelper; -import org.smartregister.util.Utils; import org.smartregister.view.customcontrols.CustomFontTextView; import java.util.ArrayList; @@ -24,7 +23,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.stream.Collectors; /** * @author Jason Rogena - jrogena@ona.io @@ -78,11 +76,7 @@ public void init() { Collections.sort(sortedLocations); sortedLocations.add(0, defaultLocation); - List translatedLocations = sortedLocations.stream().map(e -> { - return Utils.getTranslatedLocation(e); - }).collect(Collectors.toList()); - - serviceLocationsAdapter = new ServiceLocationsAdapter(context, translatedLocations); + serviceLocationsAdapter = new ServiceLocationsAdapter(context, sortedLocations); locationsLV.setAdapter(serviceLocationsAdapter); locationsLV.setOnItemClickListener((parent, view, position, id) -> { CoreLibrary.getInstance().context().allSharedPreferences().saveCurrentLocality(serviceLocationsAdapter.getLocationAt(position)); @@ -94,8 +88,7 @@ public void init() { } locationPickerDialog.dismiss(); }); - - this.setText(Utils.getTranslatedLocation(LocationHelper.getInstance().getOpenMrsReadableName(getSelectedItem()))); + this.setText(LocationHelper.getInstance().getOpenMrsReadableName(getSelectedItem())); setClickable(true); setOnClickListener(this); @@ -108,7 +101,7 @@ public String getSelectedItem() { CoreLibrary.getInstance().context().allSharedPreferences().saveCurrentLocality(selectedLocation); CoreLibrary.getInstance().context().allSharedPreferences().saveCurrentDataStrategy(AllConstants.DATA_CAPTURE_STRATEGY.NORMAL); } - return Utils.getTranslatedLocation(selectedLocation); + return selectedLocation; } public void setOnLocationChangeListener(final OnLocationChangeListener onLocationChangeListener) {