Ticket #1711: action_dialogs.diff
File action_dialogs.diff, 2.9 KB (added by dmartina, 15 years ago) |
---|
-
src/file.c
old new panel_compute_totals (WPanel *panel, con 1627 1627 * This array introduced to avoid translation problems. The former (op_names) 1628 1628 * is assumed to be nouns, suitable in dialog box titles; this one should 1629 1629 * contain whatever is used in prompt itself (i.e. in russian, it's verb). 1630 * Notice first symbol - it is to fool gettext and force these strings to1631 * be different for it. First symbol is skipped while building a prompt.1632 1630 * (I don't use spaces around the words, because someday they could be 1633 1631 * dropped, when widgets get smarter) 1634 1632 */ 1635 static const char *op_names1[] = { N_("1Copy"), N_("1Move"), N_("1Delete") }; 1633 1634 /* TRANSLATORS: no need to translate 'action', it's just a context prefix */ 1635 static const char *op_names1[] = { N_("action|Copy"), N_("action|Move"), N_("action|Delete") }; 1636 1636 #define FMD_XLEN 64 1637 1637 1638 1638 int fmd_xlen = FMD_XLEN; … … static const char *prompt_parts[] = { 1654 1654 N_("file"), N_("files"), N_("directory"), N_("directories"), 1655 1655 N_("files/directories"), N_(" with source mask:"), N_(" to:") 1656 1656 }; 1657 static const char *question_format = N_("%s?"); 1657 1658 1658 1659 /* 1659 1660 * Generate user prompt for panel operation. … … panel_operate_generate_prompt (const WPa 1670 1671 register int i; 1671 1672 char format_string[BUF_MEDIUM]; 1672 1673 char *dp = format_string; 1674 gboolean build_question=FALSE; 1673 1675 1674 1676 #ifdef ENABLE_NLS 1675 1677 static int i18n_flag = 0; 1676 1678 if (!i18n_flag) { 1677 1679 for (i = sizeof (op_names1) / sizeof (op_names1[0]); i--;) 1678 op_names1[i] = _(op_names1[i]);1680 op_names1[i] = Q_(op_names1[i]); 1679 1681 1680 1682 for (i = sizeof (prompt_parts) / sizeof (prompt_parts[0]); i--;) 1681 1683 prompt_parts[i] = _(prompt_parts[i]); 1682 1684 1683 1685 one_format = _(one_format); 1684 1686 many_format = _(many_format); 1687 question_format = _(question_format); 1685 1688 i18n_flag = 1; 1686 1689 } 1687 1690 #endif /* ENABLE_NLS */ … … panel_operate_generate_prompt (const WPa 1694 1697 cp = NULL; 1695 1698 switch (sp[1]) { 1696 1699 case 'o': 1697 cp = op_names1[operation] + 1;1700 cp = op_names1[operation]; 1698 1701 break; 1699 1702 case 'm': 1700 cp = operation == OP_DELETE ? "?" : prompt_parts[5]; 1703 if (operation == OP_DELETE) { 1704 build_question=TRUE; 1705 cp=""; 1706 } else { 1707 cp = prompt_parts[5]; 1708 } 1701 1709 break; 1702 1710 case 'e': 1703 cp = operation == OP_DELETE ? "?" : prompt_parts[6]; 1711 if (operation == OP_DELETE) { 1712 build_question=TRUE; 1713 cp=""; 1714 } else { 1715 cp = prompt_parts[6]; 1716 } 1704 1717 break; 1705 1718 case 'f': 1706 1719 if (single_source) { … … panel_operate_generate_prompt (const WPa 1729 1742 } 1730 1743 *dp = '\0'; 1731 1744 1745 if (build_question) { 1746 g_snprintf (format_string, sizeof (format_string), 1747 question_format, g_strdup(format_string)); 1748 } 1749 1732 1750 if (single_source) { 1733 1751 i = fmd_xlen - str_term_width1 (format_string) - 4; 1734 1752 g_snprintf (cmd_buf, sizeof (cmd_buf), format_string,