welcome-action-card: Properly translate tasks

parent 5318b92b
Pipeline #179680 passed with stages
in 34 minutes and 40 seconds
......@@ -20,12 +20,15 @@
#include "gtd-welcome-action-card.h"
#include "config.h"
struct _GtdWelcomeActionCard
{
GtkButton parent_instance;
GtkLabel *counter_label;
GtkImage *image;
GtkLabel *tasks_label;
GtkLabel *title_label;
guint counter;
......@@ -61,6 +64,10 @@ update_counter_label (GtdWelcomeActionCard *self)
gtk_widget_add_css_class (GTK_WIDGET (self), "empty");
else
gtk_widget_remove_css_class (GTK_WIDGET (self), "empty");
gtk_label_set_text (self->tasks_label,
/* Translators: 'tasks' as in '4 tasks' or '1 task' */
g_dngettext (GETTEXT_PACKAGE, "task", "tasks", self->counter));
}
......@@ -157,6 +164,7 @@ gtd_welcome_action_card_class_init (GtdWelcomeActionCardClass *klass)
gtk_widget_class_bind_template_child (widget_class, GtdWelcomeActionCard, counter_label);
gtk_widget_class_bind_template_child (widget_class, GtdWelcomeActionCard, image);
gtk_widget_class_bind_template_child (widget_class, GtdWelcomeActionCard, tasks_label);
gtk_widget_class_bind_template_child (widget_class, GtdWelcomeActionCard, title_label);
gtk_widget_class_set_css_name (widget_class, "welcome-action-card");
......
......@@ -45,8 +45,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">tasks</property>
<object class="GtkLabel" id="tasks_label">
<style>
<class name="dim-label" />
</style>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment