Compare commits

..

2 Commits

Author SHA1 Message Date
map-per
876616ad1d [editor] Add alt and old name to language selection
Signed-off-by: map-per <map-per@gmx.de>
2026-01-09 20:31:41 +01:00
map-per
88c0860a3c [edior] Reliably hide existingLanguages
Signed-off-by: map-per <map-per@gmx.de>
2026-01-09 20:15:22 +01:00
53 changed files with 192 additions and 7 deletions

View File

@@ -237,7 +237,7 @@ public class EditorHostFragment
for (LocalizedName name : sNames)
languages.add(name.lang);
args.putStringArrayList(LanguagesFragment.EXISTING_LOCALIZED_NAMES, languages);
args.putBoolean(LanguagesFragment.INCLUDE_LOCAL_LANGUAGE, false);
args.putBoolean(LanguagesFragment.IS_MAP_LANGUAGE_SELECTION, false);
editWithFragment(Mode.LANGUAGE, R.string.choose_language, args, LanguagesFragment.class, false);
}

View File

@@ -25,7 +25,7 @@ import java.util.Set;
public class LanguagesFragment extends BaseMwmRecyclerFragment<LanguagesAdapter>
{
final static String EXISTING_LOCALIZED_NAMES = "ExistingLocalizedNames";
final static String INCLUDE_LOCAL_LANGUAGE = "IncludeLocalLanguage";
final static String IS_MAP_LANGUAGE_SELECTION = "IsMapLanguageSelection";
public interface Listener
{
@@ -39,8 +39,8 @@ public class LanguagesFragment extends BaseMwmRecyclerFragment<LanguagesAdapter>
protected LanguagesAdapter createAdapter()
{
Bundle args = getArguments();
boolean includeLocalLanguage =
args != null ? args.getBoolean(INCLUDE_LOCAL_LANGUAGE) : true;
boolean isMapLanguageSelection =
args != null ? args.getBoolean(IS_MAP_LANGUAGE_SELECTION) : true;
Set<String> existingLanguages =
args != null ? new HashSet<>(args.getStringArrayList(EXISTING_LOCALIZED_NAMES)) : new HashSet<>();
@@ -52,8 +52,14 @@ public class LanguagesFragment extends BaseMwmRecyclerFragment<LanguagesAdapter>
for (int i = 0; i < systemLocales.size(); i++)
systemLanguages.add(null);
for (Language lang : Editor.nativeGetSupportedLanguages(false))
// service languages are old_name, alt_name, ...
boolean includeServiceLangs = !isMapLanguageSelection;
for (Language lang : Editor.nativeGetSupportedLanguages(includeServiceLangs))
{
if (existingLanguages.contains(lang.code))
continue;
// Separately extract system languages
for (int i = 0; i < systemLocales.size(); i++)
{
@@ -65,7 +71,7 @@ public class LanguagesFragment extends BaseMwmRecyclerFragment<LanguagesAdapter>
}
}
if (existingLanguages.contains(lang.code) || systemLanguages.contains(lang))
if (systemLanguages.contains(lang))
continue;
languages.add(lang);
@@ -75,7 +81,7 @@ public class LanguagesFragment extends BaseMwmRecyclerFragment<LanguagesAdapter>
languages.addAll(0, systemLanguages.stream().filter(Objects::nonNull).toList());
if (includeLocalLanguage) {
if (isMapLanguageSelection) {
String localLanguageLabel = getString(R.string.pref_maplanguage_local);
Language localLanguage = new Language(DEFAULT_LANG_CODE, localLanguageLabel);
languages.add(0, localLanguage);

View File

@@ -19,6 +19,9 @@ NS_SWIFT_NAME(SettingsBridge)
+ (BOOL)zoomButtonsEnabled;
+ (void)setZoomButtonsEnabled:(BOOL)zoomButtonsEnabled;
+ (BOOL)compassCalibrationEnabled;
+ (void)setCompassCalibrationEnabled:(BOOL)compassCalibrationEnabled;
+ (MWMTheme)theme;
+ (void)setTheme:(MWMTheme)theme;

View File

@@ -12,6 +12,7 @@ namespace
{
char const * kAutoDownloadEnabledKey = "AutoDownloadEnabled";
char const * kZoomButtonsEnabledKey = "ZoomButtonsEnabled";
char const * kCompassCalibrationEnabledKey = "CompassCalibrationEnabled";
char const * kMapLanguageCode = "MapLanguageCode";
char const * kRoutingDisclaimerApprovedKey = "IsDisclaimerApproved";
@@ -115,6 +116,18 @@ NSString * const kUDFileLoggingEnabledKey = @"FileLoggingEnabledKey";
[MWMMapViewControlsManager manager].zoomHidden = !zoomButtonsEnabled;
}
+ (BOOL)compassCalibrationEnabled
{
bool enabled = true;
UNUSED_VALUE(settings::Get(kCompassCalibrationEnabledKey, enabled));
return enabled;
}
+ (void)setCompassCalibrationEnabled:(BOOL)compassCalibrationEnabled
{
settings::Set(kCompassCalibrationEnabledKey, static_cast<bool>(compassCalibrationEnabled));
}
+ (MWMTheme)theme
{
if ([MWMCarPlayService shared].isCarplayActivated) {

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "E-posstuurfout";
/* Settings item title */
"pref_calibration_title" = "Kompaskalibrering";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Langtik weer op die kaart om die koppelvlak te sien";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "حدث خطأ في إرسال البريد الإلكتروني";
/* Settings item title */
"pref_calibration_title" = "معايرة البوصلة";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "اضغط مطولاً على الخريطة مرة أخرى لرؤية الواجهة";

View File

@@ -333,6 +333,9 @@
/* Alert title */
"email_error_title" = "E-poçt göndərmə xətası";
/* Settings item title */
"pref_calibration_title" = "Kompas kalibrlənməsi";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "İnterfeysi görmək üçün yenidən xəritəyə uzun müddət toxunun";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "Памылка пры адпраўцы пошты";
/* Settings item title */
"pref_calibration_title" = "Каліброўка компаса";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Паўторнае працяглае націсканне верне бачнасць інтэрфейсу";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "Грешка при изпращане на поща";
/* Settings item title */
"pref_calibration_title" = "Калибриране на компас";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Докоснете отново картата, за да видите интерфейса";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "S'ha produït un error en enviar el correu";
/* Settings item title */
"pref_calibration_title" = "Calibratge de la brúixola";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Toqueu llargament el mapa de nou per veure la interfície";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "Chyba při odesílání emailu";
/* Settings item title */
"pref_calibration_title" = "Kalibrace kompasu";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Dlouhým klepnutím na mapu znovu zobrazíte rozhraní";

View File

@@ -333,6 +333,9 @@
/* Alert title */
"email_error_title" = "Mailforsendelsesfejl";
/* Settings item title */
"pref_calibration_title" = "Kalibrering af kompas";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Tryk længe på kortet igen for at se grænsefladen";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "Fehler beim E-Mail-Versand";
/* Settings item title */
"pref_calibration_title" = "Kompass-Kalibrierung";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Tippe erneut lange auf die Karte, um die Benutzeroberfläche wiederzusehen";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "Σφάλμα κατά την αποστολή του e-mail";
/* Settings item title */
"pref_calibration_title" = "Καλιμπράρισμα πυξίδας";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Πατήστε ξανά παρατεταμένα στο χάρτη για να δείτε το περιβάλλον εργασίας";

View File

@@ -352,6 +352,9 @@
/* Alert title */
"email_error_title" = "Error sending email";
/* Settings item title */
"pref_calibration_title" = "Compass calibration";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Long-tap on the map again to see the interface";

View File

@@ -363,6 +363,9 @@
/* Alert title */
"email_error_title" = "Error sending email";
/* Settings item title */
"pref_calibration_title" = "Compass calibration";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Long-tap on the map again to see the interface";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "Error de envío de correo";
/* Settings item title */
"pref_calibration_title" = "Calibración de la brújula";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Vuelve a pulsar prolongadamente sobre el mapa para ver la interfaz";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "Error de envío de correo";
/* Settings item title */
"pref_calibration_title" = "Calibración de la brújula";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Vuelva a pulsar prolongadamente sobre el mapa para ver la interfaz";

View File

@@ -333,6 +333,9 @@
/* Alert title */
"email_error_title" = "Viga teate saatmisel";
/* Settings item title */
"pref_calibration_title" = "Kompassi kalibreerimine";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Kasutajaliidese nägemiseks vajuta kaarti pikalt";

View File

@@ -333,6 +333,9 @@
/* Alert title */
"email_error_title" = "Errore bat mezua bidaltzean";
/* Settings item title */
"pref_calibration_title" = "Iparrorratzaren kalibrazioa";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Sakatu luze berriro mapan interfazea ikusteko";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "خطا در ارسال ایمیل";
/* Settings item title */
"pref_calibration_title" = "تنظیم کردن قطب نما";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "دوباره روی نقشه ضربه طولانی بزنید تا رابط کاربری را ببینید";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "Virhe lähetettäessä viestiä";
/* Settings item title */
"pref_calibration_title" = "Kompassin kalibrointi";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Paina karttaa pitkään uudelleen nähdäksesi käyttöliittymän";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "Erreur denvoi de courriel";
/* Settings item title */
"pref_calibration_title" = "Étalonnage de la boussole";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Appuyez à nouveau longuement sur la carte pour voir linterface";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "שגיאה בשליחת דוא\"ל";
/* Settings item title */
"pref_calibration_title" = "כיול המצפן";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "לחץ לחיצה ארוכה במפה כדי להציג את הממשק";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "ईमेल भेजने में त्रुटि";
/* Settings item title */
"pref_calibration_title" = "कम्पास अंशांकन";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "इंटरफ़ेस देखने के लिए मानचित्र पर फिर से देर तक टैप करें";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "Hiba az e-mail küldése során";
/* Settings item title */
"pref_calibration_title" = "Iránytű kalibrálása";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Érintse meg újra hosszan a térképet a kezelőfelület megjelenítéséhez";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "Gangguan pengiriman surel";
/* Settings item title */
"pref_calibration_title" = "Kalibrasi kompas";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Ketuk lama pada peta sekali lagi untuk melihat antarmuka";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "Errore invio e-mail";
/* Settings item title */
"pref_calibration_title" = "Calibrazione bussola";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Tocca di nuovo a lungo sulla mappa per visualizzare l'interfaccia";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "メール送信エラー";
/* Settings item title */
"pref_calibration_title" = "コンパスの調整";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "インターフェイスを見るには、もう一度地図をロングタップする";

View File

@@ -329,6 +329,9 @@
/* Alert title */
"email_error_title" = "메일 전송 중 오류";
/* Settings item title */
"pref_calibration_title" = "나침반 보정";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "지도를 다시 길게 탭하면 인터페이스가 표시됩니다.";

View File

@@ -333,6 +333,9 @@
/* Alert title */
"email_error_title" = "Klaida siunčiant laišką";
/* Settings item title */
"pref_calibration_title" = "Kompaso kalibravimas";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Bakstelėkite ir palaikykite žemėlapį vėl, kad pamatytumėte sąsają";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "Kļūda, nosūtot vēstuli";
/* Settings item title */
"pref_calibration_title" = "Kompasa kalibrēšana";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Vēlreiz piespiediet un paturiet uz kartes, lai redzētu saskarni";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "मेल पाठवताना त्रुटी";
/* Settings item title */
"pref_calibration_title" = "होकायंत्र अंशशोधन";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "इंटरफेस पाहण्यासाठी पुन्हा नकाशावर दीर्घ टॅप करा";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "Żball meta bgħatt e-mejl";
/* Settings item title */
"pref_calibration_title" = "Kalibrazzjoni tal-boxxla";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Itteppja fit-tul darb oħra fuq il-mappa biex tara l-interface";

View File

@@ -333,6 +333,9 @@
/* Alert title */
"email_error_title" = "Feil ved sending av e-post";
/* Settings item title */
"pref_calibration_title" = "Kompasskalibrering";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Trykk lenge på kartet igjen for å se grensesnittet";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "E-mail verzendfout";
/* Settings item title */
"pref_calibration_title" = "Kompaskalibratie";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Tik nogmaals lang op de kaart om de interface te zien";

View File

@@ -333,6 +333,9 @@
/* Alert title */
"email_error_title" = "Błąd wysyłania wiadomości";
/* Settings item title */
"pref_calibration_title" = "Kalibracja kompasu";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Ponownie dotknij długo mapy, aby wyświetlić interfejs";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "Erro no envio de email";
/* Settings item title */
"pref_calibration_title" = "Calibração da bússola";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Dê um toque longo no mapa novamente para ver a interface";

View File

@@ -333,6 +333,9 @@
/* Alert title */
"email_error_title" = "Erro ao enviar o email";
/* Settings item title */
"pref_calibration_title" = "Calibração da bússola";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Dê um toque longo no mapa novamente para ver a interface";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "Eroare de trimitere e-mail";
/* Settings item title */
"pref_calibration_title" = "Calibrare busolă";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Atingeți lung pe hartă din nou pentru a vedea interfața";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "Ошибка при отправлении письма";
/* Settings item title */
"pref_calibration_title" = "Калибровка компаса";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Долгое нажатие на карту вернет интерфейс обратно";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "Chyba pri odosielaní emailu";
/* Settings item title */
"pref_calibration_title" = "Kalibrácia kompasu";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Opätovným dlhým ťuknutím na mapu zobrazíte rozhranie";

View File

@@ -333,6 +333,9 @@
/* Alert title */
"email_error_title" = "Грешка приликом слања email-а";
/* Settings item title */
"pref_calibration_title" = "Калибрација компаса";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Додирните дуго мапу да бисте поново видели интерфејс";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "Fel när mailet skulle skickas";
/* Settings item title */
"pref_calibration_title" = "Kompasskalibrering";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Tryck länge på kartan för att se gränssnittet";

View File

@@ -320,6 +320,9 @@
/* Alert title */
"email_error_title" = "Error sending email";
/* Settings item title */
"pref_calibration_title" = "Compass calibration";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Gusa kwa muda mrefu kwenye ramani tena ili kuona kiolesura";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "จดหมายที่ส่งเกิดความผิดพลาด";
/* Settings item title */
"pref_calibration_title" = "การปรับเทียบเข็มทิศ";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "แตะยาวบนแผนที่อีกครั้งเพื่อดูอินเทอร์เฟซ";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "E-Posta gönderme hatası";
/* Settings item title */
"pref_calibration_title" = "Pusula kalibrasyonu";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Seçenekleri görmek için haritaya tekrar basılı tutun";

View File

@@ -333,6 +333,9 @@
/* Alert title */
"email_error_title" = "Помилка при відправленні листа";
/* Settings item title */
"pref_calibration_title" = "Калібрування компаса";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Ще раз потримайте палець на карті, щоб побачити інтерфейс";

View File

@@ -330,6 +330,9 @@
/* Alert title */
"email_error_title" = "Lỗi gửi thư";
/* Settings item title */
"pref_calibration_title" = "Chuẩn hóa la bàn";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "Nhấn và giữ lại vào bản đồ để xem giao diện";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "电子邮件发送失败";
/* Settings item title */
"pref_calibration_title" = "指南针校准";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "再次长按地图即可查看界面";

View File

@@ -336,6 +336,9 @@
/* Alert title */
"email_error_title" = "電子郵件發送失敗";
/* Settings item title */
"pref_calibration_title" = "校正指南針";
/* Toast text when user hides UI with a long tap anywhere on the map */
"long_tap_toast" = "再次長按地圖即可查看介面";

View File

@@ -167,6 +167,17 @@ import AVFoundation
}
/// If the compass should be calibrated
@objc static var shouldCalibrateCompass: Bool {
get {
return SettingsBridge.compassCalibrationEnabled()
}
set {
SettingsBridge.setCompassCalibrationEnabled(newValue)
}
}
/// The current map appearance
@objc static var mapAppearance: Appearance {
get {

View File

@@ -60,6 +60,10 @@ struct SettingsView: View {
@State private var isSyncPossible: Bool = true
/// If the compass should be calibrated
@State private var shouldCalibrateCompass: Bool = true
/// The selected power saving mode
@State private var selectedPowerSavingMode: Settings.PowerSavingMode = .never
@@ -234,6 +238,9 @@ struct SettingsView: View {
Text("pref_appearance_title")
}
Toggle("pref_calibration_title", isOn: $shouldCalibrateCompass)
.tint(.accent)
Picker(selection: $selectedPowerSavingMode) {
ForEach(Settings.PowerSavingMode.allCases) { powerSavingMode in
Text(powerSavingMode.description)
@@ -293,6 +300,7 @@ struct SettingsView: View {
selectedMapAppearance = Settings.mapAppearance
selectedAppearance = Settings.appearance
shouldSync = Settings.shouldSync
shouldCalibrateCompass = Settings.shouldCalibrateCompass
selectedPowerSavingMode = Settings.powerSavingMode
selectedMobileDataPolicy = Settings.mobileDataPolicy
isLogging = Settings.isLogging
@@ -337,6 +345,9 @@ struct SettingsView: View {
Settings.shouldSync = changedShouldSync
}
}
.onChange(of: shouldCalibrateCompass) { changedShouldCalibrateCompass in
Settings.shouldCalibrateCompass = changedShouldCalibrateCompass
}
.onChange(of: selectedPowerSavingMode) { changedSelectedPowerSavingMode in
Settings.powerSavingMode = changedSelectedPowerSavingMode
}