mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-17 16:34:50 +00:00
Use actual native languages for world map
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
1
android/sdk/src/main/assets/countries_meta.txt
Symbolic link
1
android/sdk/src/main/assets/countries_meta.txt
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../../data/countries_meta.txt
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"World": {
|
||||
"languages": ["int_name", "en", "default"]
|
||||
"languages": []
|
||||
},
|
||||
"WorldCoasts": {
|
||||
"languages": ["int_name", "en", "default"]
|
||||
"languages": []
|
||||
},
|
||||
"Abkhazia": {
|
||||
"languages": ["ab", "ru"]
|
||||
|
||||
@@ -41,6 +41,9 @@ NS_SWIFT_NAME(SettingsBridge)
|
||||
+ (NSString *)mapLanguageCode;
|
||||
+ (void)setMapLanguageCode:(NSString *)mapLanguageCode;
|
||||
|
||||
+ (BOOL)mapLanguageLimitAlternativesToLocal;
|
||||
+ (void)setMapLanguageLimitAlternativesToLocal:(BOOL)mapLanguageLimitAlternativesToLocal;
|
||||
|
||||
+ (BOOL)transliteration;
|
||||
+ (void)setTransliteration:(BOOL)transliteration;
|
||||
|
||||
|
||||
@@ -234,6 +234,20 @@ NSString * const kUDFileLoggingEnabledKey = @"FileLoggingEnabledKey";
|
||||
}
|
||||
}
|
||||
|
||||
+ (BOOL)mapLanguageLimitAlternativesToLocal
|
||||
{
|
||||
bool enabled = true;
|
||||
UNUSED_VALUE(settings::Get(settings::kMapLanguageLimitAlternativesToLocal, enabled));
|
||||
return enabled;
|
||||
}
|
||||
|
||||
+ (void)setMapLanguageLimitAlternativesToLocal:(BOOL)mapLanguageLimitAlternativesToLocal
|
||||
{
|
||||
settings::Set(settings::kMapLanguageLimitAlternativesToLocal, static_cast<bool>(mapLanguageLimitAlternativesToLocal));
|
||||
auto & f = GetFramework();
|
||||
f.InvalidateRect(f.GetCurrentViewport());
|
||||
}
|
||||
|
||||
+ (BOOL)transliteration { return GetFramework().LoadTransliteration(); }
|
||||
+ (void)setTransliteration:(BOOL)transliteration
|
||||
{
|
||||
|
||||
@@ -1095,6 +1095,7 @@
|
||||
"edit_track" = "Track bearbeiten";
|
||||
"pref_mapappearance_title" = "Kartendarstellung";
|
||||
"pref_maplanguage_title" = "Karten-Sprache";
|
||||
"limit_map_language_alternatives_to_local" = "Nutzung alternativer Sprachen auf lokale Sprachen begrenzen";
|
||||
"transliteration_title_disabled_summary" = "Bei der Nutzung der lokalen Sprache für die Karte ausgeschaltet";
|
||||
"pref_maplanguage_local" = "Lokale Sprache";
|
||||
"existence_confirmed_time_ago" = "Existenz bestätigt %@";
|
||||
|
||||
@@ -766,6 +766,7 @@
|
||||
"traffic_data_unavailable" = "Traffic data is not available";
|
||||
"enable_logging" = "Enable logging";
|
||||
"log_file_size" = "Log file size: %@";
|
||||
"limit_map_language_alternatives_to_local" = "Limit use of alternative languages to local ones";
|
||||
"transliteration_title" = "Transliterate into Latin alphabet";
|
||||
"transliteration_title_disabled_summary" = "Disabled when always using the local language for the map";
|
||||
|
||||
|
||||
@@ -786,6 +786,7 @@
|
||||
"traffic_data_unavailable" = "Traffic data is not available";
|
||||
"enable_logging" = "Enable logging";
|
||||
"log_file_size" = "Log file size: %@";
|
||||
"limit_map_language_alternatives_to_local" = "Limit use of alternative languages to local ones";
|
||||
"transliteration_title" = "Transliterate into Latin alphabet";
|
||||
"transliteration_title_disabled_summary" = "Disabled when always using the local language for the map";
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
165953942CB44B5600CFED7C /* symbols in Resources */ = {isa = PBXBuildFile; fileRef = 165953932CB44B3B00CFED7C /* symbols */; };
|
||||
1DFA2F6A20D3B57400FB2C66 /* UIColor+PartnerColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DFA2F6920D3B57400FB2C66 /* UIColor+PartnerColor.m */; };
|
||||
270C9C282E16AB6F00ABA688 /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 270C9C252E16AB6300ABA688 /* Profile.swift */; };
|
||||
271186872F19467400FD7FF3 /* countries_meta.txt in Resources */ = {isa = PBXBuildFile; fileRef = 271186862F19467400FD7FF3 /* countries_meta.txt */; };
|
||||
27176A862E65B0150015F25F /* Icon.icon in Resources */ = {isa = PBXBuildFile; fileRef = 27176A852E65B0150015F25F /* Icon.icon */; };
|
||||
27176A8A2E65B01B0015F25F /* Debug Icon.icon in Resources */ = {isa = PBXBuildFile; fileRef = 27176A892E65B01B0015F25F /* Debug Icon.icon */; };
|
||||
272CA4492F127221005A3F5B /* subtypes.csv in Resources */ = {isa = PBXBuildFile; fileRef = 272CA4482F127221005A3F5B /* subtypes.csv */; };
|
||||
@@ -763,6 +764,7 @@
|
||||
1DFA2F6920D3B57400FB2C66 /* UIColor+PartnerColor.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = "UIColor+PartnerColor.m"; sourceTree = "<group>"; tabWidth = 2; };
|
||||
1DFA2F6E20D3CA9200FB2C66 /* UIColorRoutines.h */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = UIColorRoutines.h; sourceTree = "<group>"; tabWidth = 2; };
|
||||
270C9C252E16AB6300ABA688 /* Profile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Profile.swift; sourceTree = "<group>"; };
|
||||
271186862F19467400FD7FF3 /* countries_meta.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = countries_meta.txt; path = ../../data/countries_meta.txt; sourceTree = SOURCE_ROOT; };
|
||||
27176A852E65B0150015F25F /* Icon.icon */ = {isa = PBXFileReference; lastKnownFileType = folder.iconcomposer.icon; path = Icon.icon; sourceTree = "<group>"; };
|
||||
27176A892E65B01B0015F25F /* Debug Icon.icon */ = {isa = PBXFileReference; lastKnownFileType = folder.iconcomposer.icon; path = "Debug Icon.icon"; sourceTree = "<group>"; };
|
||||
272CA4482F127221005A3F5B /* subtypes.csv */ = {isa = PBXFileReference; lastKnownFileType = text; name = subtypes.csv; path = ../../data/subtypes.csv; sourceTree = SOURCE_ROOT; };
|
||||
@@ -3941,6 +3943,7 @@
|
||||
452FCA3A1B6A3DF7007019AB /* colors.txt */,
|
||||
97A5967E19B9CD47007A963F /* copyright.html */,
|
||||
FA46DA2B12D4166E00968C36 /* countries.txt */,
|
||||
271186862F19467400FD7FF3 /* countries_meta.txt */,
|
||||
4A23D1561B8B4DD700D4EB6F /* drules_proto_default_light.bin */,
|
||||
4A00DBDE1AB704C400113624 /* drules_proto_default_dark.bin */,
|
||||
FA637ECC29A500BE00D8921A /* drules_proto_outdoors_light.bin */,
|
||||
@@ -4179,6 +4182,7 @@
|
||||
files = (
|
||||
165953742CB1D85500CFED7C /* fonts in Resources */,
|
||||
165953942CB44B5600CFED7C /* symbols in Resources */,
|
||||
271186872F19467400FD7FF3 /* countries_meta.txt in Resources */,
|
||||
47AEF8402231249E00D20538 /* categories_brands.txt in Resources */,
|
||||
F6C3A1B221AC22810060EEC8 /* Alert 5.m4a in Resources */,
|
||||
3404F49A2028A20D0090E401 /* BMCCategoryCell.xib in Resources */,
|
||||
|
||||
@@ -167,6 +167,17 @@ import AVFoundation
|
||||
}
|
||||
|
||||
|
||||
/// If the alternative languages for the app only should be used when they are the local native language
|
||||
static var shouldLimitMapLanguageAlternativesToLocal: Bool {
|
||||
get {
|
||||
return SettingsBridge.mapLanguageLimitAlternativesToLocal()
|
||||
}
|
||||
set {
|
||||
SettingsBridge.setMapLanguageLimitAlternativesToLocal(newValue)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// If the compass should be calibrated
|
||||
@objc static var shouldCalibrateCompass: Bool {
|
||||
get {
|
||||
|
||||
@@ -36,6 +36,10 @@ struct SettingsView: View {
|
||||
@State var selectedLanguageForMap: Settings.MapLanguage.ID? = nil
|
||||
|
||||
|
||||
/// If the alternative languages for the app only should be used when they are the local native language
|
||||
@State private var shouldLimitMapLanguageAlternativesToLocal: Bool = true
|
||||
|
||||
|
||||
/// If names should be transliterated to Latin
|
||||
@State private var shouldTransliterateToLatin: Bool = true
|
||||
|
||||
@@ -153,6 +157,20 @@ struct SettingsView: View {
|
||||
Text("pref_maplanguage_title")
|
||||
}
|
||||
|
||||
Toggle(isOn: $shouldLimitMapLanguageAlternativesToLocal) {
|
||||
VStack(alignment: .leading) {
|
||||
Text("limit_map_language_alternatives_to_local")
|
||||
|
||||
if selectedLanguageForMap == "default" {
|
||||
Text("transliteration_title_disabled_summary")
|
||||
.font(.footnote)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
.tint(.accent)
|
||||
.disabled(selectedLanguageForMap == "default")
|
||||
|
||||
Toggle(isOn: $shouldTransliterateToLatin) {
|
||||
VStack(alignment: .leading) {
|
||||
Text("transliteration_title")
|
||||
@@ -296,6 +314,7 @@ struct SettingsView: View {
|
||||
hasAutomaticDownload = Settings.hasAutomaticDownload
|
||||
hasIncreasedFontsize = Settings.hasIncreasedFontsize
|
||||
selectedLanguageForMap = Settings.languageForMap
|
||||
shouldLimitMapLanguageAlternativesToLocal = Settings.shouldLimitMapLanguageAlternativesToLocal
|
||||
shouldTransliterateToLatin = Settings.shouldTransliterateToLatin
|
||||
selectedMapAppearance = Settings.mapAppearance
|
||||
selectedAppearance = Settings.appearance
|
||||
@@ -328,6 +347,9 @@ struct SettingsView: View {
|
||||
Settings.languageForMap = changedSelectedLanguageForMap
|
||||
}
|
||||
}
|
||||
.onChange(of: shouldLimitMapLanguageAlternativesToLocal) { changedShouldLimitMapLanguageAlternativesToLocal in
|
||||
Settings.shouldLimitMapLanguageAlternativesToLocal = changedShouldLimitMapLanguageAlternativesToLocal
|
||||
}
|
||||
.onChange(of: shouldTransliterateToLatin) { changedShouldTransliterateToLatin in
|
||||
Settings.shouldTransliterateToLatin = changedShouldTransliterateToLatin
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "indexer/classificator.hpp"
|
||||
#include "indexer/feature_algo.hpp"
|
||||
#include "indexer/feature_impl.hpp"
|
||||
#include "indexer/feature_region_locator.hpp"
|
||||
#include "indexer/feature_utils.hpp"
|
||||
#include "indexer/map_object.hpp"
|
||||
#include "indexer/shared_load_info.hpp"
|
||||
@@ -825,7 +826,16 @@ void FeatureType::GetReadableName(bool allowTranslit, int8_t deviceLang, feature
|
||||
|
||||
ParseCommon();
|
||||
|
||||
feature::GetReadableName({GetNames(), mwmInfo->GetRegionData(), deviceLang, allowTranslit}, out);
|
||||
auto regionData = mwmInfo->GetRegionData();
|
||||
if (regionData.IsWorldLevel())
|
||||
{
|
||||
if (GetGeomType() == feature::GeomType::Point)
|
||||
regionData.SetLanguages(RegionLocator::Instance().GetLocalLanguages(GetCenter()));
|
||||
else
|
||||
regionData.SetLanguages({"int_name", "en", "default"});
|
||||
}
|
||||
|
||||
feature::GetReadableName({GetNames(), regionData, deviceLang, allowTranslit}, out);
|
||||
}
|
||||
|
||||
string const & FeatureType::GetHouseNumber()
|
||||
|
||||
@@ -216,6 +216,11 @@ void Metadata::ClearPOIAttribs()
|
||||
++i;
|
||||
}
|
||||
|
||||
bool RegionData::IsWorldLevel() const
|
||||
{
|
||||
return Get(RegionData::Type::RD_LANGUAGES).empty();
|
||||
}
|
||||
|
||||
void RegionData::SetLanguages(vector<string> const & codes)
|
||||
{
|
||||
string value;
|
||||
|
||||
@@ -224,6 +224,7 @@ public:
|
||||
MetadataBase::Set(type, s);
|
||||
}
|
||||
|
||||
bool IsWorldLevel() const;
|
||||
void SetLanguages(std::vector<std::string> const & codes);
|
||||
void GetLanguages(std::vector<int8_t> & langs) const;
|
||||
bool HasLanguage(int8_t const lang) const;
|
||||
|
||||
26
libs/indexer/feature_region_locator.cpp
Normal file
26
libs/indexer/feature_region_locator.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "indexer/feature_region_locator.hpp"
|
||||
|
||||
#include "defines.hpp"
|
||||
#include "platform/platform.hpp"
|
||||
|
||||
namespace feature
|
||||
{
|
||||
/// Constructor
|
||||
RegionLocator::RegionLocator()
|
||||
{
|
||||
auto & platform = GetPlatform();
|
||||
m_infoGetter = storage::CountryInfoReader::CreateCountryInfoGetter(platform);
|
||||
|
||||
auto reader = platform.GetReader(COUNTRIES_META_FILE);
|
||||
string buffer;
|
||||
reader->ReadAsString(buffer);
|
||||
m_jsonRoot = base::Json(buffer.data());
|
||||
}
|
||||
|
||||
/// Static instance
|
||||
RegionLocator const & RegionLocator::Instance()
|
||||
{
|
||||
static RegionLocator instance;
|
||||
return instance;
|
||||
}
|
||||
} // namespace feature
|
||||
56
libs/indexer/feature_region_locator.hpp
Normal file
56
libs/indexer/feature_region_locator.hpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
|
||||
#include "coding/reader.hpp"
|
||||
#include "cppjansson/cppjansson.hpp"
|
||||
#include "storage/storage.hpp"
|
||||
#include "storage/country_info_getter.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace feature
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
class RegionLocator
|
||||
{
|
||||
public:
|
||||
/// Static instance
|
||||
static RegionLocator const & Instance();
|
||||
|
||||
/**
|
||||
* Find the local languages codes for a given point
|
||||
* @param point The point to check
|
||||
* @return The local language codes
|
||||
*/
|
||||
vector<string> GetLocalLanguages(m2::PointD const point) const
|
||||
{
|
||||
auto const regionId = m_infoGetter->GetRegionCountryId(point);
|
||||
|
||||
vector<string> regionIdParts;
|
||||
for (auto const regionIdPart : strings::Tokenize(regionId, "_")) {
|
||||
regionIdParts.push_back(string(regionIdPart));
|
||||
}
|
||||
|
||||
json_t const * jsonData = nullptr;
|
||||
vector<string> languages;
|
||||
while (languages.empty() && !regionIdParts.empty()) {
|
||||
string regionId = strings::JoinStrings(regionIdParts, "_");
|
||||
FromJSONObjectOptionalField(m_jsonRoot.get(), regionId, jsonData);
|
||||
if (jsonData)
|
||||
FromJSONObjectOptionalField(jsonData, "languages", languages);
|
||||
regionIdParts.pop_back();
|
||||
}
|
||||
return languages;
|
||||
}
|
||||
|
||||
private:
|
||||
/// Constructor
|
||||
RegionLocator();
|
||||
|
||||
/// Country info getter
|
||||
unique_ptr<storage::CountryInfoGetter> m_infoGetter;
|
||||
|
||||
/// JSON root
|
||||
base::Json m_jsonRoot;
|
||||
};
|
||||
} // namespace feature
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "platform/distance.hpp"
|
||||
#include "platform/localization.hpp"
|
||||
#include "platform/preferred_languages.hpp"
|
||||
#include "platform/settings.hpp"
|
||||
|
||||
#include "coding/string_utf8_multilang.hpp"
|
||||
#include "coding/transliteration.hpp"
|
||||
@@ -117,7 +118,7 @@ bool IsNativeLang(feature::RegionData const & regionData, int8_t deviceLang)
|
||||
return false;
|
||||
}
|
||||
|
||||
int8_t DefaultLanguage(feature::RegionData const & regionData, vector<int8_t> const & langs)
|
||||
int8_t DefaultLanguageFromRegionData(feature::RegionData const & regionData, vector<int8_t> const & langs)
|
||||
{
|
||||
for (auto const lang : langs)
|
||||
{
|
||||
@@ -132,18 +133,39 @@ int8_t DefaultLanguage(feature::RegionData const & regionData, vector<int8_t> co
|
||||
return StrUtf8::kDefaultCode;
|
||||
}
|
||||
|
||||
vector<int8_t> PrioritizedLanguages(vector<int8_t> const & langs, int8_t defaultLang)
|
||||
vector<int8_t> PrioritizedLanguages(optional<feature::RegionData> const & regionData = {})
|
||||
{
|
||||
bool limitAlternativesToLocal = true;
|
||||
UNUSED_VALUE(settings::Get(settings::kMapLanguageLimitAlternativesToLocal, limitAlternativesToLocal));
|
||||
|
||||
vector<int8_t> prioritizedLangs = {};
|
||||
|
||||
vector<int8_t> const langs = languages::GetPreferredLangIndexes();
|
||||
|
||||
int8_t defaultLang = StrUtf8::kUnsupportedLanguageCode;
|
||||
if (regionData.has_value())
|
||||
defaultLang = DefaultLanguageFromRegionData(regionData.value(), langs);
|
||||
|
||||
for (auto const lang : langs)
|
||||
{
|
||||
if (find(prioritizedLangs.begin(), prioritizedLangs.end(), lang) == prioritizedLangs.end())
|
||||
if (!limitAlternativesToLocal &&
|
||||
find(prioritizedLangs.begin(), prioritizedLangs.end(), lang) == prioritizedLangs.end())
|
||||
prioritizedLangs.push_back(lang);
|
||||
|
||||
if (defaultLang != StrUtf8::kUnsupportedLanguageCode && defaultLang == lang)
|
||||
prioritizedLangs.push_back(StrUtf8::kDefaultCode);
|
||||
|
||||
if (!limitAlternativesToLocal)
|
||||
{
|
||||
auto const similarLangs = GetSimilarLanguages(lang);
|
||||
prioritizedLangs.insert(prioritizedLangs.cend(), similarLangs.cbegin(), similarLangs.cend());
|
||||
}
|
||||
}
|
||||
|
||||
if (limitAlternativesToLocal)
|
||||
{
|
||||
auto lang = langs.front();
|
||||
prioritizedLangs.push_back(lang);
|
||||
auto const similarLangs = GetSimilarLanguages(lang);
|
||||
prioritizedLangs.insert(prioritizedLangs.cend(), similarLangs.cbegin(), similarLangs.cend());
|
||||
}
|
||||
@@ -157,8 +179,7 @@ vector<int8_t> PrioritizedLanguages(vector<int8_t> const & langs, int8_t default
|
||||
|
||||
void GetReadableNameImpl(NameParamsIn const & in, bool preferDefault, NameParamsOut & out)
|
||||
{
|
||||
auto const preferredLangs = languages::GetPreferredLangIndexes();
|
||||
auto const langPriority = PrioritizedLanguages(preferredLangs, DefaultLanguage(in.regionData, preferredLangs));
|
||||
auto const langPriority = PrioritizedLanguages(in.regionData);
|
||||
|
||||
if (GetBestName(in.src, langPriority, out.primary))
|
||||
return;
|
||||
@@ -361,8 +382,7 @@ void GetPreferredNames(NameParamsIn const & in, NameParamsOut & out)
|
||||
if (in.IsNativeOrSimilarLang())
|
||||
return GetReadableNameImpl(in, true /* preferDefault */, out);
|
||||
|
||||
auto const preferredLangs = languages::GetPreferredLangIndexes();
|
||||
auto const primaryCodes = PrioritizedLanguages(preferredLangs, DefaultLanguage(in.regionData, preferredLangs));
|
||||
auto const primaryCodes = PrioritizedLanguages(in.regionData);
|
||||
|
||||
if (!GetBestName(in.src, primaryCodes, out.primary) && in.allowTranslit)
|
||||
GetTransliteratedName(in.regionData, in.src, out.transliterated);
|
||||
@@ -427,17 +447,14 @@ int8_t GetNameForSearchOnBooking(RegionData const & regionData, StringUtf8Multil
|
||||
}
|
||||
*/
|
||||
|
||||
bool GetPreferredName(StringUtf8Multilang const & src, int8_t deviceLang, string_view & out)
|
||||
bool GetPreferredName(StringUtf8Multilang const & src, string_view & out)
|
||||
{
|
||||
auto const preferredLangs = languages::GetPreferredLangIndexes();
|
||||
auto const priorityList = PrioritizedLanguages(preferredLangs, StrUtf8::kUnsupportedLanguageCode);
|
||||
return GetBestName(src, priorityList, out);
|
||||
return GetBestName(src, PrioritizedLanguages(), out);
|
||||
}
|
||||
|
||||
vector<int8_t> GetDescriptionLangPriority(RegionData const & regionData)
|
||||
{
|
||||
auto const preferredLangs = languages::GetPreferredLangIndexes();
|
||||
return PrioritizedLanguages(preferredLangs, DefaultLanguage(regionData, preferredLangs));
|
||||
return PrioritizedLanguages(regionData);
|
||||
}
|
||||
|
||||
vector<string> GetCuisines(TypesHolder const & types)
|
||||
|
||||
@@ -137,7 +137,7 @@ std::string const GetReadableAddress(std::string const & address);
|
||||
// int8_t GetNameForSearchOnBooking(RegionData const & regionData, StringUtf8Multilang const & src, std::string & name);
|
||||
|
||||
/// Returns preferred name when only the device language is available.
|
||||
bool GetPreferredName(StringUtf8Multilang const & src, int8_t deviceLang, std::string_view & out);
|
||||
bool GetPreferredName(StringUtf8Multilang const & src, std::string_view & out);
|
||||
|
||||
/// Returns priority list of language codes for feature description,
|
||||
/// the priority is the following:
|
||||
|
||||
@@ -81,10 +81,12 @@ public:
|
||||
|
||||
MwmTypeT GetType() const;
|
||||
|
||||
// Switch to following simplified code after this pull request has been included in one release:
|
||||
// feature::RegionData GetRegionData() const { return m_data; }
|
||||
feature::RegionData GetRegionData() const {
|
||||
auto regionData = m_data;
|
||||
if (GetType() == MwmTypeT::WORLD || GetType() == MwmTypeT::COASTS) {
|
||||
regionData.SetLanguages({"int_name","en","default"});
|
||||
regionData.SetLanguages({});
|
||||
}
|
||||
return regionData;
|
||||
}
|
||||
|
||||
@@ -31,10 +31,8 @@ std::string GetPreferredBookmarkStr(LocalizableString const & name, std::string
|
||||
for (auto const & pair : name)
|
||||
nameMultilang.AddString(pair.first, pair.second);
|
||||
|
||||
auto const deviceLang = StringUtf8Multilang::GetLangIndex(languageNorm);
|
||||
|
||||
std::string_view preferredName;
|
||||
if (feature::GetPreferredName(nameMultilang, deviceLang, preferredName))
|
||||
if (feature::GetPreferredName(nameMultilang, preferredName))
|
||||
return std::string(preferredName);
|
||||
|
||||
return {};
|
||||
|
||||
@@ -22,6 +22,7 @@ using std::string;
|
||||
|
||||
std::string_view kMeasurementUnits = "Units";
|
||||
std::string_view kMapLanguageCode = "MapLanguageCode";
|
||||
std::string_view kMapLanguageLimitAlternativesToLocal = "MapLanguageLimitAlternativesToLocal";
|
||||
std::string_view kDeveloperMode = "DeveloperMode";
|
||||
std::string_view kDonateUrl = "DonateUrl";
|
||||
std::string_view kNY = "NY";
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace settings
|
||||
extern std::string_view kMeasurementUnits;
|
||||
extern std::string_view kDeveloperMode;
|
||||
extern std::string_view kMapLanguageCode;
|
||||
extern std::string_view kMapLanguageLimitAlternativesToLocal;
|
||||
// The following two settings are configured externally at the metaserver.
|
||||
extern std::string_view kDonateUrl;
|
||||
extern std::string_view kNY;
|
||||
|
||||
@@ -115,6 +115,7 @@ copy_resources(
|
||||
colors.txt
|
||||
copyright.html
|
||||
countries.txt
|
||||
countries_meta.txt
|
||||
drules_proto_default_light.bin
|
||||
drules_proto_default_dark.bin
|
||||
drules_proto_outdoors_light.bin
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2711868B2F194FF000FD7FF3 /* feature_region_locator.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2711868A2F194FCF00FD7FF3 /* feature_region_locator.hpp */; };
|
||||
2711868D2F194FF600FD7FF3 /* feature_region_locator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2711868C2F194FF400FD7FF3 /* feature_region_locator.cpp */; };
|
||||
272CA4462F126795005A3F5B /* ftypes_subtypes.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 272CA4442F126795005A3F5B /* ftypes_subtypes.hpp */; };
|
||||
272CA4472F126795005A3F5B /* ftypes_subtypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 272CA4452F126795005A3F5B /* ftypes_subtypes.cpp */; };
|
||||
272CA44D2F12723B005A3F5B /* subtypes.csv in Resources */ = {isa = PBXBuildFile; fileRef = 272CA44C2F12723B005A3F5B /* subtypes.csv */; };
|
||||
@@ -233,6 +235,8 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2711868A2F194FCF00FD7FF3 /* feature_region_locator.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = feature_region_locator.hpp; sourceTree = "<group>"; };
|
||||
2711868C2F194FF400FD7FF3 /* feature_region_locator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = feature_region_locator.cpp; sourceTree = "<group>"; };
|
||||
272CA4442F126795005A3F5B /* ftypes_subtypes.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ftypes_subtypes.hpp; sourceTree = "<group>"; };
|
||||
272CA4452F126795005A3F5B /* ftypes_subtypes.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ftypes_subtypes.cpp; sourceTree = "<group>"; };
|
||||
272CA44C2F12723B005A3F5B /* subtypes.csv */ = {isa = PBXFileReference; lastKnownFileType = text; name = subtypes.csv; path = ../../data/subtypes.csv; sourceTree = "<group>"; };
|
||||
@@ -677,6 +681,8 @@
|
||||
675340C71A3F540F00A0A8C3 /* feature_impl.hpp */,
|
||||
6726C1CF1A49DAAC005EEA39 /* feature_meta.cpp */,
|
||||
6726C1D01A49DAAC005EEA39 /* feature_meta.hpp */,
|
||||
2711868C2F194FF400FD7FF3 /* feature_region_locator.cpp */,
|
||||
2711868A2F194FCF00FD7FF3 /* feature_region_locator.hpp */,
|
||||
675340CC1A3F540F00A0A8C3 /* feature_processor.hpp */,
|
||||
675B562120D25C9800A521D2 /* feature_source.cpp */,
|
||||
675B562220D25C9800A521D2 /* feature_source.hpp */,
|
||||
@@ -794,6 +800,7 @@
|
||||
6753414C1A3F540F00A0A8C3 /* tree_structure.hpp in Headers */,
|
||||
F6DF5F311CD0FD9A00A87154 /* categories_index.hpp in Headers */,
|
||||
40662D32236059BF006A124D /* tree_node.hpp in Headers */,
|
||||
2711868B2F194FF000FD7FF3 /* feature_region_locator.hpp in Headers */,
|
||||
347F337D1C454242009758CC /* succinct_trie_builder.hpp in Headers */,
|
||||
675341381A3F540F00A0A8C3 /* mwm_set.hpp in Headers */,
|
||||
456E1B181F90E5B7009C32E1 /* cities_boundaries_serdes.hpp in Headers */,
|
||||
@@ -945,7 +952,7 @@
|
||||
3496ABA31DC1FA7200C5DDBA /* editor.config in Resources */,
|
||||
3496AB9D1DC1FA5200C5DDBA /* drules_proto_clear.bin in Resources */,
|
||||
3496AB9E1DC1FA5200C5DDBA /* drules_proto_dark.bin in Resources */,
|
||||
272CA44D2F12723B005A3F5B /* subtypes.csv in Resources */,
|
||||
272CA44D2F12723B005A3F5B /* subtypes.csv in Resources */,
|
||||
FA67C84F26BB36D700B33DCA /* categories_brands.txt in Resources */,
|
||||
FA67C84626BB356800B33DCA /* categories_cuisines.txt in Resources */,
|
||||
3496ABA11DC1FA5200C5DDBA /* drules_proto.bin in Resources */,
|
||||
@@ -1041,6 +1048,7 @@
|
||||
272CA4472F126795005A3F5B /* ftypes_subtypes.cpp in Sources */,
|
||||
BBB7060F23E46E0100A7F29A /* isolines_info.cpp in Sources */,
|
||||
408FE47724FEB95600F5D06D /* metadata_serdes.cpp in Sources */,
|
||||
2711868D2F194FF600FD7FF3 /* feature_region_locator.cpp in Sources */,
|
||||
34583BCB1C88552100F94664 /* map_object.cpp in Sources */,
|
||||
675B562320D25C9800A521D2 /* feature_source.cpp in Sources */,
|
||||
6753412E1A3F540F00A0A8C3 /* index_builder.cpp in Sources */,
|
||||
|
||||
Reference in New Issue
Block a user