Compare commits

..

1 Commits

Author SHA1 Message Date
Jean-Baptiste
ee1febdcad [doc] Update translations doc to explain how to enable new language on Android
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2026-01-21 18:09:03 +01:00
13 changed files with 46 additions and 148 deletions

View File

@@ -1,23 +1,13 @@
name: compare_subways
name: process_subways
on:
workflow_dispatch: # Manual trigger
inputs:
subways-branch:
description: 'Check out a different subways repo branch?'
required: true
type: string
default: master
schedule:
# Run daily at 00:00 UTC
- cron: '0 0 * * *'
env:
#PLANET: /home/planet/planet/planet-latest.pbf
#TMPDIR: /tmp
PLANET: /home/planet/planet/planet.o5m
TMPDIR: /tmp
HTML_DIR: "/mnt/4tbexternal/osm-planet/subway/validator"
#DUMP: "$HTML_DIR"
#SKIP_PLANET_UPDATE: "1"
SPREADSHEET_ID: "1SEW1-NiNOnA2qDwievcxYV1FOaQl1mb1fdeyqAxHu3k"
DUMP: "$HTML_DIR"
SKIP_PLANET_UPDATE: "1"
DEBIAN_FRONTEND: nonnteractive
TZ: Etc/UTC
@@ -32,61 +22,20 @@ jobs:
volumes:
- /mnt/4tbexternal:/mnt/4tbexternal
concurrency:
group: ${{ github.workflow }}-compare-subways-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-process-subways-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- uses: actions/cache@v4
with:
path: "~"
key: cache-${{ github.run_id }}-${{ github.run_attempt }}}
- name: Checkout main repo
shell: bash
run: |
echo "Cloning $FORGEJO_SERVER_URL/$FORGEJO_REPOSITORY branch $FORGEJO_REF_NAME"
cd ~
git clone --depth 1 -b $FORGEJO_REF_NAME --single-branch $FORGEJO_SERVER_URL/$FORGEJO_REPOSITORY.git comaps
# --recurse-submodules --shallow-submodules
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- name: Checkout subways repo
shell: bash
run: |
cd ~
git clone --depth 1 -b ${{ inputs.subways-branch }} --single-branch https://codeberg.org/comaps/subways.git
git clone --depth 1 --single-branch https://codeberg.org/comaps/subways.git
update-planet-pbf:
name: Update PBF Planet
runs-on: mapfilemaker
container:
image: codeberg.org/comaps/maps_generator:f6d53d54f794
volumes:
- /mnt/4tbexternal/:/mnt/4tbexternal/
- /mnt/4tbexternal/osm-planet:/home/planet
concurrency:
group: ${{ github.workflow }}-compare-subways-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- name: Download Planet File if Absent
shell: bash
# TODO: replace wget2 with curl -Z
run: |
if [ ! -d /home/planet/planet/ ]; then
mkdir -p /home/planet/planet/
fi
if [ ! -f /home/planet/planet/planet-latest.osm.pbf ]; then
cd /home/planet/planet/
wget2 --verbose --progress=bar --continue https://ftpmirror.your.org/pub/openstreetmap/pbf/planet-latest.osm.pbf
else
echo "planet-latest.osm.pbf was found, raw download not required."
fi
- name: Update PBF Planet
shell: bash
run: |
cd /home/planet/planet/
rm -f planet-latest-new.osm.pbf
pyosmium-up-to-date planet-latest.osm.pbf -o planet-latest-new.osm.pbf -v --size 16384
mv planet-latest-new.osm.pbf planet-latest.osm.pbf
update-planet-o5m:
if: false
name: Update O5M Planet
runs-on: mapfilemaker
container:
@@ -95,7 +44,7 @@ jobs:
- /mnt/4tbexternal/:/mnt/4tbexternal/
- /mnt/4tbexternal/osm-planet:/home/planet
concurrency:
group: ${{ github.workflow }}-compare-subways-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-process-subways-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- name: Check for O5M Planet File
@@ -124,9 +73,18 @@ jobs:
osmupdate -v --drop-author --drop-version --hash-memory=4000 --max-merge=32 --out-o5m planet.o5m planet-new.o5m
mv planet-new.o5m planet.o5m
echo "Done."
compare-subways:
name: Compare Subways
- name: Notify Zulip
run: |
curl -X POST https://comaps.zulipchat.com/api/v1/messages \
-u $ZULIP_BOT_EMAIL:$ZULIP_API_KEY \
--data-urlencode type=stream \
--data-urlencode 'to="DevOps"' \
--data-urlencode topic=codeberg-bot \
--data-urlencode 'content=O5M planet update is done!'
update-subways:
if: inputs.run-subways
name: Update Subways
runs-on: mapfilemaker
needs:
- clone-repos
@@ -136,19 +94,31 @@ jobs:
- /mnt/4tbexternal/:/mnt/4tbexternal/
- /mnt/4tbexternal/osm-planet:/home/planet
concurrency:
group: ${{ github.workflow }}-compare-subways-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-map-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- uses: actions/cache@v4
with:
path: "~"
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- name: Compare Subways
- name: Update Subways
shell: bash
run: |
cd ~/comaps/
cp tools/unix/maps/settings.sh.prod tools/unix/maps/settings.sh
./tools/unix/maps/generate_subways.sh
- name: Compare with VK validation
shell: bash
run: |
cd ~/subways
if [ -f "$HTML_DIR/index.html" ]; then
echo "Comparing local validation with VK's validation..."
python3 ./scripts/compare_html_validation.py "$HTML_DIR/index.html" \
--vk-url "https://maps.vk.com/osm/tools/subways/latest/index.html"
else
echo "Local index.html not found at $HTML_DIR/index.html"
exit 1
fi
- name: Notify Zulip
run: |
curl -X POST https://comaps.zulipchat.com/api/v1/messages \
@@ -157,48 +127,3 @@ jobs:
--data-urlencode 'to="DevOps"' \
--data-urlencode topic=codeberg-bot \
--data-urlencode 'content=Subways are done!'
- name: Compare with VK validation
shell: bash
run: |
#set -e
cd ~/subways
if [ -f "$HTML_DIR/cities.txt" ]; then
echo "Comparing local validation with VK's validation..."
python3 ./scripts/compare_html_validation.py "$HTML_DIR/cities.txt" \
--remote-url "https://maps.vk.com/osm/tools/subways/latest/cities.txt"
exit 0
else
echo "Local cities.txt not found at $HTML_DIR/cities.txt"
exit 1
fi
- name: Compare Google Sheets Data
shell: bash
run: |
set -e
# Download the Google Sheets data
GOOGLE_SHEETS_URL="https://docs.google.com/spreadsheets/d/${SPREADSHEET_ID}/export?format=csv"
echo "Downloading Google Sheets data from: $GOOGLE_SHEETS_URL"
curl -sL "$GOOGLE_SHEETS_URL" -o /tmp/google_sheets.csv
# Normalize line endings to avoid spurious diffs
sed 's/\r$//' source_data/Rapid.csv > /tmp/local_normalized.csv
sed 's/\r$//' /tmp/google_sheets.csv > /tmp/google_normalized.csv
# Generate unified diff
echo ""
echo "Differences between local Rapid.csv and Google Sheets:"
echo ""
if diff -u /tmp/local_normalized.csv /tmp/google_normalized.csv > /tmp/full_diff.txt; then
echo "No differences found! Local Rapid.csv is in sync with Google Sheets."
exit 0
else
cat /tmp/full_diff.txt
echo ""
echo "The above diff can be saved as a patch and applied with:"
echo " patch source_data/Rapid.csv < patch-file"
echo "or by manually reviewing and applying the changes."
exit 1
fi

