From 2476af4c65add3b94e4b1a30c0f17cd7b78f1256 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 1 Jul 2013 20:05:09 +0100 Subject: Use messages for treeview labels. --- desktop/global_history.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'desktop') diff --git a/desktop/global_history.c b/desktop/global_history.c index 20bf3c9b6..ee09c1cdb 100644 --- a/desktop/global_history.c +++ b/desktop/global_history.c @@ -497,41 +497,51 @@ static bool global_history_add_entry(nsurl *url, static nserror global_history_initialise_entry_fields(void) { int i; + const char *label; for (i = 0; i < N_FIELDS; i++) gh_ctx.fields[i].field = NULL; - /* TODO: use messages */ gh_ctx.fields[0].flags = TREE_FLAG_DEFAULT; - if (lwc_intern_string("Title", SLEN("Title"), + label = "TreeviewLabelTitle"; + label = messages_get(label); + if (lwc_intern_string(label, strlen(label), &gh_ctx.fields[0].field) != lwc_error_ok) { goto error; } gh_ctx.fields[1].flags = TREE_FLAG_NONE; - if (lwc_intern_string("URL", SLEN("URL"), + label = "TreeviewLabelURL"; + label = messages_get(label); + if (lwc_intern_string(label, strlen(label), &gh_ctx.fields[1].field) != lwc_error_ok) { goto error; } gh_ctx.fields[2].flags = TREE_FLAG_SHOW_NAME; - if (lwc_intern_string("Last visit", SLEN("Last visit"), + label = "TreeviewLabelLastVisit"; + label = messages_get(label); + if (lwc_intern_string(label, strlen(label), &gh_ctx.fields[2].field) != lwc_error_ok) { goto error; } gh_ctx.fields[3].flags = TREE_FLAG_SHOW_NAME; - if (lwc_intern_string("Visits", SLEN("Visits"), + label = "TreeviewLabelVisits"; + label = messages_get(label); + if (lwc_intern_string(label, strlen(label), &gh_ctx.fields[3].field) != lwc_error_ok) { goto error; } gh_ctx.fields[4].flags = TREE_FLAG_DEFAULT; - if (lwc_intern_string("Period", SLEN("Period"), + label = "TreeviewLabelPeriod"; + label = messages_get(label); + if (lwc_intern_string(label, strlen(label), &gh_ctx.fields[4].field) != lwc_error_ok) { return false; -- cgit v1.2.3