From 2105fc028e2552a33e889ff3ae58a61464822171 Mon Sep 17 00:00:00 2001 From: Leif Larsson Date: Sun, 6 Jul 2014 21:08:08 +0200 Subject: [PATCH 01/18] Translated using Weblate (Swedish) Currently translated at 99.3% (1428 of 1437 strings) --- OsmAnd/res/values-sv/strings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-sv/strings.xml b/OsmAnd/res/values-sv/strings.xml index 1a93752b81..8b9469fa3e 100644 --- a/OsmAnd/res/values-sv/strings.xml +++ b/OsmAnd/res/values-sv/strings.xml @@ -1606,4 +1606,5 @@ OsMo-tjänst OsMo-spår %1$s nedladdat. "Kartkälla och kartlager som ska visas ändras via \'Meny\' → \'Kartlager\'.\n\nUnder \'Kartkälla...\' kan du välja mellan de förladdade offline vektorkartorna (standard, krävs också för offline-navigering), eller fördefinierade (online eller cachade offline) kartbitskällor (aktivera insticksmodulen \'Online-kartor\' under \'Inställningar\'→ \'Plugin\' för detta), eller kartor skapade manuellt med t.ex. OsmaAndMapCreator på en PC.\n\nOsmAnd stöder också egna källor. " - + Inloggningen till OsMo misslyckades + From 363c59b6d0f7217425ad0f414611756c01da3d72 Mon Sep 17 00:00:00 2001 From: ezjerry liao Date: Mon, 7 Jul 2014 04:31:39 +0200 Subject: [PATCH 02/18] Translated using Weblate (Traditional Chinese) Currently translated at 100.0% (1440 of 1440 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index ad1ad5982c..ee7b777cd0 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -1885,4 +1885,8 @@ OsmAnd 是開放原始碼,而且正在積極的開發。應用程式從報告 自動連線 OsMo 服務 OsMo 軌跡 %1$s 已下載。 + 輸入邀請 + " - 所有建立的群組都是公開的!如果您希望匿名,直接用連接裝置追蹤 IDS 。\n - 群組可以註冊多達16人。\n - 假使閒置或僅一人於二個星期裡活動,那群組將會被刪除。\n - 因為只能靠邀請,您可以限制群組的進入,但要控管群組您需要去管理主控台。\n - 如果您需要建立一個群組,但是具有其它條件,請連絡 http://osmo.mobi" + 請在建立群組之前,仔細閱讀! + OsMo 登入失敗 From 6fb99aef10a8caaaab3a14c75f44f07a50d45563 Mon Sep 17 00:00:00 2001 From: Andrius Date: Mon, 7 Jul 2014 04:44:28 +0200 Subject: [PATCH 03/18] Translated using Weblate (Lithuanian) Currently translated at 100.0% (1440 of 1440 strings) --- OsmAnd/res/values-lt/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd/res/values-lt/strings.xml b/OsmAnd/res/values-lt/strings.xml index 43e11058a4..f95d4b87bb 100644 --- a/OsmAnd/res/values-lt/strings.xml +++ b/OsmAnd/res/values-lt/strings.xml @@ -1892,4 +1892,8 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A Automatiškai jungtis OsMo paslauga OsMo įrašas %1$s parsiųstas. + Prisijungti su pakvietimais + " - Visos sukurtos grupės yra viešos! Jei jungtis anonimiškai, tai darykite naudodami sekiklio ID.\n- Grupėje gali būti iki 16 asmenų.\n- Jei grupėje nebus jokios veiklos arba tik vienas asmuo dvi savaites, ji bus panaikinta.\n- Narystę grupėje galima apriboti pakvietimais, tačiau valdyti grupę bus galima tik iš administravimo konsolės.\n- Jei jums reikia sukuti grupę su kitokiais reikalavimais, susisiekite su http://osmo.mobi" + Perskaitykite prieš kurdami grupę! + Prisijungimas prie OsMo nepavyko From 82654056c9fc21734df51ef6ae2033be4e8ed4ae Mon Sep 17 00:00:00 2001 From: jan madsen Date: Mon, 7 Jul 2014 06:16:44 +0200 Subject: [PATCH 04/18] Translated using Weblate (Danish) Currently translated at 100.0% (1440 of 1440 strings) --- OsmAnd/res/values-da/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index e8f6f6a572..dec7c661d1 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -1907,4 +1907,7 @@ Afghanistan, Albanien, Algeriet, Andorra, Angola, Anguilla, Antigua og Barbuda, OsMo tjeneste OsMo spor %1$s hentet. OsMo logind mislykkedes + "Læs dette før du opretter en gruppe!" + Indtast ved invitere + " -Alle grupper oprettet er offentlige! Hvis du ønsker at være anonym, tilslutte enheder direkte via Tracker-id\'er.\n -Gruppen kunne registreres op til 16 personer.\n -I tilfælde af inaktivitet eller kun 1 person aktivitet i 2 uger, vil gruppen blive slettet.\n -Du kan begrænse gruppe indgangen, som kun invitere, men at kontrolgruppen skal du gå til administrationskonsol.\n -Hvis du har brug at oprette en gruppe, men med andre betingelser, bedes du kontakte http://osmo.mobi" From ac82d2f3182339860f6626f41dfead7a098329bb Mon Sep 17 00:00:00 2001 From: josep constanti Date: Mon, 7 Jul 2014 08:07:49 +0200 Subject: [PATCH 05/18] Translated using Weblate (Catalan) Currently translated at 100.0% (1440 of 1440 strings) --- OsmAnd/res/values-ca/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml index fb988e238e..a125027c9d 100644 --- a/OsmAnd/res/values-ca/strings.xml +++ b/OsmAnd/res/values-ca/strings.xml @@ -1874,4 +1874,7 @@ La llista de països inclosos (bàsicament tot el món!): Afganistan, Albània, Servei OsMo Traça OsMo %1$s descarregada. Inici sessió OsMo erroni + Entreu per convidar + " - Tots els grups creats són públics! Si es vol ser anònim, connecteu directament els aparells via identificació de Tracker.\n - Dins el grup es poden registrar fins un màxim de 16 persones.\n - Cas d\'inactivitat o d\'activitat d\'una sola persona durant 2 setmanes, el grup serà esborrat.\n - Es pot restringir l\'entrada al grup, a només per invitació, però per controlar el grup es necessitarà accedir a la consola d\'administració.\n - Si us cal crear un grup, però amb altres condicions, contacteu http://osmo.mobi" + Si us plau, llegiu abans de crear un grup! From 633c5be7d777a0cee7753e7b27d854423424e756 Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Mon, 7 Jul 2014 08:42:08 +0200 Subject: [PATCH 06/18] Translated using Weblate (Italian) Currently translated at 100.0% (1440 of 1440 strings) --- OsmAnd/res/values-it/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index 6ab7378b8f..419c2ad993 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -1896,4 +1896,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz Servizio OsMo Scaricate %1$s tracce OsMo. Login a OsMo fallito + Accedere su invito + " - Tutti i gruppi creati sono pubblici! Se volete rimanere anonimi connettete i dispositivi direttamente tramite gli id di tracciamento.\n - Al gruppo possono essere registrate fino a 16 persone.\n - Nel caso di inattività o di attività di una sola persona per due settimane, il gruppo sarà cancellato.\n - È possibile limitare l\'accesso al gruppo, tipo solo su invito, per amministrare il gruppo devi andare al pannello di amministrazione.\n - Se avete bisogno di creare un gruppo ma ad altre condizioni per favore visitate http://osmo.mobi" + Per favore leggere prima di creare un gruppo! From 3887ad0636a45ac8d121a41b0c9717cbaea6b5b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Jul 2014 12:04:24 +0300 Subject: [PATCH 07/18] fixed bug with navigation not continue after reaching point --- .../RoutePointsPlugin.java | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsPlugin.java b/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsPlugin.java index 36667e9a4e..d6bdf4bd0d 100644 --- a/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsPlugin.java +++ b/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsPlugin.java @@ -51,6 +51,9 @@ public class RoutePointsPlugin extends OsmandPlugin { private RoutePointsLayer routePointsLayer; + private RoutePoint lastReachedPoint; + + public RoutePointsPlugin(OsmandApplication app) { ApplicationMode.regWidget("route_steps", ApplicationMode.CAR, ApplicationMode.DEFAULT); this.app = app; @@ -78,7 +81,10 @@ public class RoutePointsPlugin extends OsmandPlugin { btnY.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - currentRoute.navigateToNextPoint(true); + if (lastReachedPoint != null){ + lastReachedPoint.setDelivered(true); + lastReachedPoint = null; + } FrameLayout layout = (FrameLayout) mapActivity.getLayout(); layout.removeView(deliveredView); } @@ -89,7 +95,10 @@ public class RoutePointsPlugin extends OsmandPlugin { btnN.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - currentRoute.navigateToNextPoint(false); + if (lastReachedPoint != null){ + lastReachedPoint.setDelivered(false); + lastReachedPoint = null; + } FrameLayout layout = (FrameLayout) mapActivity.getLayout(); layout.removeView(deliveredView); } @@ -100,10 +109,16 @@ public class RoutePointsPlugin extends OsmandPlugin { @Override public boolean destinationReached() { if (currentRoute != null) { + if (currentRoute.currentPoints != null && !currentRoute.currentPoints.isEmpty()){ + lastReachedPoint = currentRoute.currentPoints.get(0); + } FrameLayout layout = (FrameLayout) mapActivity.getLayout(); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); params.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL; layout.addView(deliveredView, params); + //if it's possible to navigate to next point - navigation continues + return !currentRoute.navigateToNextPoint(); + } return true; @@ -463,20 +478,6 @@ public class RoutePointsPlugin extends OsmandPlugin { return null; } - public boolean navigateToNextPoint(boolean delivered) { - if (currentPoints.isEmpty()) { - return false; - } - - RoutePoint rp = currentPoints.get(0); - if (rp.isNextNavigate) { - rp.setDelivered(delivered); - return navigateToNextPoint(); - } - - return false; - } - public void saveGPXAsync() { new AsyncTask() { From 5b04bf969d73ae97593492729bdfdf8ebe3b79bd Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Jul 2014 19:58:22 +0300 Subject: [PATCH 08/18] updated translation functionality for downloaded maps, tts etc. --- .../src/net/osmand/plus/OsmandSettings.java | 17 -- .../plus/activities/LocalIndexesActivity.java | 54 +---- .../activities/SettingsGeneralActivity.java | 5 +- .../plus/download/DownloadActivityType.java | 7 +- .../helpers/FileNameTranslationHelper.java | 195 ++++++++++++++++++ 5 files changed, 207 insertions(+), 71 deletions(-) create mode 100644 OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 1b50ed47d8..b9ef7cbfaf 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1746,23 +1746,6 @@ public class OsmandSettings { return false; } - public static String getVoiceName(Context ctx, String basename) { - try { - String nm = basename.replace('-', '_').replace(' ', '_'); - if (nm.endsWith("_tts") || nm.endsWith("-tts")) { - nm = nm.substring(0, nm.length() - 4); - } - Field f = R.string.class.getField("lang_"+nm); - if (f != null) { - Integer in = (Integer) f.get(null); - return ctx.getString(in); - } - } catch (Exception e) { - System.err.println(e.getMessage()); - } - return basename; - } - public enum DayNightMode { AUTO(R.string.daynight_mode_auto), DAY(R.string.daynight_mode_day), diff --git a/OsmAnd/src/net/osmand/plus/activities/LocalIndexesActivity.java b/OsmAnd/src/net/osmand/plus/activities/LocalIndexesActivity.java index 9571850ac4..99bd5cc0fd 100644 --- a/OsmAnd/src/net/osmand/plus/activities/LocalIndexesActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/LocalIndexesActivity.java @@ -18,6 +18,7 @@ import net.osmand.plus.*; import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick; import net.osmand.plus.activities.LocalIndexHelper.LocalIndexType; import net.osmand.plus.download.IndexItem; +import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.util.Algorithms; import android.app.Activity; import android.app.AlertDialog; @@ -72,7 +73,7 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity { MessageFormat formatGb = new MessageFormat("{0, number,#.##} GB", Locale.US); private ContextMenuAdapter optionsMenuAdapter; private ActionMode actionMode; - private OsmandRegions osmandRegions; + @SuppressWarnings("unchecked") @Override @@ -87,7 +88,7 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity { descriptionLoader = new LoadLocalIndexDescriptionTask(); listAdapter = new LocalIndexesAdapter(this); - osmandRegions = ((OsmandApplication) getApplication()).getResourceManager().getOsmandRegions(); + getExpandableListView().setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() { @@ -881,7 +882,8 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity { } TextView viewName = ((TextView) v.findViewById(R.id.local_index_name)); String mapDescr = getMapDescription(child.getFileName()); - String mapName = getMapName(child.getFileName()); + String mapName = FileNameTranslationHelper.getFileName(ctx, ((OsmandApplication) getApplication()).getResourceManager().getOsmandRegions(), child.getFileName()); + if (mapDescr.length() > 0){ viewName.setText(mapDescr + " - " + mapName); } else { @@ -1017,37 +1019,7 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity { return true; } - private String getMapName(String fileName){ - String mapname = getBasename(fileName); - String lc = mapname.toLowerCase(); - String std = getStandardMapName(ctx,lc); - if (std != null){ - return std; - } - - return osmandRegions.getLocaleName(mapname); - } - - private String getBasename(String fileName) { - if (fileName.endsWith(IndexConstants.EXTRA_ZIP_EXT)) { - return fileName.substring(0, fileName.length() - IndexConstants.EXTRA_ZIP_EXT.length()); - } - if (fileName.endsWith(IndexConstants.SQLITE_EXT)) { - return fileName.substring(0, fileName.length() - IndexConstants.SQLITE_EXT.length()).replace('_', ' '); - } - - int ls = fileName.lastIndexOf('-'); - if (ls >= 0) { - return fileName.substring(0, ls); - } else { - ls = fileName.lastIndexOf("."); - if (ls >= 0){ - return fileName.substring(0,ls); - } - } - return fileName; - } private String getMapDescription(String fileName){ int ls = fileName.lastIndexOf("."); @@ -1062,21 +1034,5 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity { return ""; } - - private String getStandardMapName(Context ctx, String basename) { - if(basename.equals("world-ski")) { - return ctx.getString(R.string.index_item_world_ski); - } else if(basename.equals("world_altitude_correction_ww15mgh")) { - return ctx.getString(R.string.index_item_world_altitude_correction); - } else if(basename.equals("world_basemap")) { - return ctx.getString(R.string.index_item_world_basemap); - } else if(basename.equals("world_bitcoin_payments")) { - return ctx.getString(R.string.index_item_world_bitcoin_payments); - } else if(basename.equals("world_seamarks")) { - return ctx.getString(R.string.index_item_world_seamarks); - } - return null; - } - } } diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java index 89bcd35e86..bfd39290f9 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java @@ -23,6 +23,7 @@ import net.osmand.plus.R; import net.osmand.plus.Version; import net.osmand.plus.base.SuggestExternalDirectoryDialog; import net.osmand.plus.download.DownloadActivityType; +import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.plus.render.NativeOsmandLibrary; import net.osmand.plus.voice.CommandPlayer; import net.osmand.render.RenderingRulesStorage; @@ -563,8 +564,8 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { entrieValues[k] = OsmandSettings.VOICE_PROVIDER_NOT_USE; entries[k++] = getString(R.string.voice_not_use); for (String s : voiceFiles) { - entries[k] = (s.contains("tts") ? getString(R.string.ttsvoice) +" ":"") + - OsmandSettings.getVoiceName(this, s); + entries[k] = (s.contains("tts") ? getString(R.string.ttsvoice) +" ":"") + + FileNameTranslationHelper.getVoiceName(this, s); entrieValues[k] = s; k++; } diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java index 6bccec5502..d0e6bea0dd 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java @@ -18,6 +18,7 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.Version; +import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.util.Algorithms; import org.xmlpull.v1.XmlPullParser; @@ -194,10 +195,10 @@ public class DownloadActivityType { if (this == VOICE_FILE) { if (fileName.endsWith(IndexConstants.VOICE_INDEX_EXT_ZIP)) { return ctx.getString(R.string.voice) + "\n" + - OsmandSettings.getVoiceName(ctx, getBasename(indexItem)); + FileNameTranslationHelper.getVoiceName(ctx, getBasename(indexItem)); } else if (fileName.endsWith(IndexConstants.TTSVOICE_INDEX_EXT_ZIP)) { - return ctx.getString(R.string.ttsvoice) + "\n" + - OsmandSettings.getVoiceName(ctx, getBasename(indexItem)); + return ctx.getString(R.string.ttsvoice) + "\n" + + FileNameTranslationHelper.getVoiceName(ctx, getBasename(indexItem)); } return getBasename(indexItem); } diff --git a/OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java b/OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java new file mode 100644 index 0000000000..1a4ce0e3f3 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java @@ -0,0 +1,195 @@ +package net.osmand.plus.helpers; + +import android.content.Context; +import net.osmand.IndexConstants; +import net.osmand.map.OsmandRegions; +import net.osmand.plus.OsmandSettings; +import net.osmand.plus.R; + +import java.lang.reflect.Field; + +/** + * Created by Barsik on 07.07.2014. + */ +public class FileNameTranslationHelper { + + public static String getFileName(Context ctx, OsmandRegions regions, String fileName) { + String basename = getBasename(fileName); + if (basename.endsWith("_wiki")) { //wiki files + String wikiName = getStandardLangName(ctx, basename.substring(0, basename.indexOf("_wiki"))); + String wikiWord = ctx.getString(R.string.amenity_type_osmwiki); + int index = wikiWord.indexOf("("); + if (index >= 0) { + //removing word in "()" from recourse file + return wikiWord.substring(0, index) + wikiName; + } + return ctx.getString(R.string.amenity_type_osmwiki) + " " + wikiName; + } else if (fileName.endsWith("tts")) { //tts files + return getVoiceName(ctx, fileName); + } else if (fileName.length() == 2) { //voice recorded files + try { + Field f = R.string.class.getField("lang_"+fileName); + if (f != null) { + Integer in = (Integer) f.get(null); + return ctx.getString(in); + } + } catch (Exception e) { + System.err.println(e.getMessage()); + } + } + + //if nothing else + String lc = basename.toLowerCase(); + String std = getStandardMapName(ctx, lc); + if (std != null) { + return std; + } + + if (regions != null) { + return regions.getLocaleName(basename); + } + + return null; + } + + public static String getVoiceName(Context ctx, String basename) { + try { + String nm = basename.replace('-', '_').replace(' ', '_'); + if (nm.endsWith("_tts") || nm.endsWith("-tts")) { + nm = nm.substring(0, nm.length() - 4); + } + Field f = R.string.class.getField("lang_"+nm); + if (f != null) { + Integer in = (Integer) f.get(null); + return ctx.getString(in); + } + } catch (Exception e) { + System.err.println(e.getMessage()); + } + return basename; + } + + private static String getBasename(String fileName) { + if (fileName.endsWith(IndexConstants.EXTRA_ZIP_EXT)) { + return fileName.substring(0, fileName.length() - IndexConstants.EXTRA_ZIP_EXT.length()); + } + if (fileName.endsWith(IndexConstants.SQLITE_EXT)) { + return fileName.substring(0, fileName.length() - IndexConstants.SQLITE_EXT.length()).replace('_', ' '); + } + + int ls = fileName.lastIndexOf('-'); + if (ls >= 0) { + return fileName.substring(0, ls); + } else { + ls = fileName.lastIndexOf("."); + if (ls >= 0) { + return fileName.substring(0, ls); + } + } + return fileName; + } + + private static String getStandardLangName(Context ctx, String filename) { + if (filename.equals("Croatian")) { + return ctx.getString(R.string.lang_hr); + } else if (filename.equals("Chinese")) { + return ctx.getString(R.string.lang_zh); + } else if (filename.equals("Portuguese")) { + return ctx.getString(R.string.lang_pt_br); + } else if (filename.equals("English")) { + return ctx.getString(R.string.lang_en); + } else if (filename.equals("Afrikaans") || filename.equals("Africaans")) { + return ctx.getString(R.string.lang_af); + } else if (filename.equals("Armenian")) { + return ctx.getString(R.string.lang_hy); + } else if (filename.equals("Basque")) { + return ctx.getString(R.string.lang_eu); + } else if (filename.equals("Belarusian")) { + return ctx.getString(R.string.lang_be); + } else if (filename.equals("Bosnian")) { + return ctx.getString(R.string.lang_bs); + } else if (filename.equals("Bulgarian")) { + return ctx.getString(R.string.lang_bg); + } else if (filename.equals("Catalan")) { + return ctx.getString(R.string.lang_ca); + } else if (filename.equals("Czech")) { + return ctx.getString(R.string.lang_cs); + } else if (filename.equals("Danish")) { + return ctx.getString(R.string.lang_da); + } else if (filename.equals("Dutch")) { + return ctx.getString(R.string.lang_nl); + } else if (filename.equals("Finnish")) { + return ctx.getString(R.string.lang_fi); + } else if (filename.equals("French")) { + return ctx.getString(R.string.lang_fr); + } else if (filename.equals("Georgian")) { + return ctx.getString(R.string.lang_ka); + } else if (filename.equals("German")) { + return ctx.getString(R.string.lang_de); + } else if (filename.equals("Greek")) { + return ctx.getString(R.string.lang_el); + } else if (filename.equals("Hebrew")) { + return ctx.getString(R.string.lang_iw); + } else if (filename.equals("Hindi")) { + return ctx.getString(R.string.lang_hi); + } else if (filename.equals("Hungarian")) { + return ctx.getString(R.string.lang_hu); + } else if (filename.equals("Indonesian")) { + return ctx.getString(R.string.lang_id); + } else if (filename.equals("Italian")) { + return ctx.getString(R.string.lang_it); + } else if (filename.equals("Japanese")) { + return ctx.getString(R.string.lang_ja); + } else if (filename.equals("Korean")) { + return ctx.getString(R.string.lang_ko); + } else if (filename.equals("Latvian")) { + return ctx.getString(R.string.lang_lv); + } else if (filename.equals("Lithuanian")) { + return ctx.getString(R.string.lang_lt); + } else if (filename.equals("Marathi")) { + return ctx.getString(R.string.lang_mr); + } else if (filename.equals("Norwegian")) { + return ctx.getString(R.string.lang_no); + } else if (filename.equals("Polish")) { + return ctx.getString(R.string.lang_pl); + } else if (filename.equals("Portuguese")) { + return ctx.getString(R.string.lang_pt); + } else if (filename.equals("Romanian")) { + return ctx.getString(R.string.lang_ro); + } else if (filename.equals("Russian")) { + return ctx.getString(R.string.lang_ru); + } else if (filename.equals("Slovak")) { + return ctx.getString(R.string.lang_sk); + } else if (filename.equals("Slovenian")) { + return ctx.getString(R.string.lang_sl); + } else if (filename.equals("Spanish")) { + return ctx.getString(R.string.lang_es); + } else if (filename.equals("Swedish")) { + return ctx.getString(R.string.lang_sv); + } else if (filename.equals("Turkish")) { + return ctx.getString(R.string.lang_tr); + } else if (filename.equals("Ukrainian")) { + return ctx.getString(R.string.lang_uk); + } else if (filename.equals("Vietnamese")) { + return ctx.getString(R.string.lang_vi); + } else if (filename.equals("Welsh")) { + return ctx.getString(R.string.lang_cy); + } + return null; + } + + private static String getStandardMapName(Context ctx, String basename) { + if (basename.equals("world-ski")) { + return ctx.getString(R.string.index_item_world_ski); + } else if (basename.equals("world_altitude_correction_ww15mgh")) { + return ctx.getString(R.string.index_item_world_altitude_correction); + } else if (basename.equals("world_basemap")) { + return ctx.getString(R.string.index_item_world_basemap); + } else if (basename.equals("world_bitcoin_payments")) { + return ctx.getString(R.string.index_item_world_bitcoin_payments); + } else if (basename.equals("world_seamarks")) { + return ctx.getString(R.string.index_item_world_seamarks); + } + return null; + } +} From 2c70301b844a14b3bc705eb6346ed4470b022212 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Jul 2014 20:03:52 +0300 Subject: [PATCH 09/18] Refactored translation functionality. --- .../plus/download/DownloadActivityType.java | 17 +---------------- .../plus/helpers/FileNameTranslationHelper.java | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java index d0e6bea0dd..d58f50971f 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java @@ -204,7 +204,7 @@ public class DownloadActivityType { } final String bn = getBasename(indexItem); final String lc = bn.toLowerCase(); - String std = getStandardMapName(ctx, lc); + String std = FileNameTranslationHelper.getStandardMapName(ctx, lc); if (std != null) { return std; } @@ -218,21 +218,6 @@ public class DownloadActivityType { return osmandRegions.getLocaleName(bn); } - private String getStandardMapName(Context ctx, String basename) { - if(basename.equals("world-ski")) { - return ctx.getString(R.string.index_item_world_ski); - } else if(basename.equals("world_altitude_correction_ww15mgh")) { - return ctx.getString(R.string.index_item_world_altitude_correction); - } else if(basename.equals("world_basemap")) { - return ctx.getString(R.string.index_item_world_basemap); - } else if(basename.equals("world_bitcoin_payments")) { - return ctx.getString(R.string.index_item_world_bitcoin_payments); - } else if(basename.equals("world_seamarks")) { - return ctx.getString(R.string.index_item_world_seamarks); - } - return null; - } - public String getTargetFileName(IndexItem item) { String fileName = item.fileName; // if(fileName.endsWith(IndexConstants.VOICE_INDEX_EXT_ZIP) || diff --git a/OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java b/OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java index 1a4ce0e3f3..7f9f1eba0c 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java @@ -178,7 +178,7 @@ public class FileNameTranslationHelper { return null; } - private static String getStandardMapName(Context ctx, String basename) { + public static String getStandardMapName(Context ctx, String basename) { if (basename.equals("world-ski")) { return ctx.getString(R.string.index_item_world_ski); } else if (basename.equals("world_altitude_correction_ww15mgh")) { From a96c2deae725a1739088e4f7362f1b90a9bde535 Mon Sep 17 00:00:00 2001 From: Viktar Palstsiuk Date: Mon, 7 Jul 2014 19:07:47 +0200 Subject: [PATCH 10/18] Translated using Weblate (Belarusian) Currently translated at 99.9% (1439 of 1440 strings) --- OsmAnd/res/values-be/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index 5bd14b816c..dea2e98cf3 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -1871,4 +1871,6 @@ OsmAnd мае адкрыты зыходны код і актыўна разві Аўтаматычнае падлучэньне Служба OsMo Загружаны %1$s сьлед OsMo. + Уваход па запрашэньнi + Калі ласка, прачытайце перад стварэньнем групы! From 34c206c64bc449db3ab505572fd879c14a4b929e Mon Sep 17 00:00:00 2001 From: josep constanti Date: Mon, 7 Jul 2014 08:10:46 +0200 Subject: [PATCH 11/18] Translated using Weblate (Catalan) Currently translated at 100.0% (1440 of 1440 strings) --- OsmAnd/res/values-ca/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml index a125027c9d..f3b8779243 100644 --- a/OsmAnd/res/values-ca/strings.xml +++ b/OsmAnd/res/values-ca/strings.xml @@ -1875,6 +1875,6 @@ La llista de països inclosos (bàsicament tot el món!): Afganistan, Albània, Traça OsMo %1$s descarregada. Inici sessió OsMo erroni Entreu per convidar - " - Tots els grups creats són públics! Si es vol ser anònim, connecteu directament els aparells via identificació de Tracker.\n - Dins el grup es poden registrar fins un màxim de 16 persones.\n - Cas d\'inactivitat o d\'activitat d\'una sola persona durant 2 setmanes, el grup serà esborrat.\n - Es pot restringir l\'entrada al grup, a només per invitació, però per controlar el grup es necessitarà accedir a la consola d\'administració.\n - Si us cal crear un grup, però amb altres condicions, contacteu http://osmo.mobi" + " - Tots els grups creats són públics! Si es vol ser anònim, afegiu directament els aparells via identificació de Tracker.\n - Dins el grup es poden registrar fins un màxim de 16 persones.\n - Cas d\'inactivitat o d\'activitat d\'una sola persona durant 2 setmanes, el grup serà esborrat.\n - Es pot restringir l\'entrada al grup, a només per invitació, però per controlar el grup es necessitarà accedir a la consola d\'administració.\n - Si us cal crear un grup, però amb altres condicions, contacteu http://osmo.mobi" Si us plau, llegiu abans de crear un grup! From 775e84d50ea3dfcd993459a834a85121670411a1 Mon Sep 17 00:00:00 2001 From: Ludek M Date: Mon, 7 Jul 2014 08:36:08 +0200 Subject: [PATCH 12/18] Translated using Weblate (Czech) Currently translated at 99.0% (1426 of 1440 strings) --- OsmAnd/res/values-cs/strings.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml index 9f2887f1e9..d696afda67 100644 --- a/OsmAnd/res/values-cs/strings.xml +++ b/OsmAnd/res/values-cs/strings.xml @@ -1599,7 +1599,7 @@ s často kladenými otázkami. Aktuální čas Spustit navigaci se zpožděním vybrané - Vyberte interval na rozdělení + Rozdělit interval Podtrasy: %1$s Bodů na trase: %1$s Vzdálenost: %1$s (%2$s bodů) @@ -1628,4 +1628,9 @@ s často kladenými otázkami. Online OSM mapová klasifikace s obrázky Zobrazit tlačítka lupy během navigace Zobrazit tlačítka lupy + Třídit podle vzdálenosti + Třídit podle jména + Zobrazit na mapě + Vybrat k zobrazení + Odznačit From 027be1d30f5bf2c500b049dfc83f810aef737516 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Mon, 7 Jul 2014 07:17:35 +0200 Subject: [PATCH 13/18] Translated using Weblate (Danish) Currently translated at 100.0% (1440 of 1440 strings) --- OsmAnd/res/values-da/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index dec7c661d1..1555250fac 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -1907,7 +1907,7 @@ Afghanistan, Albanien, Algeriet, Andorra, Angola, Anguilla, Antigua og Barbuda, OsMo tjeneste OsMo spor %1$s hentet. OsMo logind mislykkedes - "Læs dette før du opretter en gruppe!" - Indtast ved invitere - " -Alle grupper oprettet er offentlige! Hvis du ønsker at være anonym, tilslutte enheder direkte via Tracker-id\'er.\n -Gruppen kunne registreres op til 16 personer.\n -I tilfælde af inaktivitet eller kun 1 person aktivitet i 2 uger, vil gruppen blive slettet.\n -Du kan begrænse gruppe indgangen, som kun invitere, men at kontrolgruppen skal du gå til administrationskonsol.\n -Hvis du har brug at oprette en gruppe, men med andre betingelser, bedes du kontakte http://osmo.mobi" + Læs dette før du opretter en gruppe! + Tilslut med invitation + " -Alle grupper der oprettes er offentlige! Hvis de skal være anonyme, tilsluttes enheder direkte via sporings-id\'er.\n -Op til 16 personer kan registreres i gruppen.\n -I tilfælde af inaktivitet eller aktivitet af kun 1 person i 2 uger, vil gruppen blive slettet.\n -Du kan begrænse adgangen til gruppen, til kun med invitation, men for at kontrollere gruppen skal man bruge administrationskonsollen.\n -Hvis du har brug at oprette en gruppe, men med andre betingelser, kontakt http://osmo.mobi" From 2b976cc91763f2a557e32392db50c9fd21b95a82 Mon Sep 17 00:00:00 2001 From: Leif Larsson Date: Mon, 7 Jul 2014 05:17:00 +0200 Subject: [PATCH 14/18] Translated using Weblate (Swedish) Currently translated at 99.3% (1431 of 1440 strings) --- OsmAnd/res/values-sv/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/res/values-sv/strings.xml b/OsmAnd/res/values-sv/strings.xml index 8b9469fa3e..2d129fee2b 100644 --- a/OsmAnd/res/values-sv/strings.xml +++ b/OsmAnd/res/values-sv/strings.xml @@ -1607,4 +1607,7 @@ OsMo-spår %1$s nedladdat. "Kartkälla och kartlager som ska visas ändras via \'Meny\' → \'Kartlager\'.\n\nUnder \'Kartkälla...\' kan du välja mellan de förladdade offline vektorkartorna (standard, krävs också för offline-navigering), eller fördefinierade (online eller cachade offline) kartbitskällor (aktivera insticksmodulen \'Online-kartor\' under \'Inställningar\'→ \'Plugin\' för detta), eller kartor skapade manuellt med t.ex. OsmaAndMapCreator på en PC.\n\nOsmAnd stöder också egna källor. " Inloggningen till OsMo misslyckades + Anslut via inbjudan + " - Alla skapade grupper är offentliga! Om du vill vara anonym, anslut enheter direkt via Tracker-id-\n- Upp till 16 personer kan vara registrerade i gruppen.\n- Grupper tas bort i fall av inaktivitet eller aktivitet av endast 1 person på 2 veckor.\n- Du kan begränsa inträde i grupp men för att kontrollera gruppen måste du gå till adminkonsollen.\n- Om du behöver skapa en grupp, men i övrigt kontakta http://osmo.mobi" + Läs detta innan du skapar en grupp! From 2a947ca768ef26a3528e65ebcfa79ae9bfb7b3f1 Mon Sep 17 00:00:00 2001 From: ezjerry liao Date: Mon, 7 Jul 2014 04:34:39 +0200 Subject: [PATCH 15/18] Translated using Weblate (Traditional Chinese) Currently translated at 100.0% (1440 of 1440 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index ee7b777cd0..f126f810cf 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -1886,7 +1886,7 @@ OsmAnd 是開放原始碼,而且正在積極的開發。應用程式從報告 OsMo 服務 OsMo 軌跡 %1$s 已下載。 輸入邀請 - " - 所有建立的群組都是公開的!如果您希望匿名,直接用連接裝置追蹤 IDS 。\n - 群組可以註冊多達16人。\n - 假使閒置或僅一人於二個星期裡活動,那群組將會被刪除。\n - 因為只能靠邀請,您可以限制群組的進入,但要控管群組您需要去管理主控台。\n - 如果您需要建立一個群組,但是具有其它條件,請連絡 http://osmo.mobi" + " - 所有建立的群組都是公開的!如果您希望匿名,透過追蹤 IDS 直接連接裝置。\n - 群組可以註冊多達16人。\n - 假使閒置或僅一人於二個星期裡活動,那群組將會被刪除。\n - 因為只能靠邀請,您可以限制群組的進入,但要控管群組您需要去管理主控台。\n - 如果您需要建立一個群組,但是具有其它條件,請連絡 http://osmo.mobi" 請在建立群組之前,仔細閱讀! OsMo 登入失敗 From 57d6902fe3c3c6981cc5c948da4fc28874410a22 Mon Sep 17 00:00:00 2001 From: Viktar Palstsiuk Date: Mon, 7 Jul 2014 19:35:13 +0200 Subject: [PATCH 16/18] Translated using Weblate (Belarusian) Currently translated at 100.0% (1440 of 1440 strings) --- OsmAnd/res/values-be/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index dea2e98cf3..3e97e55959 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -1873,4 +1873,9 @@ OsmAnd мае адкрыты зыходны код і актыўна разві Загружаны %1$s сьлед OsMo. Уваход па запрашэньнi Калі ласка, прачытайце перад стварэньнем групы! + " - Усе створаныя групы з\\\'яўляюцца алульнымі! Калі вы хочаце заставацца ананімным, падлучайце прыладу наўпрост праз Tracker-ідэнтыфікатар. +\n - Група мажа быць зарэгістраваная на 16 чалавек. +\n - У выпадку бяздзейнасці або актыўнасці толькі 1 чалавека на працягу 2 тыдняў, група будзе выдаленая. +\n - Вы можаце абмежаваць ўваход у групу, напррыклад па запрашэнні, але для кантрольню групай, вам неабходна скарыстацца кансольлю адміністратара. +\n - Калі вам трэба стварыць групу з іншымі ўмовамі, калі ласка, звяртайцеся на http://osmo.mobi" From 78927224140b862d4dfab3c3d487167b8ad74716 Mon Sep 17 00:00:00 2001 From: reza khan Date: Mon, 7 Jul 2014 21:30:54 +0200 Subject: [PATCH 17/18] Translated using Weblate (Persian) Currently translated at 100.0% (1440 of 1440 strings) --- OsmAnd/res/values-fa/strings.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml index 9f77588321..12b6c86fd7 100644 --- a/OsmAnd/res/values-fa/strings.xml +++ b/OsmAnd/res/values-fa/strings.xml @@ -1877,4 +1877,18 @@ OsmAnd منبع باز است و فعالانه در حال توسعه است. هیچ فایل GPX انتخاب نشده است. جهت انتخاب فشار دهید و نگه دارید در مسیر در دسترس. لغو برای نمایش انتخاب کنید + ورود با دعوت + " - تمامی گروه های ایجاد شده عمومی می باشد! اگر می خواهید به صورت ناشناس وارد شوید، باید دستگاه را به طور مستقیم از طریق شناسه های آنلاین متصل نمایید. ↵ +\n  - گروه را می توان با 16 نفر ثبت کرد ↵. +\n  - در صورت عدم فعالیت و یا تنها فعالیت 1 نفر به مدت 2 هفته، گروه حذف خواهد شد ↵. +\n  - شما می توانید عضویت در گروه را تنها توسط دعوت محدود نمایید ، اما برای این کار نیاز به تغییر تنظیمات کنترل دارد ↵. +\n  - اگر شما نیاز به ایجاد یک گروه دارید، با شرایط ما آشنا شوید http://osmo.mobi" + لطفا قبل از ایجاد گروه مطالع نمایید! + OsMo ورود شکست خورد + OsMo نقاط %1$s دانلود شده. + اتصال به صورت خودکار پس از راه اندازی نرم افزار + اتصال خودکار + سرویس OsMo + OsMo مسیر %1$s دانلود نمایید. + هیچ چیز برای دانلود وجود ندارد، لطفا اتصال به اینترنت را بررسی نمایید. From 1dfc155cfd6c4f076685a234f716e883074da71b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Michalski?= Date: Tue, 8 Jul 2014 01:53:09 +0200 Subject: [PATCH 18/18] Translated using Weblate (Polish) Currently translated at 100.0% (1440 of 1440 strings) --- OsmAnd/res/values-pl/strings.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index 8542e7d650..f4e3060ea3 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -1834,7 +1834,7 @@ Afganistan, Afryka Południowa, Albania, Algieria, Andora, Angola, Anguilla, Ant %1$s \nTrasa %2$s Zapisywanie bieżącej trasy \n\nNaciśnij i przytrzymaj, aby zobaczyć na mapie - Rozpocznij nawigację z opóźnieniem + Rozpocznij nawigację automatycznie wybrano Interwał podziału Ładowanie %1$s … @@ -1851,4 +1851,14 @@ Afganistan, Afryka Południowa, Albania, Algieria, Andora, Angola, Anguilla, Ant Nie wybrano żadnych plików GPX. W celu wyboru naciśnij i przytrzymaj dostępną ścieżkę. Odznacz Wybierz aby wyświetlić + Wpisz przez zaproszenie + " - Wszystkie grupy są publiczne! Jeśli chcesz być anonimowy, podłącz urządzeń bezpośrednio poprzez identyfikator Tracker ids.↵\n - Grupa może posiadać do 16 zarejestrowanych osób.↵\n - W przypadku bezczynności lub aktywności tylko 1 osoby przez okres 2 tygodnie, grupa zostanie usunięta.↵\n - Można ograniczyć dostęp grupy, i zapraszać tylko wybrane osoby. Do kontroli potrzebujesz konsoli administracyjnej.↵\n - Jeśli trzeba utworzyć grupę, ale z innymi warunkami, prosimy o kontakt http://osmo.mobi" + Proszę przeczytać przed założeniem grupy! + Nie powiodło się logowanie do OsMo + OsMo pobrano %1$s punktów. + Automatycznie połącz to serwisu po uruchomieniu aplikacji + Auto-podłączenie + Serwis OsMo + Pobrano %1$s ścieżek OsMo. + Brak danych do pobrania, proszę sprawdź połączenie internetowe.