Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 24.9-rc-2 to trunk #20866

Merged
merged 15 commits into from
May 23, 2024
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 @@ -33,7 +33,8 @@ class SubscribersChartMarkerView @Inject constructor(
@Inject
lateinit var statsDateFormatter: StatsDateFormatter
private val countView = findViewById<TextView>(R.id.marker_text1)
private val dateView = findViewById<TextView>(R.id.marker_text2)
private val labelView = findViewById<TextView>(R.id.marker_text2)
private val dateView = findViewById<TextView>(R.id.marker_text3)

override fun refreshContent(e: Entry?, highlight: Highlight?) {
val lineChart = chartView as? LineChart ?: return
Expand All @@ -46,6 +47,12 @@ class SubscribersChartMarkerView @Inject constructor(

val count = yValue.toLong()
countView.text = count.toString()
val label = if (count > 1) {
R.string.stats_subscribers_marker_view_plural
} else {
R.string.stats_subscribers_marker_view_singular
}
labelView.setText(label)
val date = statsDateFormatter.getStatsDateFromPeriodDay(e.data.toString())
dateView.text = date

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SubscribersChartUseCase @Inject constructor(
@Named(BG_THREAD) private val backgroundDispatcher: CoroutineDispatcher,
private val analyticsTracker: AnalyticsTrackerWrapper
) : StatelessUseCase<SubscribersModel>(SUBSCRIBERS_CHART, mainDispatcher, backgroundDispatcher) {
override fun buildLoadingItem(): List<BlockListItem> = listOf()
override fun buildLoadingItem(): List<BlockListItem> = listOf(Title(R.string.stats_view_subscribers))

override suspend fun loadCachedData() = subscribersStore.getSubscribers(
statsSiteProvider.siteModel,
Expand Down Expand Up @@ -68,7 +68,7 @@ class SubscribersChartUseCase @Inject constructor(
return items
}

private fun buildTitle() = Title(R.string.stats_view_subscribers_chart)
private fun buildTitle() = Title(R.string.stats_view_subscriber_growth)

private fun onLineSelected() {
analyticsTracker.track(AnalyticsTracker.Stat.STATS_SUBSCRIBERS_CHART_TAPPED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SubscribersMapper @Inject constructor(
}

val contentDescriptions = statsUtils.getSubscribersChartEntryContentDescriptions(
R.string.stats_view_subscribers_chart,
R.string.stats_subscribers_marker_view_plural,
chartItems
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class SubscribersChartViewHolder(parent: ViewGroup) : BlockListItemViewHolder(
}

private fun getData(item: SubscribersChartItem): List<ILineDataSet> {
val data = if (item.entries.isEmpty() || item.entries.all { it.value == 0 }) {
val data = if (item.entries.isEmpty()) {
buildEmptyDataSet(item.entries.size)
} else {
val mappedEntries = item.entries.mapIndexed { index, pair -> toLineEntry(pair, index) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class LineChartLabelFormatter @Inject constructor(
) : ValueFormatter() {
override fun getAxisLabel(value: Float, axis: AxisBase?): String {
val index = value.toInt()
return if (entries.isNotEmpty() && index in 0..entries.size) {
return if (entries.isNotEmpty() && index in entries.indices) {
entries[index].label
} else {
""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SubscribersChartLabelFormatter @Inject constructor(
) : ValueFormatter() {
override fun getAxisLabel(value: Float, axis: AxisBase?): String {
val index = value.toInt()
return if (entries.isNotEmpty() && index in 0..entries.size) {
return if (entries.isNotEmpty() && index in entries.indices) {
entries[index].label
} else {
""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@
tools:text="6500" />

<TextView
android:id="@+id/marker_text2"
style="@style/TextAppearance.MaterialComponents.Caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/stats_view_subscribers_chart"
android:text="@string/stats_subscribers_marker_view_plural"
android:textColor="@color/stats_tool_tip_body" />

<TextView
android:id="@+id/marker_text2"
android:id="@+id/marker_text3"
style="@style/TextAppearance.MaterialComponents.Caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
62 changes: 35 additions & 27 deletions WordPress/src/main/res/values-ar/strings.xml

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions WordPress/src/main/res/values-az/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ Language: az
<string name="stats_followers_seconds_ago">saniyə öncə</string>
<string name="stats_view_top_posts_and_pages">Yazı və Səhifələr</string>
<string name="stats_view_videos">Videolar</string>
<string name="stats_view_followers">İzləyici</string>
<string name="stats_view_countries">Ölkələr</string>
<string name="stats_likes">Bəyənmə</string>
<string name="stats_timeframe_years">İl</string>
Expand Down Expand Up @@ -217,7 +216,6 @@ Language: az
<string name="note_reply_successful">Cavab dərc edildi</string>
<string name="more_notifications">və %d daha çox.</string>
<string name="new_notifications">%d yeni bildirişlər</string>
<string name="follows">İzləmələr</string>
<string name="loading">Yüklənir…</string>
<string name="httpuser">HTTP istifadəçi adı</string>
<string name="httppassword">HTTP parolu</string>
Expand Down
13 changes: 0 additions & 13 deletions WordPress/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,35 +261,25 @@ Language: bg
<string name="preference_open_device_settings">Настройки на устройството</string>
<string name="invite_invalid_email">%s: Невалиден имейл</string>
<string name="invite_user_blocked_invites">%s: потребителят е забранил поканите</string>
<string name="invite_already_following">%s: вече сте абонирани</string>
<string name="invite_already_a_member">%s: вече е член</string>
<string name="invite_username_not_found">%s: потребителят не е намерен</string>
<string name="comment_moderated_approved">Коментарът бе одобрен.</string>
<string name="like">Харесвам</string>
<string name="timespan_now">сега</string>
<string name="role_follower">Последовател</string>
<string name="role_viewer">Потребител</string>
<string name="error_post_my_profile_no_connection">Няма връзка, профилът не беше запазен</string>
<string name="alignment_none">Без</string>
<string name="alignment_left">Ляво</string>
<string name="alignment_right">Дясно</string>
<string name="site_settings_list_editor_action_mode_title">Избрано %1$d</string>
<string name="error_fetch_users_list">Неуспешно извикване на потребителите</string>
<string name="title_follower">Последовател</string>
<string name="title_email_follower">Абонат</string>
<string name="people_fetching">Търсене на потребителите…</string>
<string name="people_dropdown_item_viewers">Потребители</string>
<string name="people_dropdown_item_email_followers">Абонати</string>
<string name="people_dropdown_item_followers">Последователи</string>
<string name="people_dropdown_item_team">Екип</string>
<string name="invite_message_usernames_limit">Можете да поканите до 10 души като въведете имейл адреси или техните потребителски имена в WordPress.com. Ако те нямат профили там, ще им бъдат изпратени инструкции как да си създадат.</string>
<string name="viewer_remove_confirmation_message">Потребителите няма да могат да посещават сайта ако ги премахнете от тук.\n\nЖелаете ли да продължите с премахването?</string>
<string name="follower_remove_confirmation_message">Последователите ще спрат да получават известия за сайта ако ги премахнете, освен ако не го добавят отново.\n\nЖелаете ли да продължите с премахването?</string>
<string name="follower_subscribed_since">От %1$s</string>
<string name="error_remove_follower">Неуспешно премахване на последователя</string>
<string name="error_remove_viewer">Неуспешно премахване на потребителя</string>
<string name="error_fetch_email_followers_list">Неуспешно показване на последователите по имейл.</string>
<string name="error_fetch_followers_list">Неуспешно показване на последователите на сайта</string>
<string name="editor_failed_uploads_switch_html">Някои файлове не се качиха. Преминете в режим HTML\n на сайта. Премахване на всички неуспешно качени файлове и напред?</string>
<string name="visual_editor">Визуален редактор</string>
<string name="image_thumbnail">Малка картинка</string>
Expand Down Expand Up @@ -386,7 +376,6 @@ Language: bg
<string name="username_mentions">Споменавания</string>
<string name="site_achievements">Постижения</string>
<string name="likes_on_my_posts">Харесвания на моите публикации</string>
<string name="site_follows">Сайтът следва</string>
<string name="likes_on_my_comments">Харесвания на моите коментари</string>
<string name="comments_on_my_site">Коментари на моя сайт</string>
<string name="site_settings_list_editor_summary_other">%d елемента</string>
Expand Down Expand Up @@ -638,7 +627,6 @@ Language: bg
<string name="stats_followers_a_month">Месец</string>
<string name="stats_timeframe_years">Години</string>
<string name="stats_view_top_posts_and_pages">Публикации и страници</string>
<string name="stats_view_followers">Последователи</string>
<string name="stats_followers_months">%1$d месеца</string>
<string name="stats_followers_a_minute_ago">преди минута</string>
<string name="stats_likes">Харесвания</string>
Expand Down Expand Up @@ -784,7 +772,6 @@ Language: bg
<string name="more_notifications">и още %d.</string>
<string name="note_reply_successful">Отговорът е публикуван</string>
<string name="sign_in">Влизане</string>
<string name="follows">Следва</string>
<string name="loading">Зареждане…</string>
<string name="httppassword">HTTP Парола</string>
<string name="httpuser">Потребител за HTTP</string>
Expand Down
Loading
Loading