diff --git a/OsmAnd/res/layout-land/navigate_point.xml b/OsmAnd/res/layout-land/navigate_point.xml index 59d7927626..8a95d903d3 100644 --- a/OsmAnd/res/layout-land/navigate_point.xml +++ b/OsmAnd/res/layout-land/navigate_point.xml @@ -4,28 +4,28 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> - + - + - + - - - + + + - - + + diff --git a/OsmAnd/res/layout/navigate_point.xml b/OsmAnd/res/layout/navigate_point.xml index dfe3df5ac3..122a4e53b6 100644 --- a/OsmAnd/res/layout/navigate_point.xml +++ b/OsmAnd/res/layout/navigate_point.xml @@ -4,22 +4,22 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> - + - + - + - - - + + + @@ -27,7 +27,7 @@ - - + + diff --git a/OsmAnd/res/layout/search_address.xml b/OsmAnd/res/layout/search_address.xml index 44173f2dcb..127fed05e1 100644 --- a/OsmAnd/res/layout/search_address.xml +++ b/OsmAnd/res/layout/search_address.xml @@ -5,13 +5,13 @@ android:layout_height="fill_parent" android:orientation="vertical"> - + - + @@ -19,7 +19,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -44,17 +44,17 @@ - - + + - - diff --git a/OsmAnd/res/values-ru-rRU/strings.xml b/OsmAnd/res/values-ru-rRU/strings.xml index 5807c4ab78..2a5e126966 100644 --- a/OsmAnd/res/values-ru-rRU/strings.xml +++ b/OsmAnd/res/values-ru-rRU/strings.xml @@ -1,12 +1,14 @@ + Указать пароль для работы с OSM + Пароль Упраление слоем open street bugs, установка osm логина Включение мониторинга, установка интервала сохранения Настройка параметров поиска Настройка источника, параметров карты, доступа в Интернет Поиск Osm - Автоматически измемять масштаб карты при изменении скорости + Автоматически изменять масштаб карты при изменении скорости Масштаб Дополнительные настройки Выбор режима работы приложения @@ -19,12 +21,12 @@ Мониторинг Сохранять путь в gpx формате в папку track Мониторить - Перейти к + Идти к Обновить карту Обновить часть карты Указать имя пользователя для работы с OSM Имя пользователя - Цель + Точка Показывать слой Open Street Bugs Open Street Bugs Список избранных точек @@ -36,7 +38,7 @@ Выберите здание Выберите улицу Выберите город - Выберите страну + Выберите регион Установить расположение текущей позиции на карте Текущая позиция Перейти к точке @@ -77,7 +79,7 @@ Search street incrementally Search building incrementally Choose region -Choose intersected street +Выберите пересечение улиц Closest amenities По умолчанию Автомобиль @@ -85,4 +87,52 @@ Пешеход В центре Внизу +1 секунда +2 секунды +5 секунд +15 секунд +30 секунд +1 минута +5 минут +Введите широту и долготу в выбранном формате (Г - градусы, М - минуты, С - секунды) +Широта +Долгота +ГГГ.ГГГГ +ГГГ:ММ.МММММ +ГГГ:ММ:СС.ССССС +Показать +Отмена +Выберите адрес +Регион +Город +Улица +Здание +Здание +Пересечение улиц +Адрес +Координаты +Идти к точке +Добавить к избранным +Обновить карту +Создать open street bug +Добавить poi +Вы действительно хотите удалить эту часть карты с диска и загрузить ее из Интернет? +Да +Отмена +ПрименитьДобавитьНетВведите имя точки +Избранная +Точка '{0}' была успешно добавлена к Избранным. + +Контекстное меню +Показать +Редактировать точку +Удалить точку +Введите новое имя точки + +Вы действительно хотите удалить точку из Избранных? +Точка {0} была успешно удалена из Избранных. + +Введите текст для Open Street Bug +Open Streen Bug был успешно создан +Произошла ошибка. Open Street Bug не был создан. diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 7911f250ed..4bcc6b6b80 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -89,4 +89,54 @@ Pedestrian Center Bottom +1 second +2 seconds +5 seconds +15 seconds +30 seconds +1 minute +5 minutes +Input latitude & longitude in the selected format (D - degrees, M - minutes, S - seconds) +Latitude +Longitude +DDD.DDDDD +DDD:MM.MMMMM +DDD:MM:SS.SSSSS +Show on map +Cancel +Select address +Region +City +Street +Building +Building +Intersected street + +Address +Location + +Navigate to point +Add to favourites +Update map +Open osm bug +Create POI +Tile image will be removed from file system. Do you want to reload tile from internet? +Yes +Cancel +ApplyAddNoInput name of favourite point +Favourite +Favourite point '{0}' was added successfully. + +Context menu +Navigate to +Edit favourite +Delete favourite +Input new name of favourite point + +Are you sure about deleting favourite point? +Favourite point {0} was succesfully deleted. + +Input text of bug +Bug was successfully created +Exception occured : bug was not created diff --git a/OsmAnd/src/com/osmand/PoiFilter.java b/OsmAnd/src/com/osmand/PoiFilter.java index 96cb2ab917..660e4c720b 100644 --- a/OsmAnd/src/com/osmand/PoiFilter.java +++ b/OsmAnd/src/com/osmand/PoiFilter.java @@ -33,7 +33,7 @@ public class PoiFilter { public PoiFilter(AmenityType type){ isStandardFilter = true; filterId = STD_PREFIX + type; - name = type == null ? "Closest poi" : Algoritms.capitalizeFirstLetterAndLowercase(type.name()).replace('_', ' '); + name = type == null ? Messages.getMessage("poi_filter_closest_poi") : AmenityType.toPublicString(type); if(type == null){ initSearchAll(); } else { diff --git a/OsmAnd/src/com/osmand/PoiFiltersHelper.java b/OsmAnd/src/com/osmand/PoiFiltersHelper.java index a958580c34..fd23a68743 100644 --- a/OsmAnd/src/com/osmand/PoiFiltersHelper.java +++ b/OsmAnd/src/com/osmand/PoiFiltersHelper.java @@ -50,7 +50,7 @@ public class PoiFiltersHelper { list.add("car"); list.add("car_repair"); types.put(AmenityType.SHOP, list); - filters.add(new PoiFilter("Car aid", null, types)); + filters.add(new PoiFilter(Messages.getMessage("poi_filter_car_aid"), null, types)); types.clear(); @@ -70,13 +70,13 @@ public class PoiFiltersHelper { list.add("waste_basket"); list.add("waste_disposal"); types.put(AmenityType.OTHER, list); - filters.add(new PoiFilter("For tourists", null, types)); + filters.add(new PoiFilter(Messages.getMessage("poi_filter_for_tourists"), null, types)); types.clear(); list = new ArrayList(); list.add("fuel"); types.put(AmenityType.TRANSPORTATION, list); - filters.add(new PoiFilter("Fuel", null, types)); + filters.add(new PoiFilter(Messages.getMessage("poi_filter_fuel"), null, types)); types.clear(); list = new ArrayList(); @@ -94,7 +94,7 @@ public class PoiFiltersHelper { list.add("supermarket"); list.add("variety_store"); types.put(AmenityType.SHOP, list); - filters.add(new PoiFilter("Food shop", null, types)); + filters.add(new PoiFilter(Messages.getMessage("poi_filter_food_shop"), null, types)); types.clear(); return filters; @@ -106,7 +106,7 @@ public class PoiFiltersHelper { ////ctx.deleteDatabase(PoiFilterDbHelper.DATABASE_NAME); cacheUserDefinedFilters = new ArrayList(); - PoiFilter filter = new PoiFilter("Custom filter", PoiFilter.CUSTOM_FILTER_ID, null); + PoiFilter filter = new PoiFilter(Messages.getMessage("poi_filter_custom_filter"), PoiFilter.CUSTOM_FILTER_ID, null); cacheUserDefinedFilters.add(filter); PoiFilterDbHelper helper = new PoiFilterDbHelper(ctx); cacheUserDefinedFilters.addAll(helper.getFilters()); diff --git a/OsmAnd/src/com/osmand/activities/FavouritesActivity.java b/OsmAnd/src/com/osmand/activities/FavouritesActivity.java index 09da16859b..ef8be6730e 100644 --- a/OsmAnd/src/com/osmand/activities/FavouritesActivity.java +++ b/OsmAnd/src/com/osmand/activities/FavouritesActivity.java @@ -3,6 +3,7 @@ */ package com.osmand.activities; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; @@ -12,6 +13,7 @@ import android.app.AlertDialog.Builder; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; +import android.content.res.Resources; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; @@ -67,10 +69,10 @@ public class FavouritesActivity extends ListActivity { @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { - menu.setHeaderTitle("Context menu"); - menu.add(0, NAVIGATE_TO, 0, "Navigate to"); - menu.add(0, EDIT_ITEM, 1, "Edit favourite"); - menu.add(0, DELETE_ITEM, 2, "Delete favourite"); + menu.setHeaderTitle(R.string.favourites_context_menu_title); + menu.add(0, NAVIGATE_TO, 0, R.string.favourites_context_menu_navigate); + menu.add(0, EDIT_ITEM, 1, R.string.favourites_context_menu_edit); + menu.add(0, DELETE_ITEM, 2, R.string.favourites_context_menu_delete); } }); @@ -94,12 +96,12 @@ public class FavouritesActivity extends ListActivity { startActivity(newIntent); } else if(aItem.getItemId() == EDIT_ITEM){ Builder builder = new AlertDialog.Builder(this); - builder.setTitle("Input new name of favourite point"); + builder.setTitle(R.string.favourites_edit_dialog_title); final EditText editText = new EditText(this); builder.setView(editText); editText.setText(point.getName()); - builder.setNegativeButton("Cancel", null); - builder.setPositiveButton("Apply", new DialogInterface.OnClickListener() { + builder.setNegativeButton(R.string.default_buttons_cancel, null); + builder.setPositiveButton(R.string.default_buttons_apply, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { boolean editied = helper.editFavouriteName(point, editText.getText().toString()); @@ -112,15 +114,16 @@ public class FavouritesActivity extends ListActivity { builder.create().show(); return true; } if(aItem.getItemId() == DELETE_ITEM){ + final Resources resources = this.getResources(); Builder builder = new AlertDialog.Builder(this); - builder.setMessage("Are you sure about deleting favourite point?"); - builder.setNegativeButton("No", null); - builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() { + builder.setMessage(R.string.favourites_remove_dialog_title); + builder.setNegativeButton(R.string.default_buttons_no, null); + builder.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { boolean deleted = helper.deleteFavourite(point); if (deleted) { - Toast.makeText(FavouritesActivity.this, "Favourite point " + point.getName() + " was succesfully deleted.", + Toast.makeText(FavouritesActivity.this, MessageFormat.format(resources.getString(R.string.favourites_remove_dialog_success), point.getName()), Toast.LENGTH_SHORT).show(); favouritesList.remove(point); favouritesAdapter.notifyDataSetChanged(); diff --git a/OsmAnd/src/com/osmand/activities/MapActivity.java b/OsmAnd/src/com/osmand/activities/MapActivity.java index d3ed8fce2f..7dec610c91 100644 --- a/OsmAnd/src/com/osmand/activities/MapActivity.java +++ b/OsmAnd/src/com/osmand/activities/MapActivity.java @@ -1,11 +1,16 @@ package com.osmand.activities; +import java.text.MessageFormat; + +import org.apache.http.entity.StringEntity; + import android.app.Activity; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; +import android.content.res.Resources; import android.graphics.PointF; import android.hardware.Sensor; import android.hardware.SensorEvent; @@ -18,6 +23,7 @@ import android.location.LocationProvider; import android.os.Bundle; import android.os.PowerManager; import android.os.PowerManager.WakeLock; +import android.text.format.Formatter; import android.util.Log; import android.view.KeyEvent; import android.view.Menu; @@ -526,9 +532,9 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat protected void reloadTile(final int zoom, final double latitude, final double longitude){ Builder builder = new AlertDialog.Builder(this); - builder.setMessage("Tile image will be removed from file system. Do you want to reload tile from internet?"); - builder.setNegativeButton("Cancel", null); - builder.setPositiveButton("Yes", new DialogInterface.OnClickListener(){ + builder.setMessage(R.string.context_menu_item_update_map_confirm); + builder.setNegativeButton(R.string.default_buttons_cancel, null); + builder.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener(){ @Override public void onClick(DialogInterface dialog, int which) { int x = (int) MapUtils.getTileNumberX(zoom, longitude); @@ -542,7 +548,14 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat protected void contextMenuPoint(final double latitude, final double longitude){ Builder builder = new AlertDialog.Builder(this); - builder.setItems(new String[]{"Navigate to point", "Add to favourites", "Update map", "Open osm bug", "Create POI"}, new DialogInterface.OnClickListener(){ + Resources resources = this.getResources(); + builder.setItems(new String[]{ + resources.getString(R.string.context_menu_item_navigate_point), + resources.getString(R.string.context_menu_item_add_favorite), + resources.getString(R.string.context_menu_item_update_map), + resources.getString(R.string.context_menu_item_open_bug), + resources.getString(R.string.context_menu_item_create_poi) + }, new DialogInterface.OnClickListener(){ @Override public void onClick(DialogInterface dialog, int which) { @@ -565,24 +578,25 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat protected void addFavouritePoint(double latitude, double longitude){ + final Resources resources = this.getResources(); final FavouritePoint p = new FavouritesActivity.FavouritePoint(); p.setLatitude(latitude); p.setLongitude(longitude); - p.setName("Favourite"); + p.setName(resources.getString(R.string.add_favorite_dialog_default_favourite_name)); Builder builder = new AlertDialog.Builder(this); - builder.setTitle("Input name of favourite point"); + builder.setTitle(R.string.add_favorite_dialog_top_text); final EditText editText = new EditText(this); builder.setView(editText); - builder.setNegativeButton("Cancel", null); - builder.setPositiveButton("Add", new DialogInterface.OnClickListener() { + builder.setNegativeButton(R.string.default_buttons_cancel, null); + builder.setPositiveButton(R.string.default_buttons_add, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { FavouritesDbHelper helper = new FavouritesActivity.FavouritesDbHelper(MapActivity.this); p.setName(editText.getText().toString()); boolean added = helper.addFavourite(p); if (added) { - Toast.makeText(MapActivity.this, "Favourite point " + p.getName() + " was succesfully added.", Toast.LENGTH_SHORT) + Toast.makeText(MapActivity.this, MessageFormat.format(resources.getString(R.string.add_favorite_dialog_favourite_added_template), p.getName()), Toast.LENGTH_SHORT) .show(); } helper.close(); diff --git a/OsmAnd/src/com/osmand/activities/NavigatePointActivity.java b/OsmAnd/src/com/osmand/activities/NavigatePointActivity.java index 99a037c040..14d3d44d68 100644 --- a/OsmAnd/src/com/osmand/activities/NavigatePointActivity.java +++ b/OsmAnd/src/com/osmand/activities/NavigatePointActivity.java @@ -37,7 +37,7 @@ public class NavigatePointActivity extends Activity { public void showDialog(){ dlg.setContentView(R.layout.navigate_point); - dlg.setTitle("Navigate to point"); + dlg.setTitle(R.string.map_specify_point); LatLon loc = activity.getMapLocation(); initUI(loc.getLatitude(), loc.getLongitude()); dlg.show(); @@ -48,7 +48,7 @@ public class NavigatePointActivity extends Activity { super.onCreate(savedInstanceState); LatLon loc = OsmandSettings.getLastKnownMapLocation(this); setContentView(R.layout.navigate_point); - setTitle("Navigate to point"); + setTitle(R.string.map_specify_point); initUI(loc.getLatitude(), loc.getLongitude()); ((Button) findViewById(R.id.Cancel)).setText(getString(R.string.navigate_to)); } diff --git a/OsmAnd/src/com/osmand/activities/SettingsActivity.java b/OsmAnd/src/com/osmand/activities/SettingsActivity.java index 9a074e9464..2eb4a85ec6 100644 --- a/OsmAnd/src/com/osmand/activities/SettingsActivity.java +++ b/OsmAnd/src/com/osmand/activities/SettingsActivity.java @@ -110,7 +110,14 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference userName.setText(OsmandSettings.getUserName(this)); userPassword.setText(OsmandSettings.getUserPassword(this)); - saveTrackInterval.setEntries(new String[]{"1 second", "2 seconds", "5 seconds", "15 seconds", "30 seconds", "1 minute", "5 minute"}); + saveTrackInterval.setEntries(new String[]{ + resources.getString(R.string.interval_1_second), + resources.getString(R.string.interval_2_seconds), + resources.getString(R.string.interval_5_seconds), + resources.getString(R.string.interval_15_seconds), + resources.getString(R.string.interval_30_seconds), + resources.getString(R.string.interval_1_minute), + resources.getString(R.string.interval_5_minutes)}); saveTrackInterval.setEntryValues(new String[]{"1", "2", "5", "15", "30", "60", "300"}); saveTrackInterval.setValue(OsmandSettings.getSavingTrackInterval(this)+""); diff --git a/OsmAnd/src/com/osmand/activities/search/SearchActivity.java b/OsmAnd/src/com/osmand/activities/search/SearchActivity.java index 2ced074e7d..aa8b132003 100644 --- a/OsmAnd/src/com/osmand/activities/search/SearchActivity.java +++ b/OsmAnd/src/com/osmand/activities/search/SearchActivity.java @@ -3,6 +3,7 @@ */ package com.osmand.activities.search; +import com.osmand.R; import com.osmand.activities.NavigatePointActivity; import android.app.TabActivity; @@ -24,8 +25,8 @@ public class SearchActivity extends TabActivity { super.onCreate(savedInstanceState); TabHost host = getTabHost(); host.addTab(host.newTabSpec("Search_POI").setIndicator("POI").setContent(new Intent(this, SearchPoiFilterActivity.class))); - host.addTab(host.newTabSpec("Search_Address").setIndicator("Address").setContent(new Intent(this, SearchAddressActivity.class))); - host.addTab(host.newTabSpec("Search_Location").setIndicator("Location").setContent(new Intent(this, NavigatePointActivity.class))); + host.addTab(host.newTabSpec("Search_Address").setIndicator(this.getResources().getString(R.string.search_tabs_address)).setContent(new Intent(this, SearchAddressActivity.class))); + host.addTab(host.newTabSpec("Search_Location").setIndicator(this.getResources().getString(R.string.search_tabs_location)).setContent(new Intent(this, NavigatePointActivity.class))); } } diff --git a/OsmAnd/src/com/osmand/activities/search/SearchAddressActivity.java b/OsmAnd/src/com/osmand/activities/search/SearchAddressActivity.java index 8cb0f5efa3..09efb76e99 100644 --- a/OsmAnd/src/com/osmand/activities/search/SearchAddressActivity.java +++ b/OsmAnd/src/com/osmand/activities/search/SearchAddressActivity.java @@ -198,14 +198,14 @@ public class SearchAddressActivity extends Activity { protected void updateBuildingSection(){ if(radioBuilding){ - ((TextView)findViewById(R.id.BuildingText)).setText("Building"); + ((TextView)findViewById(R.id.BuildingText)).setText(R.string.search_address_building); if(building == null){ ((TextView)findViewById(R.id.BuildingButton)).setText(R.string.choose_building); } else { ((TextView)findViewById(R.id.BuildingButton)).setText(building.getName(region.useEnglishNames())); } } else { - ((TextView)findViewById(R.id.BuildingText)).setText("Street 2"); + ((TextView)findViewById(R.id.BuildingText)).setText(R.string.search_address_street); if(street2 == null){ ((TextView)findViewById(R.id.BuildingButton)).setText(R.string.choose_intersected_street); } else { diff --git a/OsmAnd/src/com/osmand/views/OsmBugsLayer.java b/OsmAnd/src/com/osmand/views/OsmBugsLayer.java index 5ab9c3f7a1..d6d8889482 100644 --- a/OsmAnd/src/com/osmand/views/OsmBugsLayer.java +++ b/OsmAnd/src/com/osmand/views/OsmBugsLayer.java @@ -340,12 +340,12 @@ public class OsmBugsLayer implements OsmandMapLayer { public void openBug(final Context ctx, LayoutInflater layoutInflater, final OsmandMapTileView mapView, final double latitude, final double longitude){ Builder builder = new AlertDialog.Builder(ctx); - builder.setTitle("Input text of bug"); + builder.setTitle(R.string.osb_add_dialog_title); final View view = layoutInflater.inflate(R.layout.open_bug, null); builder.setView(view); ((EditText)view.findViewById(R.id.AuthorName)).setText(OsmandSettings.getUserName(ctx)); - builder.setNegativeButton("Cancel", null); - builder.setPositiveButton("Add", new DialogInterface.OnClickListener() { + builder.setNegativeButton(R.string.default_buttons_cancel, null); + builder.setPositiveButton(R.string.default_buttons_add, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String text = ((EditText)view.findViewById(R.id.BugMessage)).getText().toString(); @@ -354,13 +354,13 @@ public class OsmBugsLayer implements OsmandMapLayer { boolean bug = createNewBug(latitude, longitude, text, author); if (bug) { - Toast.makeText(ctx, "Bug was successfully created", Toast.LENGTH_LONG).show(); + Toast.makeText(ctx, ctx.getResources().getString(R.string.osb_add_dialog_success), Toast.LENGTH_LONG).show(); clearCache(); if (mapView.getLayers().contains(OsmBugsLayer.this)) { mapView.refreshMap(); } } else { - Toast.makeText(ctx, "Exception occured : bug was not created", Toast.LENGTH_LONG).show(); + Toast.makeText(ctx, ctx.getResources().getString(R.string.osb_add_dialog_error), Toast.LENGTH_LONG).show(); } } });