View File

@@ -1 +0,0 @@
<svg height="15" viewBox="0 0 15 15" width="15" xmlns="http://www.w3.org/2000/svg"><g fill="none" transform="translate(.0562 .4152)"><path d="m7.76536687 1.02582924 2.91781373 1.20859801c.4900562.20298792.8794043.59233606 1.0823922 1.08239221l1.208598 2.91781372c.2029879.49005615.2029879 1.04067751 0 1.5307337l-1.208598 2.91781362c-.2029879.4900562-.5923361.8794044-1.0823922 1.0823923l-2.91781376 1.208598c-.49005615.2029879-1.04067751.2029879-1.53073369 0l-2.91781366-1.208598c-.49005618-.2029879-.87940432-.592336-1.08239223-1.0823922l-1.20859802-2.91781373c-.2029879-.49005617-.2029879-1.04067755.00000001-1.53073373l1.208598-2.91781368c.20298791-.49005618.59233603-.8794043 1.0823922-1.0823922l2.9178137-1.20859802c.49005617-.2029879 1.04067755-.2029879 1.53073372 0z" fill="#181715"/><path d="m7.57402516 1.48776901 2.91781374 1.20859801c.3675421.15224093.6595532.44425202.8117941.81179415l1.208598 2.91781369c.1522409.36754213.1522409.78050817 0 1.1480503l-1.208598 2.91781374c-.1522409.3675421-.444252.6595532-.8117941.8117941l-2.91781374 1.208598c-.36754213.1522409-.78050817.1522409-1.1480503 0l-2.91781369-1.208598c-.36754213-.1522409-.65955322-.444252-.81179415-.8117941l-1.20859801-2.91781374c-.15224093-.36754213-.15224093-.78050817 0-1.1480503l1.20859801-2.91781369c.15224093-.36754213.44425202-.65955322.81179415-.81179415l2.91781369-1.20859801c.36754213-.15224093.78050817-.15224093 1.1480503 0z" fill="202510" fill-rule="evenodd"/></g></svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -70,7 +70,6 @@ node|z14-[natural=geyser],
node|z16-[natural=beach],
area|z14-[natural=bare_rock],
node|z17-[natural=rock],
node|z17-[natural=tree],
{text: name;text-color: @poi_label;text-position: center;text-offset: 1;}
node|z13-[natural=peak][!name],
@@ -207,9 +206,7 @@ node|z19-[man_made=water_well][drinking_water=not],
node|z19-[amenity=water_point][drinking_water=not],
{icon-image: drinking-water-no-m.svg;}
node|z17-[natural=tree][name],
{icon-image: tree-special-m.svg;}
node|z18-[natural=tree][!name],
node|z18-[natural=tree],
{icon-image: tree-m.svg;}
node|z18-[xmas:feature=tree],

