Skip to content

Commit 184068b

Browse files
committed
Merge branch 'remove-location-from-list-title-could-specify-list-name-droid-1198'
2 parents 3c5ae2a + 7953c4c commit 184068b

File tree

24 files changed

+19
-28
lines changed

24 files changed

+19
-28
lines changed

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt

+10-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ import net.mullvad.mullvadvpn.compose.transitions.SelectLocationTransition
9292
import net.mullvad.mullvadvpn.compose.util.CollectSideEffectWithLifecycle
9393
import net.mullvad.mullvadvpn.compose.util.RunOnKeyChange
9494
import net.mullvad.mullvadvpn.compose.util.showSnackbarImmediately
95+
import net.mullvad.mullvadvpn.lib.model.CustomList
9596
import net.mullvad.mullvadvpn.lib.model.CustomListId
97+
import net.mullvad.mullvadvpn.lib.model.CustomListName
9698
import net.mullvad.mullvadvpn.lib.model.RelayItem
9799
import net.mullvad.mullvadvpn.lib.model.RelayItemId
98100
import net.mullvad.mullvadvpn.lib.theme.AppTheme
@@ -365,6 +367,7 @@ fun SelectLocationScreen(
365367
bottomSheetState =
366368
ShowCustomListsEntryBottomSheet(
367369
listItem.parentId,
370+
listItem.parentName,
368371
listItem.item
369372
)
370373
}
@@ -589,7 +592,8 @@ private fun BottomSheets(
589592
CustomListEntryBottomSheet(
590593
sheetState = sheetState,
591594
onBackgroundColor = onBackgroundColor,
592-
customListId = bottomSheetState.parentId,
595+
customListId = bottomSheetState.customListId,
596+
customListName = bottomSheetState.customListName,
593597
item = bottomSheetState.item,
594598
onRemoveLocationFromList = onRemoveLocationFromList,
595599
closeBottomSheet = onCloseBottomSheet
@@ -784,6 +788,7 @@ private fun CustomListEntryBottomSheet(
784788
onBackgroundColor: Color,
785789
sheetState: SheetState,
786790
customListId: CustomListId,
791+
customListName: CustomListName,
787792
item: RelayItem.Location,
788793
onRemoveLocationFromList: (location: RelayItem.Location, customListId: CustomListId) -> Unit,
789794
closeBottomSheet: (animate: Boolean) -> Unit
@@ -794,7 +799,8 @@ private fun CustomListEntryBottomSheet(
794799
modifier = Modifier.testTag(SELECT_LOCATION_LOCATION_BOTTOM_SHEET_TEST_TAG)
795800
) {
796801
HeaderCell(
797-
text = stringResource(id = R.string.remove_location_from_list, item.name),
802+
text =
803+
stringResource(id = R.string.remove_location_from_list, item.name, customListName),
798804
background = Color.Unspecified
799805
)
800806
HorizontalDivider(color = onBackgroundColor)
@@ -902,7 +908,8 @@ sealed interface BottomSheetState {
902908
data class ShowCustomListsBottomSheet(val editListEnabled: Boolean) : BottomSheetState
903909

904910
data class ShowCustomListsEntryBottomSheet(
905-
val parentId: CustomListId,
911+
val customListId: CustomListId,
912+
val customListName: CustomListName,
906913
val item: RelayItem.Location
907914
) : BottomSheetState
908915

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/SelectLocationUiState.kt

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package net.mullvad.mullvadvpn.compose.state
22

33
import net.mullvad.mullvadvpn.lib.model.CustomListId
4+
import net.mullvad.mullvadvpn.lib.model.CustomListName
45
import net.mullvad.mullvadvpn.lib.model.RelayItem
56

67
typealias ModelOwnership = net.mullvad.mullvadvpn.lib.model.Ownership
@@ -60,6 +61,7 @@ sealed interface RelayListItem {
6061

6162
data class CustomListEntryItem(
6263
val parentId: CustomListId,
64+
val parentName: CustomListName,
6365
val item: RelayItem.Location,
6466
override val expanded: Boolean,
6567
override val depth: Int = 0

android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SelectLocationViewModel.kt

+5-4
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class SelectLocationViewModel(
214214
if (expanded) {
215215
addAll(
216216
customList.locations.flatMap {
217-
createCustomListEntry(parent = customList.id, item = it, 1, isExpanded)
217+
createCustomListEntry(parent = customList, item = it, 1, isExpanded)
218218
}
219219
)
220220
}
@@ -240,15 +240,16 @@ class SelectLocationViewModel(
240240
}
241241

242242
private fun createCustomListEntry(
243-
parent: CustomListId,
243+
parent: RelayItem.CustomList,
244244
item: RelayItem.Location,
245245
depth: Int = 1,
246246
isExpanded: (String) -> Boolean,
247247
): List<RelayListItem.CustomListEntryItem> = buildList {
248-
val expanded = isExpanded(item.id.expandKey(parent))
248+
val expanded = isExpanded(item.id.expandKey(parent.id))
249249
add(
250250
RelayListItem.CustomListEntryItem(
251-
parentId = parent,
251+
parentId = parent.id,
252+
parentName = parent.customList.name,
252253
item = item,
253254
expanded = expanded,
254255
depth

android/lib/resource/src/main/res/values-da/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Indløs</string>
255255
<string name="redeem_voucher">Indløs kupon</string>
256256
<string name="remove_button">Fjern</string>
257-
<string name="remove_location_from_list">Fjern %1$s fra listen</string>
258257
<string name="rented">Lejet</string>
259258
<string name="rented_only">Kun lejet</string>
260259
<string name="report_a_problem">Rapporter et problem</string>

android/lib/resource/src/main/res/values-de/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Einlösen</string>
255255
<string name="redeem_voucher">Gutschein einlösen</string>
256256
<string name="remove_button">Entfernen</string>
257-
<string name="remove_location_from_list">%1$s aus Liste entfernen</string>
258257
<string name="rented">Gemietet</string>
259258
<string name="rented_only">Nur gemietet</string>
260259
<string name="report_a_problem">Problem melden</string>

android/lib/resource/src/main/res/values-es/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Canjear</string>
255255
<string name="redeem_voucher">Canjear cupón</string>
256256
<string name="remove_button">Quitar</string>
257-
<string name="remove_location_from_list">Quitar %1$s de la lista</string>
258257
<string name="rented">Alquilados</string>
259258
<string name="rented_only">Solo alquilados</string>
260259
<string name="report_a_problem">Informar de un problema</string>

android/lib/resource/src/main/res/values-fi/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Lunasta</string>
255255
<string name="redeem_voucher">Lunasta kuponki</string>
256256
<string name="remove_button">Poista</string>
257-
<string name="remove_location_from_list">Poista %1$s luettelosta</string>
258257
<string name="rented">Vuokrattu</string>
259258
<string name="rented_only">Vain vuokratut</string>
260259
<string name="report_a_problem">Raportoi ongelma</string>

android/lib/resource/src/main/res/values-fr/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Échanger</string>
255255
<string name="redeem_voucher">Échanger un bon</string>
256256
<string name="remove_button">Supprimer</string>
257-
<string name="remove_location_from_list">Supprimer %1$s de la liste</string>
258257
<string name="rented">Loué</string>
259258
<string name="rented_only">Loués uniquement</string>
260259
<string name="report_a_problem">Signaler un problème</string>

android/lib/resource/src/main/res/values-it/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Riscatta</string>
255255
<string name="redeem_voucher">Riscatta voucher</string>
256256
<string name="remove_button">Rimuovi</string>
257-
<string name="remove_location_from_list">Rimuovi %1$s dall\'elenco</string>
258257
<string name="rented">Noleggiato</string>
259258
<string name="rented_only">Solo noleggiati</string>
260259
<string name="report_a_problem">Segnala un problema</string>

android/lib/resource/src/main/res/values-ja/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">使用する</string>
255255
<string name="redeem_voucher">バウチャーを使用する</string>
256256
<string name="remove_button">削除</string>
257-
<string name="remove_location_from_list">%1$s をリストから削除する</string>
258257
<string name="rented">レンタルサーバー</string>
259258
<string name="rented_only">レンタルサーバーのみ</string>
260259
<string name="report_a_problem">問題を報告する</string>

android/lib/resource/src/main/res/values-ko/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">사용</string>
255255
<string name="redeem_voucher">바우처 사용</string>
256256
<string name="remove_button">제거</string>
257-
<string name="remove_location_from_list">목록에서 %1$s 제거</string>
258257
<string name="rented">대여</string>
259258
<string name="rented_only">대여만</string>
260259
<string name="report_a_problem">문제 신고</string>

android/lib/resource/src/main/res/values-my/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">လဲယူရန်</string>
255255
<string name="redeem_voucher">ဘောက်ချာဖြင့် လဲယူရန်</string>
256256
<string name="remove_button">ဖယ်ရှားရန်</string>
257-
<string name="remove_location_from_list">%1$s ကို စာရင်းမှ ဖယ်ရှားပါ</string>
258257
<string name="rented">အငှား</string>
259258
<string name="rented_only">အငှားသီးသန့်</string>
260259
<string name="report_a_problem">ပြဿနာ ရီပို့တ်လုပ်ရန်</string>

android/lib/resource/src/main/res/values-nb/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Løs inn</string>
255255
<string name="redeem_voucher">Løs inn kupong</string>
256256
<string name="remove_button">Fjern</string>
257-
<string name="remove_location_from_list">Fjern %1$s fra listen</string>
258257
<string name="rented">Leid</string>
259258
<string name="rented_only">Kun leid</string>
260259
<string name="report_a_problem">Rapporter et problem</string>

android/lib/resource/src/main/res/values-nl/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Inwisselen</string>
255255
<string name="redeem_voucher">Voucher inwisselen</string>
256256
<string name="remove_button">Verwijderen</string>
257-
<string name="remove_location_from_list">%1$s verwijderen uit lijst</string>
258257
<string name="rented">Gehuurd</string>
259258
<string name="rented_only">Alleen gehuurde</string>
260259
<string name="report_a_problem">Een probleem rapporteren</string>

android/lib/resource/src/main/res/values-pl/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Zrealizuj</string>
255255
<string name="redeem_voucher">Zrealizuj kupon</string>
256256
<string name="remove_button">Usuń</string>
257-
<string name="remove_location_from_list">Usuń lokalizację %1$s z listy</string>
258257
<string name="rented">Wynajmowane</string>
259258
<string name="rented_only">Wyłącznie wynajmowane</string>
260259
<string name="report_a_problem">Zgłoś problem</string>

android/lib/resource/src/main/res/values-pt/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Reclamar</string>
255255
<string name="redeem_voucher">Reclamar voucher</string>
256256
<string name="remove_button">Remover</string>
257-
<string name="remove_location_from_list">Remover %1$s da lista</string>
258257
<string name="rented">Alugado</string>
259258
<string name="rented_only">Apenas alugado</string>
260259
<string name="report_a_problem">Reportar um problema</string>

android/lib/resource/src/main/res/values-ru/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Погасить</string>
255255
<string name="redeem_voucher">Погасить ваучер</string>
256256
<string name="remove_button">Удалить</string>
257-
<string name="remove_location_from_list">Удалить местоположение %1$s из списка</string>
258257
<string name="rented">Арендованные</string>
259258
<string name="rented_only">Только арендованные</string>
260259
<string name="report_a_problem">Сообщение о проблеме</string>

android/lib/resource/src/main/res/values-sv/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Lös in</string>
255255
<string name="redeem_voucher">Lös in kupong</string>
256256
<string name="remove_button">Ta bort</string>
257-
<string name="remove_location_from_list">Ta bort %1$s från listan</string>
258257
<string name="rented">Hyrd</string>
259258
<string name="rented_only">Endast hyrd</string>
260259
<string name="report_a_problem">Rapportera ett problem</string>

android/lib/resource/src/main/res/values-th/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">แลกรับ</string>
255255
<string name="redeem_voucher">แลกบัตรกำนัล</string>
256256
<string name="remove_button">ลบ</string>
257-
<string name="remove_location_from_list">ลบ %1$s ออกจากรายการ</string>
258257
<string name="rented">เช่า</string>
259258
<string name="rented_only">เช่าเท่านั้น</string>
260259
<string name="report_a_problem">รายงานปัญหา</string>

android/lib/resource/src/main/res/values-tr/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">Kullan</string>
255255
<string name="redeem_voucher">Kuponu kullan</string>
256256
<string name="remove_button">Kaldır</string>
257-
<string name="remove_location_from_list">%1$s konumunu listeden kaldır</string>
258257
<string name="rented">Kiralananlar</string>
259258
<string name="rented_only">Sadece kiralananlar</string>
260259
<string name="report_a_problem">Bir sorun bildir</string>

android/lib/resource/src/main/res/values-zh-rCN/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">兑换</string>
255255
<string name="redeem_voucher">兑换优惠券</string>
256256
<string name="remove_button">移除</string>
257-
<string name="remove_location_from_list">从列表中移除%1$s</string>
258257
<string name="rented">租用</string>
259258
<string name="rented_only">仅租用</string>
260259
<string name="report_a_problem">报告问题</string>

android/lib/resource/src/main/res/values-zh-rTW/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<string name="redeem">兌換</string>
255255
<string name="redeem_voucher">兌換憑證</string>
256256
<string name="remove_button">移除</string>
257-
<string name="remove_location_from_list">從清單中移除 %1$s</string>
258257
<string name="rented">租用</string>
259258
<string name="rented_only">僅租用</string>
260259
<string name="report_a_problem">回報問題</string>

android/lib/resource/src/main/res/values/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@
310310
<string name="discard_changes">Discard changes?</string>
311311
<string name="discard">Discard</string>
312312
<string name="add_location_to_list">Add %s to list</string>
313-
<string name="remove_location_from_list">Remove %s from list</string>
313+
<string name="remove_location_from_list">Remove %s from %s</string>
314314
<string name="location_was_added_to_list">%s was added to \"%s\"</string>
315315
<string name="location_added">%s (added)</string>
316316
<string name="edit_name">Edit name</string>

gui/locales/messages.pot

+1-1
Original file line numberDiff line numberDiff line change
@@ -2405,7 +2405,7 @@ msgstr ""
24052405
msgid "Remove"
24062406
msgstr ""
24072407

2408-
msgid "Remove %s from list"
2408+
msgid "Remove %s from %s"
24092409
msgstr ""
24102410

24112411
msgid "Remove custom port"

0 commit comments

Comments
 (0)