Skip to content

Commit

Permalink
Merge branch 'osmandapp:master' into hardy_Afa
Browse files Browse the repository at this point in the history
sonora authored Jan 13, 2025
2 parents e26160b + 9abdd7e commit eaefeed
Showing 60 changed files with 195 additions and 200 deletions.
1 change: 1 addition & 0 deletions OsmAnd-java/src/main/java/net/osmand/gpx/GpxParameter.java
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ public enum GpxParameter {
START_TIME("startTime", "bigint", Long.class, Long.MAX_VALUE, true),
END_TIME("endTime", "bigint", Long.class, Long.MIN_VALUE, true),
TIME_SPAN("timeSpan", "bigint", Long.class, 0L, true),
EXPECTED_DURATION("expectedDuration", "bigint", Long.class, 0L, true),
TIME_MOVING("timeMoving", "bigint", Long.class, 0L, true),
TOTAL_DISTANCE_MOVING("totalDistanceMoving", "double", Double.class, 0d, true),
DIFF_ELEVATION_UP("diffElevationUp", "double", Double.class, 0d, true),
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ class GpxDatabase {
companion object {
val log = LoggerFactory.getLogger("GpxDatabase")

const val DB_VERSION = 29
const val DB_VERSION = 30
const val DB_NAME = "gpx_database"
const val GPX_TABLE_NAME = "gpxTable"
const val GPX_DIR_TABLE_NAME = "gpxDirTable"
Original file line number Diff line number Diff line change
@@ -98,6 +98,7 @@ object GpxDbUtils {
addIfMissingGpxTableColumn(columnNames, db, START_TIME);
addIfMissingGpxTableColumn(columnNames, db, END_TIME);
addIfMissingGpxTableColumn(columnNames, db, TIME_SPAN);
addIfMissingGpxTableColumn(columnNames, db, EXPECTED_DURATION);
addIfMissingGpxTableColumn(columnNames, db, TIME_MOVING);
addIfMissingGpxTableColumn(columnNames, db, TOTAL_DISTANCE_MOVING);
addIfMissingGpxTableColumn(columnNames, db, DIFF_ELEVATION_UP);
Original file line number Diff line number Diff line change
@@ -493,11 +493,12 @@ class GpxFile : GpxExtensions {
for (track in tracks) {
val trackColor = track.getColor(getColor(0))
for (segment in track.segments) {
val segmentColor = segment.getColor(trackColor)
if (!segment.generalSegment && segment.points.isNotEmpty()) {
val ts = TrkSegment()
tpoints.add(ts)
ts.points.addAll(segment.points)
ts.setColor(trackColor)
ts.setColor(segmentColor)
}
}
}
@@ -797,7 +798,7 @@ class GpxFile : GpxExtensions {
trkSegments.add(cloneTrkSegment(segment))
}
dest.segments = trkSegments
copyExtensions(source)
dest.copyExtensions(source)
return dest
}

@@ -810,7 +811,7 @@ class GpxFile : GpxExtensions {
points.add(WptPt(point))
}
dest.points = points
copyExtensions(source)
dest.copyExtensions(source)
return dest
}

@@ -844,7 +845,7 @@ class GpxFile : GpxExtensions {
routeTypes.add(cloneRouteType(rt))
}
dest.routeTypes = routeTypes
copyExtensions(source)
dest.copyExtensions(source)
return dest
}

Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ enum class GpxParameter(
START_TIME("startTime", "bigint", Long::class, Long.MAX_VALUE, true),
END_TIME("endTime", "bigint", Long::class, Long.MIN_VALUE, true),
TIME_SPAN("timeSpan", "bigint", Long::class, 0L, true),
EXPECTED_DURATION("expectedDuration", "bigint", Long::class, 0L, true),
TIME_MOVING("timeMoving", "bigint", Long::class, 0L, true),
TOTAL_DISTANCE_MOVING("totalDistanceMoving", "double", Double::class, 0.0, true),
DIFF_ELEVATION_UP("diffElevationUp", "double", Double::class, 0.0, true),
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@ class GpxTrackAnalysis {
var name: String? = null
var totalDistanceWithoutGaps = 0f
var timeSpanWithoutGaps: Long = 0
var expectedRouteDuration: Long = 0
var timeMovingWithoutGaps: Long = 0
var totalDistanceMovingWithoutGaps = 0f

@@ -73,6 +72,10 @@ class GpxTrackAnalysis {
get() = getGpxParameter(GpxParameter.TIME_SPAN) as Long
set(value) = setGpxParameter(GpxParameter.TIME_SPAN, value)

var expectedRouteDuration: Long
get() = getGpxParameter(GpxParameter.EXPECTED_DURATION) as Long
set(value) = setGpxParameter(GpxParameter.EXPECTED_DURATION, value)

var timeMoving: Long
get() = getGpxParameter(GpxParameter.TIME_MOVING) as Long
set(value) = setGpxParameter(GpxParameter.TIME_MOVING, value)
63 changes: 51 additions & 12 deletions OsmAnd/build-common.gradle
Original file line number Diff line number Diff line change
@@ -115,23 +115,62 @@ clean.doFirst {
}
}

tasks.register('validateTranslate') {
tasks.register('validateTranslations') {
println "Validating translations"
def taskStartTime = System.currentTimeMillis()

file("res").eachFileRecurse groovy.io.FileType.FILES, {
if (it.name == "strings.xml" || it.name == "phrases.xml") {
it.eachLine { line ->
if (line.contains("\$ s") || line.contains("\$ d") || line.contains("\$ f") ||
line.contains(" \$s") || line.contains(" \$d") || line.contains(" \$f") ||
line.contains("1\$ ") || line.contains("2\$ ") || line.contains("3\$ ") ||
line.contains("%1s") || line.contains(" 1\$s") ||
(line.contains("% \$") || line.contains("% 1") || line.contains("% 2") ||
line.contains("% 3") || line.contains("% s"))) {
throw new GradleException("Incorrect translation " + it.getAbsolutePath() + " " + line)
def pattern = /%(\d+\$)?[sSdD]/
def files = ["strings.xml", "phrases.xml"]
def defaultPlaceholders = [:]
def parser = new XmlParser()

def normalizePlaceholders = { placeholders -> placeholders.collect { it.toLowerCase() }.toSet() }

files.each { fileName ->
def file = new File(file("res/values"), fileName)
if (file.exists()) {
parser.parse(file).string.each { node ->
def placeholders = (node.text() ?: "").findAll(pattern)
defaultPlaceholders[node.@name] = normalizePlaceholders(placeholders)
}
} else {
println "Skipping missing default file: ${file.path}"
}
}

def issues = []
def directories = file("res").listFiles().findAll {
it.isDirectory() && it.name.startsWith("values-")
}

directories.each { dir ->
files.each { fileName ->
def file = new File(dir, fileName)
if (file.exists()) {
def placeholders = [:]
parser.parse(file).string.each { node ->
def translationPlaceholders = (node.text() ?: "").findAll(pattern)
placeholders[node.@name] = normalizePlaceholders(translationPlaceholders)
}

defaultPlaceholders.each { key, defaultValues ->
if (placeholders.containsKey(key)) {
def translationValues = placeholders[key]
if (defaultValues != translationValues) {
issues << "Mismatch in ${file.path}: '${key}' -> Default: ${defaultValues}, Translation: ${translationValues}"
}
}
}
}
}
}

if (!issues.isEmpty()) {
issues.each { println "ERROR: $it" }
throw new GradleException("Translation validation failed with ${issues.size()} issue(s).")
}
def validationEndTime = System.currentTimeMillis()
println "Translations validated in ${(validationEndTime - taskStartTime)} ms"
}

tasks.register('downloadWorldMiniBasemap', Download) {
@@ -257,7 +296,7 @@ tasks.register('collectExternalResources') {
copyMapShaderIcons,
copyMapPOIIcons,
copyLargePOIIcons,
validateTranslate,
validateTranslations,
copyBundledAssets,
copyProjDb,
copyColorPalettes,
2 changes: 0 additions & 2 deletions OsmAnd/res/values-af/strings.xml
Original file line number Diff line number Diff line change
@@ -82,7 +82,6 @@
<string name="plugins_screen">Inlasmodule bestuurder</string>
<string name="prefs_plugins_descr">Inlasmodule aktiveer die gevorderde instellings en voorsien ekstra funksionaliteit</string>
<string name="prefs_plugins">Inlasmodule bestuurder</string>
<string name="osm_editing_plugin_description">Wys stellings nodig vir OSM terugvoer bv. versamel / aanpas van OSM POI voorwerpe, oopmaak / komentaarlewer op OSM foute, en bydra van opgeneemde GPX dokumente (vereis OSM inlog besonderhede).</string>
<string name="vector_maps_may_display_faster_on_some_devices">Vektor kaarte vertoon waarskynlik vinniger. Dit mag egter nie goed werk op sommige toestelle nie.</string>
<string name="play_commands_of_currently_selected_voice">Speel opdragte van die huidige gekose stem</string>
<string name="debugging_and_development">OsmAnd ontwikkeling</string>
@@ -879,7 +878,6 @@
<string name="safe_mode_description">gebruik die toepassing in beskermde wyse (gebruik stadiger Android in plaas van inheemse kode).</string>
<string name="safe_mode">Beskermde wyse</string>
<string name="native_library_not_running">Die toepassing werk in beskermde wyse (skakel dit af in Instellings).</string>
<string name="srtm_plugin_description">Vergemoontlik dei aflaai van aflyn kontoerlyne en heuwelsakdus (\'Instellings\'-&gt; \'Inligtingsbestuur\' -&gt; \'Aflaai\' -&gt; Kies verlangde kaart-tipe).</string>
<string name="route_descr_lat_lon">Breedtegraad %1$.3f, lengtegraad %2$.3f</string>
<string name="background_service_is_enabled_question">OsmAnd slaapwyse diens is nog aan. Wil jy dit afskakel?</string>
<string name="support_new_features_descr">Maak donasies om die implementering van nuwe funksies in die toepassing moontlik te maak</string>
1 change: 0 additions & 1 deletion OsmAnd/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
@@ -5793,7 +5793,6 @@
<string name="connect_obd_instructions_step1">قم بتوصيل الماسح الضوئي بمنفذ OBD-II الموجود في سيارتك.</string>
<string name="connect_obd_instructions_step2">قم بتشغيل محرك سيارتك</string>
<string name="connect_obd_instructions_step3">قم بتمكين البلوتوث على جهازك</string>
<string name="connect_obd_instructions_step4">انقر فوق \"اتصال\"، ثم حدد الماسح الضوئي الخاص بك من القائمة.</string>
<string name="learn_more_about_obd_sensors">تعرف على المزيد حول أجهزة الاستشعار.</string>
<string name="obd_fuel_left_liters">الوقود المتبقي (لتر)</string>
<string name="background_opacity">خلفية معتمة</string>
8 changes: 0 additions & 8 deletions OsmAnd/res/values-ast/strings.xml
Original file line number Diff line number Diff line change
@@ -2376,13 +2376,11 @@
<string name="back_to_map">Back to map</string>
<string name="days_behind">days behind</string>
<string name="osmand_development_plugin_description">Los axustes pal desendolcu y pa la depuración de carauterístiques como la simulación de la navegación, el rindimientu de la renderización o los avisos per voz. Esti plugin ta diseñáu pa desendolcadores, nun se precisa pa l\'usu normal de l\'aplicación.</string>
<string name="osm_editing_plugin_description">Make OSM contributions like creating or modifying OSM POI objects, opening or commenting OSM notes, and contributing recorded GPX files in OsmAnd by supplying your username and password. OpenStreetMap.org is a community driven, global public domain mapping project.</string>
<string name="osmand_accessibility_description">Fai que les carauterístiques d\'accesibilidá del preséu tean disponibles direutamente n\'OsmAnd. Acencella, por exemplu y ente otres munches opciones, la configuración de les voces p\'anunciar automáticamente la to posición.</string>
<string name="osmand_distance_planning_plugin_description">Create paths by tapping the map, or by using or modifying existing GPX files, to plan a trip and measure the distance between points. The result can be saved as a GPX file to use later for guidance.</string>
<string name="osmand_distance_planning_plugin_name">Distance calculator and planning tool</string>
<string name="audionotes_plugin_description">Make audio/photo/video notes during a trip, using either a map button or location context menu.</string>
<string name="plugin_ski_descr">This plugin for OsmAnd puts at your fingertips details of global downhill ski slopes, cross country ski runs, Alpine ski routes, cable cars and ski lifts. Routes and pistes are shown color-coded by difficulty, and depicted in a special \'Winter\' map style which assimilates a snow-colored winter landscape. \n \nActivating this view changes the map style to \'Winter and ski\', showing all landscape features under wintry conditions. This view can be reverted by either de-activating it again here, or by changing the \'Map style\' under \'Configure map\' as desired.</string>
<string name="plugin_nautical_descr">This plugin enriches the OsmAnd map and navigation app to also produce nautical maps for boating, sailing, and other types of watersports. \n \nA special map add-on for OsmAnd will provide all nautical navigation marks and chart symbols, for inland as well as for nearshore navigation. The description of each navigation mark provides the details needed to identify them and their meaning (category, shape, color, sequence, reference, etc.). \n \nTo return to one of OsmAnd\'s conventional map styles, simply either de-activate this plugin again, or change the \'Map style\' under \'Configure map\' as desired.</string>
<string name="plugin_touringview_descr">Activating this view changes OsmAnd\'s map style to \'Touring view\', this is a special high-detail view for travelers and professional drivers.
\n
\nThis view provides, at any given map zoom, the maximum amount of travel details available in the map data (particularly roads, tracks, paths, and orientation marks).
@@ -2395,15 +2393,9 @@
\n
\nThis view can be reverted by either de-activating it again here, or by changing the \'Map style\' under \'Configure map\' as desired.</string>
<string name="plugin_touringview_name">Touring map view</string>
<string name="srtm_plugin_description">This plugin provides both a contour line overlay and a (relief) hillshade layer to be displayed on top of OsmAnd\'s standard maps. This functionality will be much appreciated by athletes, hikers, trekkers, and anybody interested in the relief structure of a landscape. (Please note that contour line and/or relief data are separate, additional downloads available after activating the plugin.)
\n
\nThe global data (between 70 ° north and 70 ° south) is based on measurements by SRTM (Shuttle Radar Topography Mission) and ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), an imaging instrument onboard Terra, the flagship satellite of NASA\'s Earth Observing System. ASTER is a cooperative effort between NASA, Japan\'s Ministry of Economy, Trade and Industry (METI), and Japan Space Systems (J-spacesystems).</string>
<string name="srtm_plugin_name">Contour lines</string>
<string name="osmand_srtm_short_description_80_chars">OsmAnd plugin for offline contour lines</string>
<string name="srtm_paid_version_title">Contour lines plugin</string>
<string name="record_plugin_description">This plugin activates the functionality to record and save your tracks by manually touching the GPX logging widget on the map, or also to automatically log all of your navigation routes to a GPX file.
\n
\n Recorded tracks can be shared with your friends or be used for OSM contributions. Athletes can use recorded tracks to monitor their trainings. Some basic track analysis can be performed directly in OsmAnd, like lap times, average speed etc., and tracks can of course also later be analyzed in special 3rd party analysis tools.</string>
<string name="osmand_rastermaps_plugin_description">Access many types of online (so called tile or raster) maps, from predefined OSM tiles (like Mapnik) to satellite images, and special purpose layers like weather maps, climate maps, geological maps, hillshade layers, etc.
\n
\n Any of these maps can either be used as the main (base) map to be displayed, or as an overlay or underlay to another base map (like OsmAnd\'s standard offline maps). Certain elements of the OsmAnd vector maps can be hidden via the \'Configure map\' menu to make any underlay map more visible.
6 changes: 0 additions & 6 deletions OsmAnd/res/values-az/strings.xml
Original file line number Diff line number Diff line change
@@ -3145,15 +3145,9 @@
<string name="shared_string_hillshade">Təpə kölgəsi</string>
<string name="hillshade_download_description">Xəritədə təpə kölgəsinə baxmaq üçün əlavə xəritələr lazımdır.</string>
<string name="audionotes_plugin_description">Səfər zamanı ya xəritə düyməsi ya da məkan kontekst menyusundan istifadə edərək səs/şəkil/video qeydlər yaradın.</string>
<string name="srtm_plugin_description">Bu qoşma OsmAnd-ın standart xəritələrinin üzərində həm kontur xəttinin, həm də (relyef) təpə kölgəsi örtüyünün göstərilməsini təmin edir. Bu funksionallıq idmançılar, piyada gəzənlər, səyahətçilər və landşaftın relyef quruluşu ilə maraqlanan hər kəs tərəfindən yüksək qiymətləndiriləcək. (Nəzərə alın ki, kontur xətti və/yaxud relyef məlumatları ayrıdır, qoşmanı aktivləşdirdikdən sonra əlavə endirmələr mümkündür.)
\n
\nQlobal məlumatlar (70° şimal və 70° cənub arasında) SRTM (Shuttle Radar Topography Mission) və NASA-nın Yer Müşahidə Sisteminin qabaqcıl peyki olan Terra-nın göyərtəsində təsvir aləti olan ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer) tərəfindən ölçmələrə əsaslanır. ASTER – NASA, Yaponiyanın İqtisadiyyat, Ticarət və Sənaye Nazirliyi (METI) və Yaponiya Kosmik Sistemləri (J-spacesystems) arasında ortaq işdir.</string>
<string name="hillshade_menu_download_descr">Şaquli kölgələri göstərmək üçün “Təpə kölgəsi” örtük xəritəsini endirin.</string>
<string name="layer_hillshade">Təpə kölgəsi qatı</string>
<string name="hillshade_layer_disabled">Təpə kölgəsi qatı sönülüdür</string>
<string name="record_plugin_description">Bu qoşma xəritədə GPX qeydetmə vidcetinə əl ilə toxunmaqla izlərinizi qeyd etmək və saxlamaq, həmçinin bütün naviqasiya marşrutlarınızı avtomatik olaraq GPX faylına qeyd etmək funksiyasını aktivləşdirir.
\n
\nQeyd edilmiş izlər dostlarınızla paylaşıla və ya OSM töhfələri üçün istifadə edilə bilər. İdmançılar məşqlərinə nəzarət etmək üçün qeyd edilmiş izlərdən istifadə edə bilərlər. Dövrə vaxtları, orta sürət və s. kimi bəzi əsas iz analizləri birbaşa OsmAnd-da həyata keçirilə bilər və əlbəttə ki, daha sonra izlər xüsusi 3-cü tərəf analiz alətlərində də təhlil edilə bilər.</string>
<string name="download_hillshade_maps">Təpə kölgələri</string>
<string name="terrain_empty_state_text">Xəritədə təpə kölgələrini və ya yamacları göstərir. Saytımızda bu xəritə növləri haqqında daha ətraflı oxuyun.</string>
<string name="shared_string_open_street_map">OpenStreetMap</string>
Loading

0 comments on commit eaefeed

Please sign in to comment.