View File

@@ -2460,7 +2460,7 @@ emergency-life_ring # icon z19- (also has captio
power-substation # icon z17- (also has caption(optional) z18-, area z13-)
=== -9990
natural-tree # icon z17- (also has caption(optional) z17-)
natural-tree # icon z18-
=== -9991
# amenity-bench # caption(optional) z19- (also has icon z18-)
@@ -2499,7 +2499,6 @@ entrance-service # icon z19- (also has captio
# man_made-survey_point # caption(optional) z18- (also has icon z18-)
# man_made-telescope # caption(optional) z18- (also has icon z18-)
# man_made-telescope-optical # caption(optional) z17- (also has icon z17-)
# natural-tree # caption(optional) z17- (also has icon z17-)
# power-substation # caption(optional) z18- (also has icon z17-, area z13-)
# tourism-information # caption(optional) z16- (also has icon z16-)
# tourism-information-board # caption(optional) z16- (also has icon z16-)

View File

@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="18" height="18" version="1.1" viewBox="0 0 24 24" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="#fff" opacity=".6"/><circle cx="12" cy="12" r="11" fill="#1267CE"/><path d="m12 19.141c-2.6667 0-6-1.8076-6-6.141v-7.0295h4v6.9295c0 0.66086 0.66667 1.9 2 1.9 1.3333 0 2-1.0119 2-1.8v-7.0295h4v6.8295c0 4.5333-3.3333 6.341-6 6.341z" fill="#fff"/></svg>
<svg width="18" height="18" version="1.1" viewBox="0 0 24 24" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="#fff" opacity=".6"/><circle cx="12" cy="12" r="11" fill="#3b87c9"/><path d="m12 19.141c-2.6667 0-6-1.8076-6-6.141v-7.0295h4v6.9295c0 0.66086 0.66667 1.9 2 1.9 1.3333 0 2-1.0119 2-1.8v-7.0295h4v6.8295c0 4.5333-3.3333 6.341-6 6.341z" fill="#fff"/></svg>

Before

Width:  |  Height:  |  Size: 446 B

After

Width:  |  Height:  |  Size: 446 B

View File

