From 2bd8213e6fc6045dbd0fc03b7226386526bb1306 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 4 Feb 2023 20:34:59 +0200 Subject: [PATCH 36/36] Qualify core domain "none" and "custom" Qualify "none" and "None" strings, also adjusting case as needed. For consistency with "none" cma settings, qualify also "custom" one. Ruledit strings not touched. See osdn #46001 Signed-off-by: Marko Lindqvist --- client/agents/cma_fec.c | 4 ++-- client/gui-gtk-3.22/cityrep.c | 21 +++++++++++---------- client/gui-gtk-4.0/cityrep.c | 16 ++++++++-------- client/gui-qt/repodlgs.cpp | 9 +++++---- client/gui-sdl2/citydlg.c | 8 ++++---- client/text.c | 2 ++ common/unit.h | 2 +- 7 files changed, 33 insertions(+), 29 deletions(-) diff --git a/client/agents/cma_fec.c b/client/agents/cma_fec.c index c2acfef031..f9f8a4d913 100644 --- a/client/agents/cma_fec.c +++ b/client/agents/cma_fec.c @@ -223,7 +223,7 @@ const char *cmafec_get_short_descr_of_city(const struct city *pcity) struct cm_parameter parameter; if (!cma_is_city_under_agent(pcity, ¶meter)) { - return _("none"); + return Q_("?cma:none"); } else { return cmafec_get_short_descr(¶meter); } @@ -239,7 +239,7 @@ const char *cmafec_get_short_descr(const struct cm_parameter *const int idx = cmafec_preset_get_index_of_parameter(parameter); if (idx == -1) { - return _("custom"); + return Q_("?cma:custom"); } else { return cmafec_preset_get_descr(idx); } diff --git a/client/gui-gtk-3.22/cityrep.c b/client/gui-gtk-3.22/cityrep.c index 78db8e0a51..f18a8ae4f0 100644 --- a/client/gui-gtk-3.22/cityrep.c +++ b/client/gui-gtk-3.22/cityrep.c @@ -61,8 +61,8 @@ #define NEG_VAL(x) ((x)<0 ? (x) : (-x)) /* Some versions of gcc have problems with negative values here (PR#39722). */ -#define CMA_NONE (10000) -#define CMA_CUSTOM (10001) +#define CMA_NONE (10000) +#define CMA_CUSTOM (10001) struct sell_data { int count; /* Number of cities. */ @@ -768,7 +768,7 @@ static void append_cma_to_menu_item(GtkMenuItem *parent_item, bool change_cma) gtk_menu_item_set_submenu(parent_item, menu); if (change_cma) { - w = gtk_menu_item_new_with_label(_("none")); + w = gtk_menu_item_new_with_label(Q_("?cma:none")); gtk_menu_shell_append(GTK_MENU_SHELL(menu), w); g_signal_connect(w, "activate", G_CALLBACK(select_cma_callback), GINT_TO_POINTER(CMA_NONE)); @@ -782,7 +782,7 @@ static void append_cma_to_menu_item(GtkMenuItem *parent_item, bool change_cma) fc_assert(GPOINTER_TO_INT(GINT_TO_POINTER(i)) == i); } } else { - /* search for a "none" */ + /* Search for a "none" */ int found; found = 0; @@ -794,13 +794,13 @@ static void append_cma_to_menu_item(GtkMenuItem *parent_item, bool change_cma) } city_list_iterate_end; if (found) { - w = gtk_menu_item_new_with_label(_("none")); + w = gtk_menu_item_new_with_label(Q_("?cma:none")); gtk_menu_shell_append(GTK_MENU_SHELL(menu), w); g_signal_connect(w, "activate", G_CALLBACK(select_cma_callback), GINT_TO_POINTER(CMA_NONE)); } - /* + /* * Search for a city that's under custom (not preset) agent. Might * take a lonnggg time. */ @@ -814,15 +814,16 @@ static void append_cma_to_menu_item(GtkMenuItem *parent_item, bool change_cma) } city_list_iterate_end; if (found) { - /* we found city that's under agent but not a preset */ - w = gtk_menu_item_new_with_label(_("custom")); + /* We found city that's under agent but not a preset */ + w = gtk_menu_item_new_with_label(Q_("?cma:custom")); gtk_menu_shell_append(GTK_MENU_SHELL(menu), w); g_signal_connect(w, "activate", - G_CALLBACK(select_cma_callback), GINT_TO_POINTER(CMA_CUSTOM)); + G_CALLBACK(select_cma_callback), + GINT_TO_POINTER(CMA_CUSTOM)); } - /* only fill in presets that are being used. */ + /* Only fill in presets that are being used. */ for (i = 0; i < cmafec_preset_num(); i++) { found = 0; city_list_iterate(client.conn.playing->cities, pcity) { diff --git a/client/gui-gtk-4.0/cityrep.c b/client/gui-gtk-4.0/cityrep.c index 217de56c7c..7b29f3933d 100644 --- a/client/gui-gtk-4.0/cityrep.c +++ b/client/gui-gtk-4.0/cityrep.c @@ -61,8 +61,8 @@ #define NEG_VAL(x) ((x)<0 ? (x) : (-x)) /* Some versions of gcc have problems with negative values here (PR#39722). */ -#define CMA_NONE (10000) -#define CMA_CUSTOM (10001) +#define CMA_NONE (10000) +#define CMA_CUSTOM (10001) struct sell_data { int count; /* Number of cities. */ @@ -780,7 +780,7 @@ static void append_cma_to_menu_item(GtkMenuItem *parent_item, bool change_cma) gtk_menu_item_set_submenu(parent_item, menu); if (change_cma) { - w = gtk_menu_item_new_with_label(_("none")); + w = gtk_menu_item_new_with_label(Q_("?cma:none")); gtk_menu_shell_append(GTK_MENU_SHELL(menu), w); g_signal_connect(w, "activate", G_CALLBACK(select_cma_callback), GINT_TO_POINTER(CMA_NONE)); @@ -794,7 +794,7 @@ static void append_cma_to_menu_item(GtkMenuItem *parent_item, bool change_cma) fc_assert(GPOINTER_TO_INT(GINT_TO_POINTER(i)) == i); } } else { - /* search for a "none" */ + /* Search for a "none" */ int found; found = 0; @@ -806,7 +806,7 @@ static void append_cma_to_menu_item(GtkMenuItem *parent_item, bool change_cma) } city_list_iterate_end; if (found) { - w = gtk_menu_item_new_with_label(_("none")); + w = gtk_menu_item_new_with_label(Q_("?cma:none")); gtk_menu_shell_append(GTK_MENU_SHELL(menu), w); g_signal_connect(w, "activate", G_CALLBACK(select_cma_callback), GINT_TO_POINTER(CMA_NONE)); @@ -826,8 +826,8 @@ static void append_cma_to_menu_item(GtkMenuItem *parent_item, bool change_cma) } city_list_iterate_end; if (found) { - /* we found city that's under agent but not a preset */ - w = gtk_menu_item_new_with_label(_("custom")); + /* We found city that's under agent but not a preset */ + w = gtk_menu_item_new_with_label(Q_("?cma:custom")); gtk_menu_shell_append(GTK_MENU_SHELL(menu), w); g_signal_connect(w, "activate", @@ -835,7 +835,7 @@ static void append_cma_to_menu_item(GtkMenuItem *parent_item, bool change_cma) GINT_TO_POINTER(CMA_CUSTOM)); } - /* only fill in presets that are being used. */ + /* Only fill in presets that are being used. */ for (i = 0; i < cmafec_preset_num(); i++) { found = 0; city_list_iterate(client.conn.playing->cities, pcity) { diff --git a/client/gui-qt/repodlgs.cpp b/client/gui-qt/repodlgs.cpp index 5e88423564..faacc74855 100644 --- a/client/gui-qt/repodlgs.cpp +++ b/client/gui-qt/repodlgs.cpp @@ -1161,14 +1161,15 @@ void real_science_report_dialog_update(void *unused) bool blk = false; QWidget *w; QString str; + struct player *plr = client_player(); - if (NULL != client.conn.playing) { - struct research *research = research_get(client_player()); + if (NULL != plr) { + struct research *research = research_get(plr); if (research->researching == A_UNSET) { - str = QString(_("none")); + str = QString(Q_("?tech:None")); } else if (research->client.researching_cost != 0) { - str = research_advance_name_translation(research,research->researching); + str = research_advance_name_translation(research, research->researching); percent = 100 *research->bulbs_researched / research->client.researching_cost; str = str + "\n (" + QString::number(percent) + "%)"; } diff --git a/client/gui-sdl2/citydlg.c b/client/gui-sdl2/citydlg.c index 34d50558ce..bb057d739e 100644 --- a/client/gui-sdl2/citydlg.c +++ b/client/gui-sdl2/citydlg.c @@ -2037,7 +2037,7 @@ static void redraw_info_city_dialog(struct widget *city_window, alphablit(surf, NULL, city_window->dst->surface, &dest, 255); - /* blit trade icon */ + /* Blit trade icon */ dest.x += surf->w + adj_size(3); dest.y += adj_size(4); alphablit(icons->trade, NULL, city_window->dst->surface, &dest, 255); @@ -2049,7 +2049,7 @@ static void redraw_info_city_dialog(struct widget *city_window, FREESURFACE(surf); } trade_routes_iterate_end; - if (step) { + if (step > 0) { fc_snprintf(cbuf, sizeof(cbuf), _("Trade: +%d"), step); copy_chars_to_utf8_str(pstr, cbuf); @@ -2062,7 +2062,7 @@ static void redraw_info_city_dialog(struct widget *city_window, FREESURFACE(surf); } else { - fc_snprintf(cbuf, sizeof(cbuf), _("none")); + fc_snprintf(cbuf, sizeof(cbuf), Q_("?trade:None")); copy_chars_to_utf8_str(pstr, cbuf); @@ -3730,7 +3730,7 @@ void real_city_dialog_popup(struct city *pcity) /* -------- */ buf = create_themeicon(current_theme->r_arrow_icon, pwindow->dst, - WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); + WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); buf->info_label = create_utf8_from_char(_("Next city"), adj_font(12)); buf->action = next_prev_city_dlg_callback; buf->size.x = area.x + adj_size(420) + adj_size(2); diff --git a/client/text.c b/client/text.c index 1acb4ef55e..022732139e 100644 --- a/client/text.c +++ b/client/text.c @@ -1791,9 +1791,11 @@ const char *text_happiness_nationality(const struct city *pcity) } if (enemies == 0) { + /* TRANS: No enemy nationalities, as there's no enemies present. */ astr_add(&str, _("None.")); } } else { + /* TRANS: No nationalities present. */ astr_add(&str, _("Disabled.")); } diff --git a/common/unit.h b/common/unit.h index 6803359636..08a59e4164 100644 --- a/common/unit.h +++ b/common/unit.h @@ -123,7 +123,7 @@ struct unit_order { /* Used in the network protocol */ #define SPECENUM_NAME server_side_agent #define SPECENUM_VALUE0 SSA_NONE -#define SPECENUM_VALUE0NAME N_("None") +#define SPECENUM_VALUE0NAME N_("?serveragent:None") #define SPECENUM_VALUE1 SSA_AUTOSETTLER #define SPECENUM_VALUE1NAME N_("Autosettlers") #define SPECENUM_VALUE2 SSA_AUTOEXPLORE -- 2.39.1