Using plurals when needed
This commit is contained in:
parent
2b50208a23
commit
5791a4d3cd
|
@ -3225,12 +3225,19 @@
|
|||
<string name="device_manager_other_sessions_view_all">View All (%1$d)</string>
|
||||
<string name="device_manager_other_sessions_description_verified">Verified · Last activity %1$s</string>
|
||||
<string name="device_manager_other_sessions_description_unverified">Unverified · Last activity %1$s</string>
|
||||
<string name="device_manager_other_sessions_description_inactive">Inactive for %1$d+ days (%2$s)</string>
|
||||
<!-- Example: Inactive for 90+ days (Dec 25, 2021) -->
|
||||
<plurals name="device_manager_other_sessions_description_inactive">
|
||||
<item quantity="one">Inactive for %1$d+ day (%2$s)</item>
|
||||
<item quantity="other">Inactive for %1$d+ days (%2$s)</item>
|
||||
</plurals>
|
||||
<string name="device_manager_header_section_security_recommendations_title">Security recommendations</string>
|
||||
<string name="device_manager_header_section_security_recommendations_description">Improve your account security by following these recommendations.</string>
|
||||
<string name="device_manager_unverified_sessions_title">Unverified sessions</string>
|
||||
<string name="device_manager_unverified_sessions_description">Verify or sign out from unverified sessions.</string>
|
||||
<string name="device_manager_inactive_sessions_title">Inactive sessions</string>
|
||||
<string name="device_manager_inactive_sessions_description">Consider signing out from old sessions (%1$d days or more) that you don’t use anymore.</string>
|
||||
<plurals name="device_manager_inactive_sessions_description">
|
||||
<item quantity="one">Consider signing out from old sessions (%1$d day or more) that you don’t use anymore.</item>
|
||||
<item quantity="other">Consider signing out from old sessions (%1$d days or more) that you don’t use anymore.</item>
|
||||
</plurals>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -155,7 +155,11 @@ class VectorSettingsDevicesFragment :
|
|||
views.deviceListUnverifiedSessionsRecommendation.setCount(unverifiedSessionsCount)
|
||||
views.deviceListInactiveSessionsRecommendation.setCount(inactiveSessionsCount)
|
||||
views.deviceListInactiveSessionsRecommendation.setDescription(
|
||||
getString(R.string.device_manager_inactive_sessions_description, SESSION_IS_MARKED_AS_INACTIVE_AFTER_DAYS)
|
||||
resources.getQuantityString(
|
||||
R.plurals.device_manager_inactive_sessions_description,
|
||||
SESSION_IS_MARKED_AS_INACTIVE_AFTER_DAYS,
|
||||
SESSION_IS_MARKED_AS_INACTIVE_AFTER_DAYS
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,8 +45,9 @@ class OtherSessionsController @Inject constructor(
|
|||
data.take(NUMBER_OF_OTHER_DEVICES_TO_RENDER).forEach { device ->
|
||||
val formattedLastActivityDate = host.dateFormatter.format(device.deviceInfo.lastSeenTs, DateFormatKind.DEFAULT_DATE_AND_TIME)
|
||||
val description = if (device.isInactive) {
|
||||
stringProvider.getString(
|
||||
R.string.device_manager_other_sessions_description_inactive,
|
||||
stringProvider.getQuantityString(
|
||||
R.plurals.device_manager_other_sessions_description_inactive,
|
||||
SESSION_IS_MARKED_AS_INACTIVE_AFTER_DAYS,
|
||||
SESSION_IS_MARKED_AS_INACTIVE_AFTER_DAYS,
|
||||
formattedLastActivityDate
|
||||
)
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginVertical="16dp"
|
||||
app:recommendationTitle="@string/device_manager_inactive_sessions_title"
|
||||
app:recommendationDescription="@string/device_manager_inactive_sessions_description"
|
||||
app:recommendationDescription="@plurals/device_manager_inactive_sessions_description"
|
||||
app:recommendationImageResource="@drawable/ic_inactive_sessions"
|
||||
app:recommendationImageBackgroundTint="?vctr_system"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
Loading…
Reference in New Issue