@@ -2,7 +2,7 @@
<svg width="14" height="14" version="1.1" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<g stroke-width=".75">
<circle cx="9" cy="9" r="9" fill="#fff" opacity=".6"/>
<circle cx="9" cy="9" r="8.25" fill="#1267CE"/>
<circle cx="9" cy="9" r="8.25" fill="#3b87c9"/>
<path d="m9 14.356c-2 0-4.5-1.3557-4.5-4.6057v-5.2722h3v5.1972c0 0.49565 0.5 1.425 1.5 1.425 1 0 1.5-0.75896 1.5-1.35v-5.2722h3v5.1222c0 3.4-2.5 4.7557-4.5 4.7557z" fill="#fff"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 462 B

After

Width:  |  Height:  |  Size: 462 B

View File

@@ -1 +0,0 @@
<svg height="15" viewBox="0 0 15 15" width="15" xmlns="http://www.w3.org/2000/svg"><g fill="none" transform="translate(.0562 .4152)"><path d="m7.76536687 1.02582924 2.91781373 1.20859801c.4900562.20298792.8794043.59233606 1.0823922 1.08239221l1.208598 2.91781372c.2029879.49005615.2029879 1.04067751 0 1.5307337l-1.208598 2.91781362c-.2029879.4900562-.5923361.8794044-1.0823922 1.0823923l-2.91781376 1.208598c-.49005615.2029879-1.04067751.2029879-1.53073369 0l-2.91781366-1.208598c-.49005618-.2029879-.87940432-.592336-1.08239223-1.0823922l-1.20859802-2.91781373c-.2029879-.49005617-.2029879-1.04067755.00000001-1.53073373l1.208598-2.91781368c.20298791-.49005618.59233603-.8794043 1.0823922-1.0823922l2.9178137-1.20859802c.49005617-.2029879 1.04067755-.2029879 1.53073372 0z" fill="#f5eada"/><path d="m7.57402516 1.48776901 2.91781374 1.20859801c.3675421.15224093.6595532.44425202.8117941.81179415l1.208598 2.91781369c.1522409.36754213.1522409.78050817 0 1.1480503l-1.208598 2.91781374c-.1522409.3675421-.444252.6595532-.8117941.8117941l-2.91781374 1.208598c-.36754213.1522409-.78050817.1522409-1.1480503 0l-2.91781369-1.208598c-.36754213-.1522409-.65955322-.444252-.81179415-.8117941l-1.20859801-2.91781374c-.15224093-.36754213-.15224093-.78050817 0-1.1480503l1.20859801-2.91781369c.15224093-.36754213.44425202-.65955322.81179415-.81179415l2.91781369-1.20859801c.36754213-.15224093.78050817-.15224093 1.1480503 0z" fill="#a2ba4e" fill-rule="evenodd"/></g></svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -31,7 +31,6 @@ node|z15-[natural=hot_spring],
node|z12-[natural=geyser],
node|z14-[natural=beach],
area|z13-[natural=bare_rock][name],
node|z16-[natural=tree],
{text: name;text-color: @poi_label;text-position: center;text-offset: 1;font-size: 10;}
node|z11-[natural=peak][!name],
area|z13-[natural=bare_rock][!name],
@@ -149,11 +148,6 @@ node|z15-[man_made=water_well][drinking_water=not],
node|z15-[amenity=water_point][drinking_water=not],
{icon-image: drinking-water-no-m.svg;}
node|z16-[natural=tree][name],
{icon-image: tree-special-m.svg;}
node|z18-[natural=tree][!name],
{icon-image: tree-m.svg;}
/* 3.5 Ferry terminal & seamarks */

View File

@@ -2466,7 +2466,7 @@ emergency-life_ring # icon z19- (also has captio
power-substation # icon z17- (also has caption(optional) z18-, area z13-)
=== -9990
natural-tree # icon z16- (also has caption(optional) z16-)
natural-tree # icon z18-
=== -9991
# amenity-bench # caption(optional) z19- (also has icon z18-)
@@ -2505,7 +2505,6 @@ entrance-service # icon z19- (also has captio
# man_made-survey_point # caption(optional) z15- (also has icon z14-)
# man_made-telescope # caption(optional) z18- (also has icon z18-)
# man_made-telescope-optical # caption(optional) z17- (also has icon z17-)
# natural-tree # caption(optional) z16- (also has icon z16-)
# power-substation # caption(optional) z18- (also has icon z17-, area z13-)
# tourism-information # caption(optional) z15- (also has icon z15-)
# tourism-information-board # caption(optional) z15- (also has icon z15-)

