Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #861462 » m-30-sdl-worklist-pluralise.patch

master, S3_0 - Jacob Nevins, 2020-02-22 11:00 PM

View differences:

client/gui-sdl2/wldlg.c
1004 1004
{
1005 1005
  char cBuf[64];
1006 1006
  SDL_Rect area;
1007
  int external_entries;
1007
  int len = worklist_length(&pEditor->worklist_copy);
1008 1008

  
1009 1009
  if (pEditor->pCity != NULL) {
1010
    external_entries = 1; /* Current production */
1011
  } else {
1012
    external_entries = 0;
1010
    len += 1;  /* External entry from current production */
1013 1011
  }
1014 1012

  
1015
  /* TRANS: length of worklist */
1016
  fc_snprintf(cBuf, sizeof(cBuf), _("( %d entries )"),
1017
              worklist_length(&pEditor->worklist_copy) + external_entries);
1013
  fc_snprintf(cBuf, sizeof(cBuf),
1014
              /* TRANS: length of worklist */
1015
              PL_("( %d entry )", "( %d entries )", len), len);
1018 1016
  copy_chars_to_utf8_str(pEditor->pWorkList_Counter->string_utf8, cBuf);
1019 1017

  
1020 1018
  widget_undraw(pEditor->pWorkList_Counter);
......
1063 1061
  bool advanced_tech;
1064 1062
  bool can_build, can_eventually_build;
1065 1063
  SDL_Rect area;
1066
  int external_entries;
1064
  int len;
1067 1065

  
1068 1066
  if (pEditor) {
1069 1067
    return;
......
1089 1087
    return;
1090 1088
  }
1091 1089

  
1090
  len = worklist_length(&pEditor->worklist_copy);
1092 1091
  advanced_tech = (pCity == NULL);
1093 1092

  
1094 1093
  /* --------------- */
......
1114 1113
  /* ---------------- */
1115 1114
  if (pCity) {
1116 1115
    fc_snprintf(cbuf, sizeof(cbuf), _("Worklist of\n%s"), city_name_get(pCity));
1117
    external_entries = 1; /* Current production */
1116
    len += 1;  /* External entry from current production */
1118 1117
  } else {
1119 1118
    fc_snprintf(cbuf, sizeof(cbuf), "%s", global_worklist_name(gwl));
1120
    external_entries = 0;
1121 1119
  }
1122 1120

  
1123 1121
  pstr = create_utf8_from_char(cbuf, adj_font(12));
......
1128 1126
  add_to_gui_list(ID_LABEL, pBuf);
1129 1127
  /* --------------------------- */
1130 1128

  
1131
  /* TRANS: length of worklist */
1132
  fc_snprintf(cbuf, sizeof(cbuf), _("( %d entries )"),
1133
              worklist_length(&pEditor->worklist_copy) + external_entries);
1129
  fc_snprintf(cbuf, sizeof(cbuf),
1130
              /* TRANS: length of worklist */
1131
              PL_("( %d entry )", "( %d entries )", len), len);
1134 1132
  pstr = create_utf8_from_char(cbuf, adj_font(10));
1135 1133
  pstr->bgcol = (SDL_Color) {0, 0, 0, 0};
1136 1134
  pBuf = create_iconlabel(NULL, pWindow->dst, pstr, WF_RESTORE_BACKGROUND);
......
1767 1765

  
1768 1766
  /* worklist */
1769 1767
  /* pEditor->pWork->pScroll->count: including production */
1770
  if (pCity || (worklist_length(&pEditor->worklist_copy) > 0)) {
1768
  if (len > 0) {
1771 1769
    /* FIXME */
1772 1770
    setup_vertical_widgets_position(1,
1773 1771
                                    area.x + adj_size(2), area.y + adj_size(152)
(1-1/2)