From e52e43e49cd23a4404b0a6b01fbba6bb07574740 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste CHARRON Date: Sun, 2 Jul 2023 17:23:30 +0200 Subject: [PATCH 1/3] Update french translations Signed-off-by: Jean-Baptiste CHARRON --- data/strings/types_strings.txt | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/data/strings/types_strings.txt b/data/strings/types_strings.txt index 203edf56eb..31fef7ebe8 100644 --- a/data/strings/types_strings.txt +++ b/data/strings/types_strings.txt @@ -2037,6 +2037,7 @@ be = Хрысціянскія могілкі es = Cementerio cristiano et = Kristlik surnuaed + fr = Cimetière chrétien it = Cimitero cristiano ja = キリスト教墓地 mr = ख्रिश्चन स्मशानभूमी @@ -4428,6 +4429,7 @@ es = Maquina expendedora de combustible et = Tankimisautomaat fi = Bensa-automaatti + fr = Pompe à carburants mr = इंधन विक्रीयंत्र nl = Tankautomaat pt-BR = Bomba de combustível @@ -4548,6 +4550,7 @@ de = Müllumladestation es = Estación de transferencia de residuos et = Jäätmete üleandmise jaam + fr = Station de transfert de déchets it = Centro trasferimento rifiuti mr = कचरा हस्तांतरण केंद्र nl = Overslagstation voor afval @@ -4743,6 +4746,7 @@ es = Barrera para bicicletas et = Jalgrattabarjäär eu = Bizikleta-hesia + fr = Barrière à vélos fi = Polkupyöräeste it = Barriera per biciclette ja = バリカー @@ -5526,7 +5530,7 @@ eu = Tren geltokian fa = ایستگاه قطار fi = Rautatieasema - fr = Gare + fr = Gare ferroviaire hu = Vonatmegálló id = Rel kereta api it = Stazione ferroviaria @@ -6120,7 +6124,7 @@ eu = Metalgintzako langilea fa = اهن کار fi = Metallimies - fr = Métallo + fr = Constructions métalliques he = עובד מתכת hu = Lakatos id = Tukang besi @@ -10031,7 +10035,7 @@ de = Reitweg es = Camino de caballos et = Valjarada - fr = Chemin pour cavalier + fr = Chemin équestre it = sentiero per cavalli ja = 馬道 nb = Ridevei @@ -10541,6 +10545,7 @@ en = Motorway Ramp de = Autobahnauffahrt et = Kiirtee kaldtee + fr = Bretelle d'autoroute it = Svincolo autostradale mr = महामार्ग उतार nl = Snelwegoprit @@ -13659,6 +13664,7 @@ de = Erholungsgebiet es = Área recreativa et = Puhkeväljak + fr = Aire de jeux it = Area divertimento ja = レクリエーション mr = मनोरंजन मैदान @@ -14545,6 +14551,7 @@ ar = مسبح خاص es = Piscina privada et = Privaatne bassein + fr = Piscine privée it = Piscina privata nl = Privé zwembad @@ -16772,6 +16779,7 @@ [type.noexit] en = Dead End et = Tupiktee + fr = Voie sans issue it = Strada senza uscita ja = 行き止まり mr = रस्ता बंद @@ -17938,6 +17946,7 @@ de = Generator es = Generador et = Generaator + fr = Générateur it = Generatore ja = 発電機 mr = जनित्र(जनरेटर) @@ -18113,6 +18122,7 @@ de = Hochspannungs-Freileitung es = Línea eléctrica et = Elektriliin + fr = Ligne électrique it = Cavo elettrico ja = 電力線 mr = विद्युत तार @@ -18130,6 +18140,7 @@ de = Unterirdische Hochpannungsleitung es = Línea eléctrica subterránea et = Maa-alune elektriliin + fr = Ligne électrique souterraine ja = 地下電力線 mr = भूमिगत विद्युत तार nl = Ondergrondse hoogspanningsleiding @@ -18146,6 +18157,7 @@ de = Nieder-/Mittelspannungsfreileitung es = Línea eléctrica de baja tensión et = Madal-/Keskpinge elektriliin + fr = Ligne électrique it = Cavo elettrico ja = 低圧電力線 mr = किरकोळ विद्युत तार @@ -18420,7 +18432,7 @@ eu = Zutabe elektrikoa fa = برج قدرت fi = Sähköpylväs - fr = Poteau électrique + fr = Pylône électrique hu = Villanyoszlop id = Menara listrik it = Pilone elettrico @@ -19094,7 +19106,7 @@ eu = Tren geltokian fa = ایستگاه قطار fi = Rautatieasema - fr = Gare + fr = Gare ferroviaire hu = Vonatmegálló id = Rel kereta api it = Stazione ferroviaria @@ -23537,7 +23549,7 @@ eu = Arteak eta Eskulanak fa = ﯽﺘﺳﺩ ﻊﯾﺎﻨﺻ ﻭ ﺮﻨﻫ fi = Käsityöt - fr = L'artisanat + fr = Matériel d'arts et de loisirs créatifs he = הריציו תונמוא hu = Művészetek és kézművesség id = Seni dan kerajinan @@ -24629,7 +24641,7 @@ eu = Golfa fa = گلف fi = Golf - fr = Le golf + fr = Golf he = גולף hu = Golf id = Golf @@ -25387,6 +25399,7 @@ et = Turism eu = Turismoa fi = Turismi + fr = Tourisme it = Turismo ja = 観光 mr = पर्यटन @@ -25702,6 +25715,7 @@ eu = Kanpalekua fa = محل چادر زنی fi = Retkeily + fr = Camping hu = Kemping id = Perkemahan it = Campeggio -- 2.45.3 From d86613d3f6643f380ca1a87880b0a5bf28239c4b Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Tue, 4 Jul 2023 13:19:25 +0200 Subject: [PATCH 2/3] Fixed codecvt deprecation warning Signed-off-by: Alexander Borsuk --- indexer/editable_map_object.cpp | 37 +++++++------------ .../editable_map_object_test.cpp | 2 +- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/indexer/editable_map_object.cpp b/indexer/editable_map_object.cpp index dc874b8d95..788da127ab 100644 --- a/indexer/editable_map_object.cpp +++ b/indexer/editable_map_object.cpp @@ -12,7 +12,6 @@ #include #include -#include #include #include @@ -743,38 +742,30 @@ bool EditableMapObject::ValidateName(string const & name) if (name.empty()) return true; - if (strings::IsASCIIString(name)) - { - static auto const s_nameRegex = regex(R"(^[ A-Za-z0-9.,?!@°#$%&()\-\+\/\\\[\]:;"'`]+$)"); - return regex_match(name, s_nameRegex); - } + static std::u32string_view constexpr excludedSymbols = U"^§><*=_±√•÷×¶"; - std::wstring_convert, char32_t> converter; - - std::u32string u32name; - try - { - u32name = converter.from_bytes(name); - } - catch (std::range_error const &) - { - // Cannot convert, for ex. it is possible for some emoji. - return false; - } - - std::u32string const excludedSymbols = U"^~§><{}*=_±\n\t\r\v\f|√•÷×¶"; - - for (auto const ch : u32name) + using Iter = utf8::unchecked::iterator; + for (Iter it{name.cbegin()}; it != Iter{name.cend()}; ++it) { + auto const ch = *it; + // Exclude ASCII control characters. + if (ch < U'\U0000001F') + return false; + // Exclude {|}~ DEL and C1 control characters. + if (ch >= U'\U0000007B' && ch <= U'\U0000009F') + return false; // Exclude arrows, mathematical symbols, borders, geometric shapes. if (ch >= U'\U00002190' && ch <= U'\U00002BFF') return false; + // Emoji modifiers https://en.wikipedia.org/wiki/Emoji#Emoji_versus_text_presentation + if (ch == U'\U0000FE0E' || ch == U'\U0000FE0F') + return false; // Exclude format controls, musical symbols, emoticons, ornamental and pictographs, // ancient and exotic alphabets. if (ch >= U'\U0000FFF0' && ch <= U'\U0001F9FF') return false; - if (find(excludedSymbols.cbegin(), excludedSymbols.cend(), ch) != excludedSymbols.cend()) + if (excludedSymbols.find(ch) != std::u32string_view::npos) return false; } return true; diff --git a/indexer/indexer_tests/editable_map_object_test.cpp b/indexer/indexer_tests/editable_map_object_test.cpp index e655caf861..e2c2ef6f3a 100644 --- a/indexer/indexer_tests/editable_map_object_test.cpp +++ b/indexer/indexer_tests/editable_map_object_test.cpp @@ -203,7 +203,7 @@ UNIT_TEST(EditableMapObject_ValidateName) vector incorrectNames = {"a^bc", "a~bc", "a§bc", "a>bc", "a Date: Tue, 4 Jul 2023 18:29:14 +0200 Subject: [PATCH 3/3] Update indexer/editable_map_object.cpp Signed-off-by: Alexander Borsuk <170263+biodranik@users.noreply.github.com> --- indexer/editable_map_object.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indexer/editable_map_object.cpp b/indexer/editable_map_object.cpp index 788da127ab..0cc86f1854 100644 --- a/indexer/editable_map_object.cpp +++ b/indexer/editable_map_object.cpp @@ -749,7 +749,7 @@ bool EditableMapObject::ValidateName(string const & name) { auto const ch = *it; // Exclude ASCII control characters. - if (ch < U'\U0000001F') + if (ch <= U'\U0000001F') return false; // Exclude {|}~ DEL and C1 control characters. if (ch >= U'\U0000007B' && ch <= U'\U0000009F') -- 2.45.3