View File

@@ -130,6 +130,11 @@ The recommended approach for resolving conflicts is as follows:
Using these steps all existing translations can still be kept and rebased into the repo, without losing work. The important bit is that you need to ensure that all translations are in the Weblate-internal git repository before you rebase, so that they get into the _actual_ Codeberg repo.
### Add support of new language in Android app
1. Make sure Weblate has generate strings.xml for your language in this directory [android/app/src/main/res/values\*/strings.xml][android_git]
2. Add the language in `localeFilters` list in [build.gradle](https://codeberg.org/comaps/comaps/src/commit/e156d21eee7debd13ce9ec775cdcb264a97aad47/android/app/build.gradle#L258) (It's necessary to add language in this file to be sure app translations and library translations was integrated in the app).
3. Add the language in [locales_config.xml](https://codeberg.org/comaps/comaps/src/branch/main/android/app/src/main/res/xml/locales_config.xml) (It's necessary to allow users to change app language in Android settings on most recent devices).
[codeberg_translate]: https://translate.codeberg.org/projects/comaps/
[contribute]: https://docs.weblate.org/en/latest/workflows.html
[android_weblate]: https://translate.codeberg.org/projects/comaps/android/

View File

@@ -4,7 +4,6 @@
#include "indexer/feature_data.hpp"
#include "indexer/feature_visibility.hpp"
#include "indexer/ftypes_matcher.hpp"
#include "indexer/ftypes_subtypes.hpp"
#include "indexer/scales.hpp"
#include "platform/distance.hpp"
@@ -441,17 +440,6 @@ vector<int8_t> GetDescriptionLangPriority(RegionData const & regionData)
return PrioritizedLanguages(preferredLangs, DefaultLanguage(regionData, preferredLangs));
}
vector<string> GetLocalizedSubtypes(TypesHolder const & types)
{
auto const & classificator = classif();
auto subtypes = ftypes::Subtypes::Instance();
vector<string> localizedSubtypes;
for (auto const & type : types)
if (subtypes.IsSubtype(type))
localizedSubtypes.push_back(platform::GetLocalizedTypeName(classificator.GetReadableObjectName(type)));
return localizedSubtypes;
}
vector<string> GetCuisines(TypesHolder const & types)
{
auto const & isCuisine = ftypes::IsCuisineChecker::Instance();

View File

@@ -149,9 +149,6 @@ bool GetPreferredName(StringUtf8Multilang const & src, int8_t deviceLang, std::s
/// - default language code;
std::vector<int8_t> GetDescriptionLangPriority(RegionData const & regionData);
// Returns vector of subtypes localized by platform.
std::vector<std::string> GetLocalizedSubtypes(TypesHolder const & types);
// Returns vector of cuisines readable names from classificator.
std::vector<std::string> GetCuisines(TypesHolder const & types);

View File

@@ -279,8 +279,7 @@ void FillDetails(FeatureType & ft, std::string const & name, Result::Details & d
}
}
feature::TypesHolder typesHolder(ft);
typesHolder.SortBySpec();
feature::TypesHolder const typesHolder(ft);
std::string stars;
uint8_t starsCount = 0;
@@ -288,8 +287,6 @@ void FillDetails(FeatureType & ft, std::string const & name, Result::Details & d
if (isHotel && strings::to_uint(ft.GetMetadata(feature::Metadata::FMD_STARS), starsCount))
stars = feature::FormatStars(starsCount);
auto const subtypes = strings::JoinStrings(feature::GetLocalizedSubtypes(typesHolder), feature::kFieldsSeparator);
auto const cuisines = feature::GetLocalizedCuisines(typesHolder);
auto const cuisine = strings::JoinStrings(cuisines, feature::kFieldsSeparator);
@@ -317,7 +314,6 @@ void FillDetails(FeatureType & ft, std::string const & name, Result::Details & d
append(brand);
append(elevation);
append(cuisine);
append(subtypes);
append(fee);
details.m_description = std::move(description);