Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -630,16 +630,13 @@ private fun ConnectionCardHeader(
}
}

@Composable
private fun GeoIpLocation?.asString(): String {
return if (this == null) ""
else {
buildString {
append(country)
if (!city.isNullOrBlank()) {
append(", ")
append(city)
}
}
val city = this?.city
return when {
this == null -> ""
city.isNullOrBlank() -> country
else -> stringResource(R.string.country_comma_city, country, city)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,14 @@ private fun RecentListItem(
onUpdateBottomSheetState: (LocationBottomSheetState) -> Unit,
) {
val subtitle =
when (listItem.item) {
is RelayItem.Location.Relay -> "${listItem.cityName}, ${listItem.countryName}"
is RelayItem.Location.City -> listItem.countryName
when (val relayItem = listItem.item) {
is RelayItem.Location.Relay ->
stringResource(
R.string.country_comma_city,
relayItem.countryName,
relayItem.cityName,
)
is RelayItem.Location.City -> relayItem.countryName
is RelayItem.Location.Country,
is RelayItem.CustomList -> null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,6 @@ sealed interface RelayListItem {
override val depth: Int = 0
override val contentType = RelayListItemContentType.RECENT_LIST_ITEM
override val canExpand: Boolean = false

val countryName: String? =
when (item) {
is RelayItem.CustomList -> null
is RelayItem.Location.City -> item.countryName
is RelayItem.Location.Country -> item.name
is RelayItem.Location.Relay -> item.countryName
}
val cityName: String? =
when (item) {
is RelayItem.CustomList -> null
is RelayItem.Location.City -> item.name
is RelayItem.Location.Country -> null
is RelayItem.Location.Relay -> item.cityName
}
}

data object RecentsListFooter : RelayListItem {
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">تم نسخ رقم حساب Mullvad إلى الحافظة</string>
<string name="copy">نسخ</string>
<string name="copy_account_number">نسخ رقم الحساب</string>
<string name="country_comma_city">%1$s، %2$s</string>
<string name="create">إنشاء</string>
<string name="create_account_fail_title">فشل إنشاء الحساب</string>
<string name="create_custom_list_message">تم إنشاء \"%1$s\"</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Kopierede Mullvad-kontonummer til udklipsholder</string>
<string name="copy">Kopiér</string>
<string name="copy_account_number">Kopiér kontonummer</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Opret</string>
<string name="create_account_fail_title">Oprettelse af konto mislykkedes</string>
<string name="create_custom_list_message">\"%1$s\" blev oprettet</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Mullvad-Kontonummer wurde in die Zwischenablage kopiert</string>
<string name="copy">Kopieren</string>
<string name="copy_account_number">Kontonummer kopieren</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Erstellen</string>
<string name="create_account_fail_title">Kontoerstellung fehlgeschlagen</string>
<string name="create_custom_list_message">„%1$s“ wurde erstellt</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">El número de cuenta de Mullvad se copió en el Portapapeles</string>
<string name="copy">Copiar</string>
<string name="copy_account_number">Copiar número de cuenta</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Crear</string>
<string name="create_account_fail_title">Error al crear la cuenta</string>
<string name="create_custom_list_message">Se ha creado «%1$s»</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">شمارهٔ حساب Mullvad در کلیپ‌بورد کپی شد</string>
<string name="copy">کپی</string>
<string name="copy_account_number">کپی کردن شمارهٔ حساب</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">ایجاد کردن</string>
<string name="create_account_fail_title">ایجاد حساب کاربری ناموفق بود</string>
<string name="create_custom_list_message">%1$s ایجاد شد</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-fi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Mullvad-tilin numero kopioitu leikepöydälle</string>
<string name="copy">Kopioi</string>
<string name="copy_account_number">Kopioi tilin numero</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Luo</string>
<string name="create_account_fail_title">Tilin luominen epäonnistui</string>
<string name="create_custom_list_message">\"%1$s\" luotiin</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Numéro de compte Mullvad copié dans le presse-papiers</string>
<string name="copy">Copier</string>
<string name="copy_account_number">Copier le numéro de compte</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Créer</string>
<string name="create_account_fail_title">Échec de la création du compte</string>
<string name="create_custom_list_message">« %1$s » a été créé</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Numero account di Mullvad copiato negli appunti</string>
<string name="copy">Copia</string>
<string name="copy_account_number">Copia numero di account</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Crea</string>
<string name="create_account_fail_title">Creazione dell\'account non riuscita</string>
<string name="create_custom_list_message">\"%1$s\" creato</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Mullvadアカウント番号をクリップボードにコピーしました</string>
<string name="copy">コピー</string>
<string name="copy_account_number">アカウント番号のコピー</string>
<string name="country_comma_city">%1$s、%2$s</string>
<string name="create">作成</string>
<string name="create_account_fail_title">アカウントを作成できませんでした</string>
<string name="create_custom_list_message">\"%1$s\" が作成されました</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">클립보드에 Mullvad 계정 번호 복사됨</string>
<string name="copy">복사</string>
<string name="copy_account_number">계정 번호 복사</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">생성</string>
<string name="create_account_fail_title">계정을 생성하지 못했습니다</string>
<string name="create_custom_list_message">\"%1$s\"이(가) 생성되었습니다</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-my/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Mullvad အကောင့်နံပါတ်ကို ကလစ်ဘုတ်တွင် ကူးထားပါသည်</string>
<string name="copy">ကူးယူရန်</string>
<string name="copy_account_number">အကောင့်နံပါတ်ကို ကူးရန်</string>
<string name="country_comma_city">%1$s၊ %2$s</string>
<string name="create">ဖန်တီးမည်</string>
<string name="create_account_fail_title">အကောင့်ဖန်တီးခြင်း မအောင်မြင်ပါ</string>
<string name="create_custom_list_message">\"%1$s\" ကို ဖန်တီးလိုက်ပြီ</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-nb/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Kopierte Mullvad-kontonummer til utklippstavlen</string>
<string name="copy">Kopier</string>
<string name="copy_account_number">Kopier kontonummer</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Opprett</string>
<string name="create_account_fail_title">Opprettelse av konto mislyktes</string>
<string name="create_custom_list_message">«%1$s» ble opprettet</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Mullvad-accountnummer gekopieerd naar klembord</string>
<string name="copy">Kopiëren</string>
<string name="copy_account_number">Accountnummer kopiëren</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Maken</string>
<string name="create_account_fail_title">Account maken is mislukt</string>
<string name="create_custom_list_message">\"%1$s\" is gemaakt</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Skopiowano numer konta Mullvad do schowka</string>
<string name="copy">Kopiuj</string>
<string name="copy_account_number">Kopiuj numer konta</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Utwórz</string>
<string name="create_account_fail_title">Nie udało się utworzyć konta</string>
<string name="create_custom_list_message">Utworzono „%1$s”</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Número de conta Mullvad copiado para a área de transferência</string>
<string name="copy">Copiar</string>
<string name="copy_account_number">Copiar número de conta</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Criar</string>
<string name="create_account_fail_title">Falha ao criar conta</string>
<string name="create_custom_list_message">\"%1$s\" foi criada</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Номер учетной записи Mullvad скопирован в буфер обмена</string>
<string name="copy">Копировать</string>
<string name="copy_account_number">Копировать номер учетной записи</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Создать</string>
<string name="create_account_fail_title">Не удалось создать учетную запись</string>
<string name="create_custom_list_message">Список «%1$s» создан</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-sv/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Kopierade Mullvad-kontonummer till urklipp</string>
<string name="copy">Kopiera</string>
<string name="copy_account_number">Kopiera kontonummer</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Skapa</string>
<string name="create_account_fail_title">Det gick inte att skapa konto</string>
<string name="create_custom_list_message">\"%1$s\" har skapats</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-th/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">คัดลอกหมายเลขบัญชี Mullvad ไปยังคลิปบอร์ดแล้ว</string>
<string name="copy">คัดลอก</string>
<string name="copy_account_number">คัดลอกหมายเลขบัญชี</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">สร้าง</string>
<string name="create_account_fail_title">การสร้างบัญชีล้มเหลว</string>
<string name="create_custom_list_message">\"%1$s\" ถูกสร้างแล้ว</string>
Expand Down
1 change: 1 addition & 0 deletions android/lib/ui/resource/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">Mullvad hesap numarası panoya kopyalandı</string>
<string name="copy">Kopyala</string>
<string name="copy_account_number">Hesap numarasını kopyala</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="create">Oluştur</string>
<string name="create_account_fail_title">Hesap oluşturulamadı</string>
<string name="create_custom_list_message">\"%1$s\" oluşturuldu</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">已将 Mullvad 帐号复制到剪贴板</string>
<string name="copy">复制</string>
<string name="copy_account_number">复制帐号</string>
<string name="country_comma_city">%2$s%1$s</string>
<string name="create">创建</string>
<string name="create_account_fail_title">创建帐户失败</string>
<string name="create_custom_list_message">“%1$s”已创建</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string name="copied_mullvad_account_number">已將 Mullvad 帳號複製到剪貼簿</string>
<string name="copy">複製</string>
<string name="copy_account_number">複製帳號</string>
<string name="country_comma_city">%2$s%1$s</string>
<string name="create">建立</string>
<string name="create_account_fail_title">建立帳戶失敗</string>
<string name="create_custom_list_message">已建立「%1$s」</string>
Expand Down
2 changes: 2 additions & 0 deletions android/lib/ui/resource/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@
<string name="multihop">Multihop</string>
<string name="multihop_description">Multihop routes your traffic into one WireGuard server and out another, making it harder to trace. This results in increased latency but increases anonymity online.</string>
<string name="x_via_x">%1$s via %2$s</string>
<string name="country_comma_city">%1$s, %2$s</string>
<string name="country_comma_city_comma_relay">%1$s, %2$s, %3$s</string>
<string name="entry">Entry</string>
<string name="exit">Exit</string>
<string name="clear_input">Clear input</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal fun Notification.Tunnel.toNotification(context: Context) =
NotificationCompat.Builder(context, channelId.value)
.setContentIntent(contentIntent(context))
.setContentTitle(state.contentTitleResourceId(context))
.setContentText(state.contentText())
.setContentText(state.contentText(context))
.setSmallIcon(R.drawable.small_logo_white)
.apply { actions.forEach { addAction(it.toCompatAction(context)) } }
.setOngoing(ongoing)
Expand Down Expand Up @@ -62,17 +62,20 @@ private fun NotificationTunnelState.contentTitleResourceId(context: Context): St
context.getString(R.string.legacy_always_on_vpn_error_notification_title)
}

private fun NotificationTunnelState.contentText(): CharSequence? {
private fun NotificationTunnelState.contentText(context: Context): CharSequence? {
val location =
when (this) {
is NotificationTunnelState.Connected -> location
is NotificationTunnelState.Connecting -> location
else -> null
}
return if (location != null) {
"${location.country}, ${location.city}, ${location.hostname}"
} else {
null
return location?.let {
context.getString(
R.string.country_comma_city_comma_relay,
location.country,
location.city,
location.hostname,
)
}
}

Expand Down
3 changes: 3 additions & 0 deletions desktop/packages/mullvad-vpn/locales/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2727,6 +2727,9 @@ msgstr ""
msgid "%1$s was removed from \"%2$s\""
msgstr ""

msgid "%1$s, %2$s, %3$s"
msgstr ""

msgid "%s (Entry)"
msgstr ""

Expand Down
Loading