Files
simplex-chat/apps/ios/Shared/Views/UserSettings/UserAddressView.swift
T
Evgeny ee51168374 core, ui: improve name resolution (#7209)
* ios: debug name resolution

* remove log

* ui: translations (#7210)

* Translated using Weblate (French)

Currently translated at 84.1% (2390 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/fr/

* Translated using Weblate (Italian)

Currently translated at 98.4% (2795 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/it/

* Translated using Weblate (Spanish)

Currently translated at 98.2% (2790 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/es/

* Translated using Weblate (Dutch)

Currently translated at 83.9% (2385 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/nl/

* Translated using Weblate (Hindi)

Currently translated at 9.6% (275 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/hi/

* Translated using Weblate (Czech)

Currently translated at 95.4% (2710 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/cs/

* Translated using Weblate (Ukrainian)

Currently translated at 87.2% (2477 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/uk/

* Translated using Weblate (Finnish)

Currently translated at 50.3% (1430 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/fi/

* Translated using Weblate (Korean)

Currently translated at 51.6% (1466 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/ko/

* Translated using Weblate (Polish)

Currently translated at 88.7% (2520 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/pl/

* Translated using Weblate (Portuguese)

Currently translated at 33.0% (939 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/pt/

* Translated using Weblate (Hebrew)

Currently translated at 72.6% (2062 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/he/

* Translated using Weblate (Thai)

Currently translated at 43.5% (1236 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/th/

* Translated using Weblate (Thai)

Currently translated at 43.5% (1236 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/th/

* Translated using Weblate (Bulgarian)

Currently translated at 87.2% (2479 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/bg/

* Translated using Weblate (Turkish)

Currently translated at 86.0% (2445 of 2840 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/tr/

* Translated using Weblate (German)

Currently translated at 100.0% (2843 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/de/

* Translated using Weblate (German)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/de/

* Translated using Weblate (Italian)

Currently translated at 100.0% (2843 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/it/

* Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 98.5% (2803 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/zh_Hans/

* Translated using Weblate (Hungarian)

Currently translated at 100.0% (2843 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/hu/

* Translated using Weblate (Hungarian)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/hu/

* Translated using Weblate (Arabic)

Currently translated at 100.0% (2843 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/ar/

* Translated using Weblate (Vietnamese)

Currently translated at 84.2% (2396 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/vi/

* Translated using Weblate (Italian)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/it/

* Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 99.9% (2842 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/zh_Hans/

* Translated using Weblate (Vietnamese)

Currently translated at 85.5% (2433 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/vi/

* Translated using Weblate (German)

Currently translated at 100.0% (2843 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/de/

* Translated using Weblate (German)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/de/

* Translated using Weblate (Hindi)

Currently translated at 9.8% (281 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/hi/

* Translated using Weblate (Indonesian)

Currently translated at 89.5% (2547 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/id/

* Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 88.1% (2149 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/zh_Hans/

* Translated using Weblate (Russian)

Currently translated at 97.4% (2771 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/ru/

* Translated using Weblate (French)

Currently translated at 78.9% (1926 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/fr/

* Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 89.3% (2180 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/zh_Hans/

* Translated using Weblate (Spanish)

Currently translated at 98.1% (2789 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/es/

* Translated using Weblate (Japanese)

Currently translated at 49.5% (1209 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/ja/

* Translated using Weblate (Hindi)

Currently translated at 10.2% (292 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/hi/

* Translated using Weblate (Czech)

Currently translated at 95.5% (2717 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/cs/

* Translated using Weblate (Romanian)

Currently translated at 88.3% (2511 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/ro/

* Translated using Weblate (Vietnamese)

Currently translated at 86.1% (2449 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/vi/

* Translated using Weblate (Indonesian)

Currently translated at 94.3% (2683 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/id/

* Translated using Weblate (Danish)

Currently translated at 30.7% (875 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/da/

* Translated using Weblate (Spanish)

Currently translated at 98.8% (2411 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/es/

* Translated using Weblate (Ukrainian)

Currently translated at 89.9% (2557 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/uk/

* Translated using Weblate (Ukrainian)

Currently translated at 87.8% (2143 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/uk/

* Translated using Weblate (Vietnamese)

Currently translated at 87.4% (2485 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/vi/

* Translated using Weblate (Vietnamese)

Currently translated at 87.4% (2485 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/vi/

* Translated using Weblate (Ukrainian)

Currently translated at 90.0% (2559 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/uk/

* Translated using Weblate (Ukrainian)

Currently translated at 93.7% (2664 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/uk/

* Translated using Weblate (Ukrainian)

Currently translated at 93.7% (2664 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/uk/

* Translated using Weblate (Ukrainian)

Currently translated at 93.7% (2664 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/uk/

* Translated using Weblate (Ukrainian)

Currently translated at 88.0% (2148 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/uk/

* Translated using Weblate (Greek)

Currently translated at 1.0% (25 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/el/

* Translated using Weblate (Spanish)

Currently translated at 99.7% (2837 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/es/

* Translated using Weblate (Spanish)

Currently translated at 99.7% (2432 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/es/

* Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 89.4% (2182 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/zh_Hans/

* Translated using Weblate (Chinese (Traditional Han script))

Currently translated at 47.0% (1148 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/zh_Hant/

* Translated using Weblate (Spanish)

Currently translated at 99.7% (2433 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/es/

* Translated using Weblate (Turkish)

Currently translated at 88.4% (2514 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/tr/

* Translated using Weblate (Indonesian)

Currently translated at 94.4% (2686 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/id/

* Translated using Weblate (Russian)

Currently translated at 97.5% (2774 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/ru/

* Translated using Weblate (Russian)

Currently translated at 97.6% (2382 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/ru/

* Translated using Weblate (French)

Currently translated at 80.8% (1972 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/fr/

* Translated using Weblate (Italian)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/it/

* Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/zh_Hans/

* Translated using Weblate (Chinese (Traditional Han script))

Currently translated at 98.7% (2808 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/zh_Hant/

* Translated using Weblate (Chinese (Traditional Han script))

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/zh_Hant/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (2843 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/es/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (2843 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/es/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/es/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/es/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/es/

* Translated using Weblate (Indonesian)

Currently translated at 94.7% (2694 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/id/

* Update translation files

Updated by "Remove blank strings" hook in Weblate.

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/

* Translated using Weblate (German)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/de/

* Translated using Weblate (French)

Currently translated at 85.4% (2084 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/fr/

* Translated using Weblate (Italian)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/it/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (2843 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/es/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/es/

* Translated using Weblate (Japanese)

Currently translated at 99.0% (2815 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/ja/

* Translated using Weblate (Indonesian)

Currently translated at 95.4% (2713 of 2843 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/id/

* Translated using Weblate (German)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/de/

* Translated using Weblate (French)

Currently translated at 87.5% (2136 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/fr/

* Translated using Weblate (French)

Currently translated at 87.5% (2136 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/fr/

* Translated using Weblate (French)

Currently translated at 88.0% (2147 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/fr/

* Translated using Weblate (French)

Currently translated at 89.2% (2178 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/fr/

* Translated using Weblate (Italian)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/it/

* Translated using Weblate (German)

Currently translated at 100.0% (2866 of 2866 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/de/

* Translated using Weblate (German)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/de/

* Translated using Weblate (German)

Currently translated at 100.0% (2439 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/de/

* Translated using Weblate (French)

Currently translated at 94.9% (2316 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/fr/

* Translated using Weblate (Italian)

Currently translated at 100.0% (2866 of 2866 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/it/

* Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 99.9% (2865 of 2866 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/zh_Hans/

* Translated using Weblate (Japanese)

Currently translated at 49.9% (1219 of 2439 strings)

Translation: SimpleX Chat/SimpleX Chat iOS
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/ios/ja/

* Translated using Weblate (Arabic)

Currently translated at 100.0% (2866 of 2866 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/ar/

* Translated using Weblate (Hungarian)

Currently translated at 100.0% (2866 of 2866 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/hu/

* Translated using Weblate (Russian)

Currently translated at 97.9% (2807 of 2866 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/ru/

* Translated using Weblate (Russian)

Currently translated at 97.9% (2807 of 2866 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/ru/

* Translated using Weblate (Russian)

Currently translated at 97.9% (2807 of 2866 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/ru/

* Translated using Weblate (Turkish)

Currently translated at 98.7% (2829 of 2866 strings)

Translation: SimpleX Chat/SimpleX Chat Android
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/android/tr/

* process localizations

* fix android translations

* ui: fix translation errors and revert Turkish vandalism (PR #7206 review)

Corrects issues found reviewing the incoming translations across 20 languages.

CRITICAL:
- Turkish: revert 8 vandalized strings to faithful translations — the
  "Open external link?" security dialog, app-upgrade prompt, relay-status
  labels, and the "Privacy: for owners and subscribers" line had been
  replaced with joke/offensive text.
- Ukrainian: fix a files/media privacy toggle that showed an unrelated
  "chat with admins" string.

HIGH/MEDIUM: badge voice/tense inversions (uk, vi, ro, de), meaning
mistranslations (fr, es, id, vi, zh-Hans, ja, nl, ru), the Danish relay-bar
"/" separator loss, re-added role-name quotes (de, es, it, ar, ru, zh-Hans,
zh-Hant), restored dropped \n line breaks and sentences (id), and typos
(hu, es, uk, ro, cs, bg).

Placeholders, XML well-formedness, and .strings validity verified intact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ui: revert residual Turkish vandalism (Owner→Emperor)

Second-pass review caught vandalized strings missed in the first fix round:
- member_info_section_title_owner: "İmparator" (Emperor) → "Sahip" (Owner)
- channel_members_section_owners: "İmparatorlar ve katkıda bulunanlar"
  (Emperors and contributors) → "Sahipler ve katkıda bulunanlar"
- migrate: "Göç" (emigration) → "Taşı" (correct verb for the Migrate action)

Same vandal (mehmetksm@tuta.io) as the strings reverted in 9b5486bfa.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ui: translate romanized Hindi connect-flow strings

Second-pass reconciliation caught 6 Hindi strings left as broken "Hinglish"
(English words in Devanagari / untranslated) that were missed in the first
fix round — now proper Hindi:
- connect_via_contact_link, connect_via_invitation_link,
  connect_use_current_profile, connect_use_new_incognito_profile,
  connect_use_incognito_profile, profile_will_be_sent_to_contact_sending_link

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Ophiushi <41908476+ishi-sama@users.noreply.github.com>
Co-authored-by: Deleted User <noreply+6980@weblate.org>
Co-authored-by: No name <usir.alerts@onionmail.org>
Co-authored-by: John m <jvanmanen@gmail.com>
Co-authored-by: Deleted User <noreply+59251@weblate.org>
Co-authored-by: zenobit <zenobit@disroot.org>
Co-authored-by: Maksym Lukashenko <livelmaxim@gmail.com>
Co-authored-by: petri <pkajander@gmail.com>
Co-authored-by: okmepro <ix28@proton.me>
Co-authored-by: B.O.S.S <BxOxSxS@protonmail.com>
Co-authored-by: Paulo Alexandre Pereira <github@paapereira.com>
Co-authored-by: Roee Hershberg <roihershberg@protonmail.com>
Co-authored-by: Anonymous <noreply@weblate.org>
Co-authored-by: Titapa (PunPun) Chaiyakiturajai <titapapunne@gmail.com>
Co-authored-by: elgratea <weblate@fastmail.com>
Co-authored-by: xe1st <dnzkckali@gmail.com>
Co-authored-by: mlanp <github@lang.xyz>
Co-authored-by: Random <random-r@users.noreply.hosted.weblate.org>
Co-authored-by: Hosted Weblate user 54392 <hamburger2048@users.noreply.hosted.weblate.org>
Co-authored-by: summoner001 <summoner@disroot.org>
Co-authored-by: jonnysemon <jonnysemon@users.noreply.hosted.weblate.org>
Co-authored-by: Thu Pham-Anh <satoneken@gmail.com>
Co-authored-by: SquiralDot...🖤 <siaspride@gmail.com>
Co-authored-by: andiasriefail <andiasriefail2004@gmail.com>
Co-authored-by: Frank Yang <yangchuanxu@live.cn>
Co-authored-by: Artemchik Dornikov <artemchikdornikov@gmail.com>
Co-authored-by: cedev-1 <cedevserver@gmail.com>
Co-authored-by: cllih <a1482007736@163.com>
Co-authored-by: Aliet Expósito García <disturbed.prayer@gmail.com>
Co-authored-by: koreirozzu <trueworldfacts+asjfsajfhajfh@proton.me>
Co-authored-by: Bharadwaj <saibharadwajreddy09@gmail.com>
Co-authored-by: slrslr <adm@prnet.info>
Co-authored-by: Filip Ionut <iiiff222@gmail.com>
Co-authored-by: Nguyễn Xuân Cảm <nguyenxuancamit@gmail.com>
Co-authored-by: Dimas Alfa Pratama <world.russia.soviet.russia@gmail.com>
Co-authored-by: Mathias Pedersen <mathias.k.pedersen@hotmail.com>
Co-authored-by: kudebug <joel.hazas@outlook.es>
Co-authored-by: rider of the storm <pukhnobg@gmail.com>
Co-authored-by: Nguyen Thanh Long <longnt121004@gmail.com>
Co-authored-by: Fill Vj <screen4fill@gmail.com>
Co-authored-by: Stonepilot <lojide7802@httpsu.com>
Co-authored-by: Bugatsinho <bugatsinho@protonmail.com>
Co-authored-by: Darío Hereñú <magallania@gmail.com>
Co-authored-by: Loping151 <wangkailing151@gmail.com>
Co-authored-by: pahiy <ayazdoruck@gmail.com>
Co-authored-by: M Yusup Hamdani <dani.webdev@gmail.com>
Co-authored-by: lazizkhalilov <ssilkavtaganrog@icloud.com>
Co-authored-by: Игорь Линчевский <insrtnqme@gmail.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Irnovi Albaweny <huiralb@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: SHE LINGZHAO <rottesya@gmail.com>
Co-authored-by: Rafi <rafimuhmad90@protonmail.com>
Co-authored-by: ryokky3 <ryoxnasan@outlook.jp>
Co-authored-by: Auri <serg_sarov@mail.ru>
Co-authored-by: kkpanfilov <kkpanfilov@outlook.com>
Co-authored-by: echoloji <mehmetksm@tuta.io>
Co-authored-by: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* website: translations (#7207)

* Translated using Weblate (French)

Currently translated at 75.3% (281 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/

* Translated using Weblate (French)

Currently translated at 75.3% (281 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/

* Translated using Weblate (Czech)

Currently translated at 100.0% (373 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/cs/

* Translated using Weblate (Indonesian)

Currently translated at 94.1% (351 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/id/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (373 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/es/

* Translated using Weblate (French)

Currently translated at 75.3% (281 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/

* Translated using Weblate (French)

Currently translated at 75.3% (281 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/

* Translated using Weblate (Czech)

Currently translated at 100.0% (373 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/cs/

* Translated using Weblate (Indonesian)

Currently translated at 94.1% (351 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/id/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (373 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/es/

* Translated using Weblate (Japanese)

Currently translated at 79.6% (297 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/ja/

* Translated using Weblate (German)

Currently translated at 100.0% (373 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/

* Translated using Weblate (Russian)

Currently translated at 87.9% (328 of 373 strings)

Translation: SimpleX Chat/SimpleX Chat website
Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/ru/

* website: fix mistranslated security/feature terms (PR #7207 review)

- Japanese: "Repudiation" (deniability) was rendered as 否認防止
  (non-repudiation, the opposite property) — corrected to 否認可能性;
  "2-factor key exchange" was 2ファクタ認証 (authentication) — corrected
  to 2ファクタ鍵交換.
- French: message padding ("Briar pads messages to ... bytes") was
  translated as a size limit ("limite la taille") — corrected to padding
  ("complète les messages à une taille arrondie à ...").
- Simplified Chinese: the "Community Credits" feature name was rendered as
  社区声望 (community reputation) — restored to "Community Credits".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: N4TH4NOT <n4th4not@gmail.com>
Co-authored-by: cedev-1 <cedevserver@gmail.com>
Co-authored-by: slrslr <adm@prnet.info>
Co-authored-by: huzaifah <huzaifahasif3@gmail.com>
Co-authored-by: kudebug <joel.hazas@outlook.es>
Co-authored-by: ryokky3 <ryoxnasan@outlook.jp>
Co-authored-by: mlanp <github@lang.xyz>
Co-authored-by: Auri <serg_sarov@mail.ru>
Co-authored-by: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* dont change font for unverified names

* better verified names view

* better layout for verified status

* shift icon

* move icon

* set domain on business chat

* change padding

* fix, test

* add params to log

* add domain to the usual group

* add domain to BusinessChatInfo

* bot types

* remove comment

* remove comment

Co-authored-by: Evgeny <evgeny@poberezkin.com>

* fix query

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
Co-authored-by: Ophiushi <41908476+ishi-sama@users.noreply.github.com>
Co-authored-by: Deleted User <noreply+6980@weblate.org>
Co-authored-by: No name <usir.alerts@onionmail.org>
Co-authored-by: John m <jvanmanen@gmail.com>
Co-authored-by: Deleted User <noreply+59251@weblate.org>
Co-authored-by: zenobit <zenobit@disroot.org>
Co-authored-by: Maksym Lukashenko <livelmaxim@gmail.com>
Co-authored-by: petri <pkajander@gmail.com>
Co-authored-by: okmepro <ix28@proton.me>
Co-authored-by: B.O.S.S <BxOxSxS@protonmail.com>
Co-authored-by: Paulo Alexandre Pereira <github@paapereira.com>
Co-authored-by: Roee Hershberg <roihershberg@protonmail.com>
Co-authored-by: Anonymous <noreply@weblate.org>
Co-authored-by: Titapa (PunPun) Chaiyakiturajai <titapapunne@gmail.com>
Co-authored-by: elgratea <weblate@fastmail.com>
Co-authored-by: xe1st <dnzkckali@gmail.com>
Co-authored-by: mlanp <github@lang.xyz>
Co-authored-by: Random <random-r@users.noreply.hosted.weblate.org>
Co-authored-by: Hosted Weblate user 54392 <hamburger2048@users.noreply.hosted.weblate.org>
Co-authored-by: summoner001 <summoner@disroot.org>
Co-authored-by: jonnysemon <jonnysemon@users.noreply.hosted.weblate.org>
Co-authored-by: Thu Pham-Anh <satoneken@gmail.com>
Co-authored-by: SquiralDot...🖤 <siaspride@gmail.com>
Co-authored-by: andiasriefail <andiasriefail2004@gmail.com>
Co-authored-by: Frank Yang <yangchuanxu@live.cn>
Co-authored-by: Artemchik Dornikov <artemchikdornikov@gmail.com>
Co-authored-by: cedev-1 <cedevserver@gmail.com>
Co-authored-by: cllih <a1482007736@163.com>
Co-authored-by: Aliet Expósito García <disturbed.prayer@gmail.com>
Co-authored-by: koreirozzu <trueworldfacts+asjfsajfhajfh@proton.me>
Co-authored-by: Bharadwaj <saibharadwajreddy09@gmail.com>
Co-authored-by: slrslr <adm@prnet.info>
Co-authored-by: Filip Ionut <iiiff222@gmail.com>
Co-authored-by: Nguyễn Xuân Cảm <nguyenxuancamit@gmail.com>
Co-authored-by: Dimas Alfa Pratama <world.russia.soviet.russia@gmail.com>
Co-authored-by: Mathias Pedersen <mathias.k.pedersen@hotmail.com>
Co-authored-by: kudebug <joel.hazas@outlook.es>
Co-authored-by: rider of the storm <pukhnobg@gmail.com>
Co-authored-by: Nguyen Thanh Long <longnt121004@gmail.com>
Co-authored-by: Fill Vj <screen4fill@gmail.com>
Co-authored-by: Stonepilot <lojide7802@httpsu.com>
Co-authored-by: Bugatsinho <bugatsinho@protonmail.com>
Co-authored-by: Darío Hereñú <magallania@gmail.com>
Co-authored-by: Loping151 <wangkailing151@gmail.com>
Co-authored-by: pahiy <ayazdoruck@gmail.com>
Co-authored-by: M Yusup Hamdani <dani.webdev@gmail.com>
Co-authored-by: lazizkhalilov <ssilkavtaganrog@icloud.com>
Co-authored-by: Игорь Линчевский <insrtnqme@gmail.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Irnovi Albaweny <huiralb@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: SHE LINGZHAO <rottesya@gmail.com>
Co-authored-by: Rafi <rafimuhmad90@protonmail.com>
Co-authored-by: ryokky3 <ryoxnasan@outlook.jp>
Co-authored-by: Auri <serg_sarov@mail.ru>
Co-authored-by: kkpanfilov <kkpanfilov@outlook.com>
Co-authored-by: echoloji <mehmetksm@tuta.io>
Co-authored-by: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: N4TH4NOT <n4th4not@gmail.com>
Co-authored-by: huzaifah <huzaifahasif3@gmail.com>
2026-07-10 20:53:14 +01:00

780 lines
30 KiB
Swift

//
// UserAddressView.swift
// SimpleX (iOS)
//
// Created by spaced4ndy on 26.04.2023.
// Copyright © 2023 SimpleX Chat. All rights reserved.
//
import SwiftUI
import MessageUI
@preconcurrency import SimpleXChat
struct UserAddressView: View {
@Environment(\.colorScheme) var colorScheme
@Environment(\.dismiss) var dismiss: DismissAction
@EnvironmentObject private var chatModel: ChatModel
@EnvironmentObject var theme: AppTheme
@State var shareViaProfile = false
@State var autoCreate = false
var onboarding: Bool = false
@State private var showShortLink = true
@State private var settings = AddressSettingsState()
@State private var savedSettings = AddressSettingsState()
@State private var showMailView = false
@State private var mailViewResult: Result<MFMailComposeResult, Error>? = nil
@State private var alert: UserAddressAlert?
@State private var progressIndicator = false
private enum UserAddressAlert: Identifiable {
case deleteAddress
case shareOnCreate
case error(title: LocalizedStringKey, error: LocalizedStringKey?)
var id: String {
switch self {
case .deleteAddress: return "deleteAddress"
case .shareOnCreate: return "shareOnCreate"
case let .error(title, _): return "error \(title)"
}
}
}
var body: some View {
ZStack {
userAddressView()
if progressIndicator {
ZStack {
if chatModel.userAddress != nil {
Circle()
.fill(.white)
.opacity(0.7)
.frame(width: 56, height: 56)
}
ProgressView().scaleEffect(2)
}
}
}
.if(onboarding) { v in
v.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Image(systemName: "info.circle").opacity(0)
}
}
.navigationBarTitleDisplayMode(.inline)
}
.onAppear {
if chatModel.userAddress == nil, autoCreate {
createAddress()
}
}
}
private func userAddressView() -> some View {
List {
if let userAddress = chatModel.userAddress {
if onboarding {
onboardingAddressView(userAddress)
} else {
existingAddressView(userAddress)
.onAppear {
settings = AddressSettingsState(settings: userAddress.addressSettings)
savedSettings = AddressSettingsState(settings: userAddress.addressSettings)
}
}
} else if !onboarding {
Section {
createAddressButton()
} header: {
Text("For social media")
.foregroundColor(theme.colors.secondary)
}
Section {
createOneTimeLinkButton()
} header: {
Text("Or to share privately")
.foregroundColor(theme.colors.secondary)
}
Section {
learnMoreButton()
}
}
}
.alert(item: $alert) { alert in
switch alert {
case .deleteAddress:
return Alert(
title: Text("Delete address?"),
message:
shareViaProfile
? Text("All your contacts will remain connected. Profile update will be sent to your contacts.")
: Text("All your contacts will remain connected."),
primaryButton: .destructive(Text("Delete")) {
progressIndicator = true
Task {
do {
if let u = try await apiDeleteUserAddress() {
DispatchQueue.main.async {
chatModel.userAddress = nil
chatModel.updateUser(u)
if shareViaProfile {
shareViaProfile = false
}
}
}
await MainActor.run { progressIndicator = false }
} catch let error {
logger.error("UserAddressView apiDeleteUserAddress: \(responseError(error))")
await MainActor.run { progressIndicator = false }
}
}
}, secondaryButton: .cancel()
)
case .shareOnCreate:
return Alert(
title: Text("Share address with SimpleX contacts?"),
message: Text("Add address to your profile, so that your SimpleX contacts can share it with other people. Profile update will be sent to your SimpleX contacts."),
primaryButton: .default(Text("Share")) {
setProfileAddress($progressIndicator, true)
shareViaProfile = true
}, secondaryButton: .cancel()
)
case let .error(title, error):
return mkAlert(title: title, message: error)
}
}
}
@ViewBuilder private func existingAddressView(_ userAddress: UserContactLink) -> some View {
Section {
SimpleXCreatedLinkQRCode(link: userAddress.connLinkContact, short: $showShortLink)
.id("simplex-contact-address-qrcode-\(userAddress.connLinkContact.simplexChatUri(short: showShortLink))")
if userAddress.shouldBeUpgraded {
upgradeAddressButton()
}
shareAddressButton(userAddress)
// if MFMailComposeViewController.canSendMail() {
// shareViaEmailButton(userAddress)
// }
settingsRow("briefcase", color: theme.colors.secondary) {
Toggle("Business address", isOn: $settings.businessAddress)
.onChange(of: settings.businessAddress) { ba in
if ba {
settings.autoAccept = true
settings.autoAcceptIncognito = false
}
saveAddressSettings(settings, $savedSettings)
}
}
addressSettingsButton(userAddress)
} header: {
#if SIMPLEX_ASSETS
VStack(alignment: .leading, spacing: 0) {
Image(colorScheme == .light ? "simplex-address-small" : "simplex-address-small-light")
.resizable()
.scaledToFit()
.frame(maxWidth: .infinity)
.padding(.top, -20)
ToggleShortLinkHeader(text: Text("For social media"), link: userAddress.connLinkContact, short: $showShortLink)
}
.padding(.bottom, 4)
#else
ToggleShortLinkHeader(text: Text("For social media"), link: userAddress.connLinkContact, short: $showShortLink)
#endif
} footer: {
if settings.businessAddress {
Text("Add your team members to the conversations.")
.foregroundColor(theme.colors.secondary)
}
}
Section {
NavigationLink {
let simplexName = if let d = chatModel.currentUser?.profile.contactDomain?.domain { "@\(d)" } else { "" }
SetSimplexDomainView(
title: "Your SimpleX name",
footer: "Let people connect to you via name registered with your SimpleX address.",
prompt: "@yourname.testing",
simplexName: simplexName,
save: { simplexDomain in
do {
let u = try await apiSetUserDomain(simplexDomain)
await MainActor.run { chatModel.updateUser(u) }
return true
} catch {
return false
}
}
)
} label: {
Label("Your SimpleX name", systemImage: "at")
}
}
Section {
createOneTimeLinkButton()
} header: {
Text("Or to share privately")
.foregroundColor(theme.colors.secondary)
}
Section {
learnMoreButton()
}
Section {
deleteAddressButton()
} footer: {
Text("Your contacts will remain connected.")
.foregroundColor(theme.colors.secondary)
}
}
@ViewBuilder private func onboardingAddressView(_ userAddress: UserContactLink) -> some View {
Section {
HStack(spacing: 8) {
let link = userAddress.connLinkContact.simplexChatUri(short: showShortLink)
linkTextView(link)
Button { showShareSheet(items: [link]) } label: {
Image(systemName: "square.and.arrow.up")
.padding(.top, -7)
.padding(.horizontal, 8)
}
}
.frame(maxWidth: .infinity)
} header: {
#if SIMPLEX_ASSETS
VStack(alignment: .leading) {
Image(colorScheme == .light ? "simplex-address" : "simplex-address-light")
.resizable()
.scaledToFit()
.frame(maxWidth: .infinity)
Text("Use this address in your social media profile, website, or email signature.")
.font(.body).foregroundColor(theme.colors.onBackground).textCase(nil)
}
.padding(.bottom, 4)
#else
Text("Use this address in your social media profile, website, or email signature.")
.font(.body).foregroundColor(theme.colors.onBackground).textCase(nil)
.padding(.bottom, 6)
#endif
}
.listRowInsets(EdgeInsets(top: 0, leading: 20, bottom: 0, trailing: 10))
Section {
SimpleXCreatedLinkQRCode(link: userAddress.connLinkContact, short: $showShortLink)
.id("simplex-contact-address-qrcode-\(userAddress.connLinkContact.simplexChatUri(short: showShortLink))")
.padding()
.background(
RoundedRectangle(cornerRadius: 12, style: .continuous)
.fill(Color(uiColor: .secondarySystemGroupedBackground))
)
.padding(.horizontal)
.listRowBackground(Color.clear)
.listRowSeparator(.hidden)
.listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0))
} header: {
Text("Or use this QR - print or show online.").font(.body).foregroundColor(theme.colors.onBackground).textCase(nil)
}
}
private func createAddressButton() -> some View {
Button {
createAddress()
} label: {
Label("Create SimpleX address", systemImage: "qrcode")
}
}
private func createAddress() {
progressIndicator = true
Task {
do {
let connLinkContact = try await apiCreateUserAddress()
DispatchQueue.main.async {
if let connLinkContact {
chatModel.userAddress = UserContactLink(connLinkContact)
let hasRelevantContacts = chatModel.chats.contains { chat in
if case let .direct(contact) = chat.chatInfo {
return contact.active && !contact.isContactCard && !contact.contactConnIncognito
}
return false
}
if hasRelevantContacts {
alert = .shareOnCreate
progressIndicator = false
} else {
setProfileAddress($progressIndicator, true)
shareViaProfile = true
}
} else {
progressIndicator = false
}
}
} catch let error {
logger.error("UserAddressView apiCreateUserAddress: \(responseError(error))")
await MainActor.run {
progressIndicator = false
showErrorAlert(error, NSLocalizedString("Error creating address", comment: ""))
}
}
}
}
private func upgradeAddressButton() -> some View {
Button {
upgradeAndShareAddressAlert(progressIndicator: $progressIndicator)
} label: {
settingsRow("arrow.up", color: theme.colors.primary) {
Text("Upgrade address")
}
}
}
private func createOneTimeLinkButton() -> some View {
NavigationLink {
NewChatView(selection: .invite)
.navigationTitle("New chat")
.navigationBarTitleDisplayMode(.large)
.modifier(ThemedBackground(grouped: true))
} label: {
Label("Create 1-time link", systemImage: "link.badge.plus")
.foregroundColor(theme.colors.primary)
}
}
private func deleteAddressButton() -> some View {
Button(role: .destructive) {
alert = .deleteAddress
} label: {
Label("Delete address", systemImage: "trash")
.foregroundColor(Color.red)
}
}
private func shareAddressButton(_ userAddress: UserContactLink) -> some View {
return Button {
if userAddress.shouldBeUpgraded {
upgradeAndShareAddressAlert(progressIndicator: $progressIndicator, shareAddress: { userAddress.shareAddress(short: showShortLink) })
} else {
userAddress.shareAddress(short: showShortLink)
}
} label: {
settingsRow("square.and.arrow.up", color: theme.colors.secondary) {
Text("Share address")
}
}
}
private func shareViaEmailButton(_ userAddress: UserContactLink) -> some View {
Button {
showMailView = true
} label: {
settingsRow("envelope", color: theme.colors.secondary) {
Text("Invite friends")
}
}
.sheet(isPresented: $showMailView) {
SendAddressMailView(
showMailView: $showMailView,
mailViewResult: $mailViewResult,
userAddress: userAddress
)
.edgesIgnoringSafeArea(.bottom)
}
.onChange(of: mailViewResult == nil) { _ in
if let r = mailViewResult {
switch r {
case .success: ()
case let .failure(error):
logger.error("UserAddressView share via email: \(responseError(error))")
showErrorAlert(error, NSLocalizedString("Error sending email", comment: ""))
}
mailViewResult = nil
}
}
}
private func addressSettingsButton(_ userAddress: UserContactLink) -> some View {
NavigationLink {
UserAddressSettingsView(shareViaProfile: $shareViaProfile)
.navigationTitle("Address settings")
.navigationBarTitleDisplayMode(.large)
.modifier(ThemedBackground(grouped: true))
} label: {
Text("Address settings")
}
}
private func learnMoreButton() -> some View {
NavigationLink {
UserAddressLearnMore()
.navigationTitle("Address or 1-time link?")
.modifier(ThemedBackground(grouped: true))
.navigationBarTitleDisplayMode(.inline)
} label: {
settingsRow("info.circle", color: theme.colors.secondary) {
Text("SimpleX address or 1-time link?")
}
}
}
}
func upgradeAndShareAddressAlert(progressIndicator: Binding<Bool>, shareAddress: (() -> Void)? = nil) {
showAlert(
NSLocalizedString("Upgrade address?", comment: "alert message"),
message: NSLocalizedString("The address will be short, and your profile will be shared via the address.", comment: "alert message"),
actions: {
var actions = [UIAlertAction(title: NSLocalizedString("Upgrade", comment: "alert button"), style: .default) { _ in
addShortLink(progressIndicator: progressIndicator, shareOnCompletion: shareAddress != nil)
}]
if let shareAddress {
actions.append(UIAlertAction(title: NSLocalizedString("Share old address", comment: "alert button"), style: .default) { _ in
shareAddress()
})
}
actions.append(cancelAlertAction)
return actions
}
)
}
private func addShortLink(progressIndicator: Binding<Bool>, shareOnCompletion: Bool = false) {
progressIndicator.wrappedValue = true
Task {
do {
let userAddress = try await apiAddMyAddressShortLink()
await MainActor.run {
ChatModel.shared.userAddress = userAddress
progressIndicator.wrappedValue = false
if shareOnCompletion, let userAddress {
userAddress.shareAddress(short: true)
}
}
} catch let error {
logger.error("apiAddMyAddressShortLink: \(responseError(error))")
showAlert("Error adding short link", message: responseError(error))
await MainActor.run { progressIndicator.wrappedValue = false }
}
}
}
struct ToggleShortLinkHeader: View {
@EnvironmentObject var theme: AppTheme
@AppStorage(DEFAULT_DEVELOPER_TOOLS) private var developerTools = false
let text: Text
var link: CreatedConnLink
@Binding var short: Bool
var body: some View {
if link.connShortLink == nil || !developerTools {
text.foregroundColor(theme.colors.secondary)
} else {
HStack {
text.foregroundColor(theme.colors.secondary)
Spacer()
Text(short ? "Full link" : "Short link")
.textCase(.none)
.foregroundColor(theme.colors.primary)
.onTapGesture { short.toggle() }
}
}
}
}
struct AddressSettingsState: Equatable {
var businessAddress = false
var autoAccept = false
var autoAcceptIncognito = false
var autoReply = ""
init() {}
init(settings: AddressSettings) {
self.businessAddress = settings.businessAddress
self.autoAccept = settings.autoAccept != nil
self.autoAcceptIncognito = settings.autoAccept?.acceptIncognito == true
self.autoReply = settings.autoReply?.text ?? ""
}
var addressSettings: AddressSettings {
AddressSettings(
businessAddress: self.businessAddress,
autoAccept: self.autoAccept ? AutoAccept(acceptIncognito: self.autoAcceptIncognito) : nil,
autoReply: self.autoReply.isEmpty ? nil : MsgContent.text(self.autoReply)
)
}
}
private func setProfileAddress(_ progressIndicator: Binding<Bool>, _ on: Bool) {
progressIndicator.wrappedValue = true
Task {
do {
if let u = try await apiSetProfileAddress(on: on) {
DispatchQueue.main.async {
ChatModel.shared.updateUser(u)
}
}
await MainActor.run { progressIndicator.wrappedValue = false }
} catch let error {
logger.error("apiSetProfileAddress: \(responseError(error))")
await MainActor.run { progressIndicator.wrappedValue = false }
}
}
}
struct UserAddressSettingsView: View {
@Environment(\.dismiss) var dismiss: DismissAction
@EnvironmentObject var theme: AppTheme
@Binding var shareViaProfile: Bool
@State private var settings = AddressSettingsState()
@State private var savedSettings = AddressSettingsState()
@State private var ignoreShareViaProfileChange = false
@State private var progressIndicator = false
var body: some View {
ZStack {
if let userAddress = ChatModel.shared.userAddress {
userAddressSettingsView()
.onAppear {
settings = AddressSettingsState(settings: userAddress.addressSettings)
savedSettings = AddressSettingsState(settings: userAddress.addressSettings)
}
.onChange(of: settings.autoAccept) { autoAccept in
if !autoAccept {
settings.businessAddress = false
settings.autoReply = ""
}
}
.onDisappear {
if savedSettings != settings {
showAlert(
title: NSLocalizedString("SimpleX address settings", comment: "alert title"),
message: NSLocalizedString("Settings were changed.", comment: "alert message"),
buttonTitle: NSLocalizedString("Save", comment: "alert button"),
buttonAction: { saveAddressSettings(settings, $savedSettings) },
cancelButton: true
)
}
}
} else {
Text(String("Error opening address settings"))
}
if progressIndicator {
ProgressView().scaleEffect(2)
}
}
}
private func userAddressSettingsView() -> some View {
List {
Section {
shareWithContactsButton()
autoAcceptToggle().disabled(settings.businessAddress)
if settings.autoAccept && !ChatModel.shared.addressShortLinkDataSet && !settings.businessAddress {
acceptIncognitoToggle()
}
}
Section {
messageEditor(placeholder: NSLocalizedString("Enter welcome message… (optional)", comment: "placeholder"), text: $settings.autoReply)
} header: {
Text("Welcome message")
.foregroundColor(theme.colors.secondary)
}
Section {
saveAddressSettingsButton()
.disabled(settings == savedSettings)
}
}
}
private func shareWithContactsButton() -> some View {
settingsRow("person", color: theme.colors.secondary) {
Toggle("Share with SimpleX contacts", isOn: $shareViaProfile)
.onChange(of: shareViaProfile) { on in
if ignoreShareViaProfileChange {
ignoreShareViaProfileChange = false
} else {
if on {
showAlert(
NSLocalizedString("Share address with SimpleX contacts?", comment: "alert title"),
message: NSLocalizedString("Profile update will be sent to your SimpleX contacts.", comment: "alert message"),
actions: {[
UIAlertAction(
title: NSLocalizedString("Cancel", comment: "alert action"),
style: .cancel,
handler: { _ in
ignoreShareViaProfileChange = true
shareViaProfile = !on
}
),
UIAlertAction(
title: NSLocalizedString("Share", comment: "alert action"),
style: .default,
handler: { _ in
setProfileAddress($progressIndicator, on)
}
)
]}
)
} else {
showAlert(
NSLocalizedString("Stop sharing address?", comment: "alert title"),
message: NSLocalizedString("Profile update will be sent to your SimpleX contacts.", comment: "alert message"),
actions: {[
UIAlertAction(
title: NSLocalizedString("Cancel", comment: "alert action"),
style: .cancel,
handler: { _ in
ignoreShareViaProfileChange = true
shareViaProfile = !on
}
),
UIAlertAction(
title: NSLocalizedString("Stop sharing", comment: "alert action"),
style: .default,
handler: { _ in
setProfileAddress($progressIndicator, on)
}
)
]}
)
}
}
}
}
}
private func autoAcceptToggle() -> some View {
settingsRow("checkmark", color: theme.colors.secondary) {
Toggle("Auto-accept", isOn: $settings.autoAccept)
.onChange(of: settings.autoAccept) { _ in
saveAddressSettings(settings, $savedSettings)
}
}
}
private func acceptIncognitoToggle() -> some View {
settingsRow(
settings.autoAcceptIncognito ? "theatermasks.fill" : "theatermasks",
color: settings.autoAcceptIncognito ? .indigo : theme.colors.secondary
) {
Toggle("Accept incognito", isOn: $settings.autoAcceptIncognito)
}
}
private func messageEditor(placeholder: String, text: Binding<String>) -> some View {
ZStack {
Group {
if text.wrappedValue.isEmpty {
TextEditor(text: Binding.constant(placeholder))
.foregroundColor(theme.colors.secondary)
.disabled(true)
}
TextEditor(text: text)
}
.padding(.horizontal, -5)
.padding(.top, -8)
.frame(height: 90, alignment: .topLeading)
.frame(maxWidth: .infinity, alignment: .leading)
}
}
private func saveAddressSettingsButton() -> some View {
Button {
hideKeyboard()
saveAddressSettings(settings, $savedSettings)
} label: {
Text("Save")
}
}
}
private func saveAddressSettings(_ settings: AddressSettingsState, _ savedSettings: Binding<AddressSettingsState>) {
Task {
do {
if let address = try await apiSetUserAddressSettings(settings.addressSettings) {
await MainActor.run {
ChatModel.shared.userAddress = address
savedSettings.wrappedValue = settings
}
}
} catch let error {
logger.error("apiSetUserAddressSettings error: \(responseError(error))")
}
}
}
struct SetSimplexDomainView: View {
let title: LocalizedStringKey
let footer: LocalizedStringKey
let prompt: String
@State var simplexName: String
let save: (String?) async -> Bool
@Environment(\.dismiss) var dismiss
@EnvironmentObject var theme: AppTheme
@State private var saving = false
var body: some View {
List {
Section {
TextField(prompt, text: $simplexName)
.autocorrectionDisabled(true)
.textInputAutocapitalization(.never)
} header: {
Text(verbatim: "")
} footer: {
Text(footer).foregroundColor(theme.colors.secondary)
}
Section {
Button {
saving = true
Task {
let ok = await save(normalized())
await MainActor.run {
saving = false
if ok { dismiss() }
}
}
} label: {
Text("Save")
}
.disabled(saving)
}
}
.navigationTitle(title)
.navigationBarTitleDisplayMode(.large)
}
private func normalized() -> String? {
let s = simplexName.trimmingCharacters(in: .whitespacesAndNewlines)
return s.isEmpty
? nil
: addSimplexTLD(s.hasPrefix("@") || s.hasPrefix("#") ? String(s.dropFirst()) : s)
}
private func addSimplexTLD(_ d: String) -> String {
if d.contains(".") { d } else { "\(d).simplex" }
}
}
struct UserAddressView_Previews: PreviewProvider {
static var previews: some View {
let chatModel = ChatModel()
chatModel.userAddress = UserContactLink(CreatedConnLink(connFullLink: "https://simplex.chat/contact#/?v=1&smp=smp%3A%2F%2FPQUV2eL0t7OStZOoAsPEV2QYWt4-xilbakvGUGOItUo%3D%40smp6.simplex.im%2FK1rslx-m5bpXVIdMZg9NLUZ_8JBm8xTt%23MCowBQYDK2VuAyEALDeVe-sG8mRY22LsXlPgiwTNs9dbiLrNuA7f3ZMAJ2w%3D", connShortLink: nil))
return Group {
UserAddressView()
.environmentObject(chatModel)
UserAddressView()
.environmentObject(ChatModel())
}
}
}