Mercurial > vim
comparison src/netbeans.c @ 32481:a1e1527d1cb8 v9.0.1572
patch 9.0.1572: error messages are not translated
Commit: https://github.com/vim/vim/commit/50809a45ebde327cb6fdcc727d7466e926aed713
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 20 16:39:07 2023 +0100
patch 9.0.1572: error messages are not translated
Problem: Error messages are not translated.
Solution: Add _().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 20 May 2023 17:45:03 +0200 |
parents | 3365a601e73b |
children | bb5458706799 |
comparison
equal
deleted
inserted
replaced
32480:f8bde854516d | 32481:a1e1527d1cb8 |
---|---|
475 bufno = strtol((char *)cmd, &verb, 10); | 475 bufno = strtol((char *)cmd, &verb, 10); |
476 | 476 |
477 if (*verb != ':') | 477 if (*verb != ':') |
478 { | 478 { |
479 nbdebug((" missing colon: %s\n", cmd)); | 479 nbdebug((" missing colon: %s\n", cmd)); |
480 semsg(e_missing_colon_str, cmd); | 480 semsg(_(e_missing_colon_str), cmd); |
481 return; | 481 return; |
482 } | 482 } |
483 ++verb; // skip colon | 483 ++verb; // skip colon |
484 | 484 |
485 for (q = verb; *q; q++) | 485 for (q = verb; *q; q++) |
499 } | 499 } |
500 | 500 |
501 if (isfunc < 0) | 501 if (isfunc < 0) |
502 { | 502 { |
503 nbdebug((" missing ! or / in: %s\n", cmd)); | 503 nbdebug((" missing ! or / in: %s\n", cmd)); |
504 semsg(e_missing_bang_or_slash_in_str, cmd); | 504 semsg(_(e_missing_bang_or_slash_in_str), cmd); |
505 return; | 505 return; |
506 } | 506 } |
507 | 507 |
508 r_cmdno = strtol(q, &q, 10); | 508 r_cmdno = strtol(q, &q, 10); |
509 | 509 |
516 * This happens because the ExtEd can send a command or 2 after | 516 * This happens because the ExtEd can send a command or 2 after |
517 * doing a stopDocumentListen command. It doesn't harm anything | 517 * doing a stopDocumentListen command. It doesn't harm anything |
518 * so I'm disabling it except for debugging. | 518 * so I'm disabling it except for debugging. |
519 */ | 519 */ |
520 nbdebug(("nb_parse_cmd: Command error for \"%s\"\n", cmd)); | 520 nbdebug(("nb_parse_cmd: Command error for \"%s\"\n", cmd)); |
521 emsg(e_bad_return_from_nb_do_cmd); | 521 emsg(_(e_bad_return_from_nb_do_cmd)); |
522 #endif | 522 #endif |
523 } | 523 } |
524 } | 524 } |
525 | 525 |
526 struct nbbuf_struct | 526 struct nbbuf_struct |
1038 long linenum = 0; | 1038 long linenum = 0; |
1039 #ifdef FEAT_SIGNS | 1039 #ifdef FEAT_SIGNS |
1040 if (buf == NULL || buf->bufp == NULL) | 1040 if (buf == NULL || buf->bufp == NULL) |
1041 { | 1041 { |
1042 nbdebug((" Invalid buffer identifier in getAnno\n")); | 1042 nbdebug((" Invalid buffer identifier in getAnno\n")); |
1043 emsg(e_invalid_buffer_identifier_in_getanno); | 1043 emsg(_(e_invalid_buffer_identifier_in_getanno)); |
1044 retval = FAIL; | 1044 retval = FAIL; |
1045 } | 1045 } |
1046 else | 1046 else |
1047 { | 1047 { |
1048 int serNum; | 1048 int serNum; |
1061 long len = 0; | 1061 long len = 0; |
1062 | 1062 |
1063 if (buf == NULL || buf->bufp == NULL) | 1063 if (buf == NULL || buf->bufp == NULL) |
1064 { | 1064 { |
1065 nbdebug((" invalid buffer identifier in getLength\n")); | 1065 nbdebug((" invalid buffer identifier in getLength\n")); |
1066 emsg(e_invalid_buffer_identifier_in_getlength); | 1066 emsg(_(e_invalid_buffer_identifier_in_getlength)); |
1067 retval = FAIL; | 1067 retval = FAIL; |
1068 } | 1068 } |
1069 else | 1069 else |
1070 { | 1070 { |
1071 len = get_buf_size(buf->bufp); | 1071 len = get_buf_size(buf->bufp); |
1083 char_u *line; | 1083 char_u *line; |
1084 | 1084 |
1085 if (buf == NULL || buf->bufp == NULL) | 1085 if (buf == NULL || buf->bufp == NULL) |
1086 { | 1086 { |
1087 nbdebug((" invalid buffer identifier in getText\n")); | 1087 nbdebug((" invalid buffer identifier in getText\n")); |
1088 emsg(e_invalid_buffer_identifier_in_gettext); | 1088 emsg(_(e_invalid_buffer_identifier_in_gettext)); |
1089 retval = FAIL; | 1089 retval = FAIL; |
1090 } | 1090 } |
1091 else | 1091 else |
1092 { | 1092 { |
1093 len = get_buf_size(buf->bufp); | 1093 len = get_buf_size(buf->bufp); |
1146 } | 1146 } |
1147 | 1147 |
1148 if (buf == NULL || buf->bufp == NULL) | 1148 if (buf == NULL || buf->bufp == NULL) |
1149 { | 1149 { |
1150 nbdebug((" invalid buffer identifier in remove\n")); | 1150 nbdebug((" invalid buffer identifier in remove\n")); |
1151 emsg(e_invalid_buffer_identifier_in_remove); | 1151 emsg(_(e_invalid_buffer_identifier_in_remove)); |
1152 retval = FAIL; | 1152 retval = FAIL; |
1153 } | 1153 } |
1154 else | 1154 else |
1155 { | 1155 { |
1156 netbeansFireChanges = FALSE; | 1156 netbeansFireChanges = FALSE; |
1316 */ | 1316 */ |
1317 | 1317 |
1318 if (buf == NULL || buf->bufp == NULL) | 1318 if (buf == NULL || buf->bufp == NULL) |
1319 { | 1319 { |
1320 nbdebug((" invalid buffer identifier in insert\n")); | 1320 nbdebug((" invalid buffer identifier in insert\n")); |
1321 emsg(e_invalid_buffer_identifier_in_insert); | 1321 emsg(_(e_invalid_buffer_identifier_in_insert)); |
1322 retval = FAIL; | 1322 retval = FAIL; |
1323 } | 1323 } |
1324 else if (args != NULL) | 1324 else if (args != NULL) |
1325 { | 1325 { |
1326 int ff_detected = EOL_UNKNOWN; | 1326 int ff_detected = EOL_UNKNOWN; |
1476 { | 1476 { |
1477 // Create a buffer without a name. | 1477 // Create a buffer without a name. |
1478 if (buf == NULL) | 1478 if (buf == NULL) |
1479 { | 1479 { |
1480 nbdebug((" invalid buffer identifier in create\n")); | 1480 nbdebug((" invalid buffer identifier in create\n")); |
1481 emsg(e_invalid_buffer_identifier_in_create); | 1481 emsg(_(e_invalid_buffer_identifier_in_create)); |
1482 return FAIL; | 1482 return FAIL; |
1483 } | 1483 } |
1484 VIM_CLEAR(buf->displayname); | 1484 VIM_CLEAR(buf->displayname); |
1485 | 1485 |
1486 netbeansReadFile = 0; // don't try to open disk file | 1486 netbeansReadFile = 0; // don't try to open disk file |
1524 else if (streq((char *)cmd, "startDocumentListen")) | 1524 else if (streq((char *)cmd, "startDocumentListen")) |
1525 { | 1525 { |
1526 if (buf == NULL) | 1526 if (buf == NULL) |
1527 { | 1527 { |
1528 nbdebug((" invalid buffer identifier in startDocumentListen\n")); | 1528 nbdebug((" invalid buffer identifier in startDocumentListen\n")); |
1529 emsg(e_invalid_buffer_identifier_in_startdocumentlisten); | 1529 emsg(_(e_invalid_buffer_identifier_in_startdocumentlisten)); |
1530 return FAIL; | 1530 return FAIL; |
1531 } | 1531 } |
1532 buf->fireChanges = 1; | 1532 buf->fireChanges = 1; |
1533 // ===================================================================== | 1533 // ===================================================================== |
1534 } | 1534 } |
1535 else if (streq((char *)cmd, "stopDocumentListen")) | 1535 else if (streq((char *)cmd, "stopDocumentListen")) |
1536 { | 1536 { |
1537 if (buf == NULL) | 1537 if (buf == NULL) |
1538 { | 1538 { |
1539 nbdebug((" invalid buffer identifier in stopDocumentListen\n")); | 1539 nbdebug((" invalid buffer identifier in stopDocumentListen\n")); |
1540 emsg(e_invalid_buffer_identifier_in_stopdocumentlisten); | 1540 emsg(_(e_invalid_buffer_identifier_in_stopdocumentlisten)); |
1541 return FAIL; | 1541 return FAIL; |
1542 } | 1542 } |
1543 buf->fireChanges = 0; | 1543 buf->fireChanges = 0; |
1544 if (buf->bufp != NULL && buf->bufp->b_was_netbeans_file) | 1544 if (buf->bufp != NULL && buf->bufp->b_was_netbeans_file) |
1545 { | 1545 { |
1565 else if (streq((char *)cmd, "setTitle")) | 1565 else if (streq((char *)cmd, "setTitle")) |
1566 { | 1566 { |
1567 if (buf == NULL) | 1567 if (buf == NULL) |
1568 { | 1568 { |
1569 nbdebug((" invalid buffer identifier in setTitle\n")); | 1569 nbdebug((" invalid buffer identifier in setTitle\n")); |
1570 emsg(e_invalid_buffer_identifier_in_settitle); | 1570 emsg(_(e_invalid_buffer_identifier_in_settitle)); |
1571 return FAIL; | 1571 return FAIL; |
1572 } | 1572 } |
1573 vim_free(buf->displayname); | 1573 vim_free(buf->displayname); |
1574 buf->displayname = nb_unquote(args, NULL); | 1574 buf->displayname = nb_unquote(args, NULL); |
1575 // ===================================================================== | 1575 // ===================================================================== |
1577 else if (streq((char *)cmd, "initDone")) | 1577 else if (streq((char *)cmd, "initDone")) |
1578 { | 1578 { |
1579 if (buf == NULL || buf->bufp == NULL) | 1579 if (buf == NULL || buf->bufp == NULL) |
1580 { | 1580 { |
1581 nbdebug((" invalid buffer identifier in initDone\n")); | 1581 nbdebug((" invalid buffer identifier in initDone\n")); |
1582 emsg(e_invalid_buffer_identifier_in_initdone); | 1582 emsg(_(e_invalid_buffer_identifier_in_initdone)); |
1583 return FAIL; | 1583 return FAIL; |
1584 } | 1584 } |
1585 do_update = 1; | 1585 do_update = 1; |
1586 buf->initDone = TRUE; | 1586 buf->initDone = TRUE; |
1587 nb_set_curbuf(buf->bufp); | 1587 nb_set_curbuf(buf->bufp); |
1598 buf_T *bufp; | 1598 buf_T *bufp; |
1599 | 1599 |
1600 if (buf == NULL) | 1600 if (buf == NULL) |
1601 { | 1601 { |
1602 nbdebug((" invalid buffer identifier in setBufferNumber\n")); | 1602 nbdebug((" invalid buffer identifier in setBufferNumber\n")); |
1603 emsg(e_invalid_buffer_identifier_in_setbuffernumber); | 1603 emsg(_(e_invalid_buffer_identifier_in_setbuffernumber)); |
1604 return FAIL; | 1604 return FAIL; |
1605 } | 1605 } |
1606 path = (char_u *)nb_unquote(args, NULL); | 1606 path = (char_u *)nb_unquote(args, NULL); |
1607 if (path == NULL) | 1607 if (path == NULL) |
1608 return FAIL; | 1608 return FAIL; |
1609 bufp = buflist_findname(path); | 1609 bufp = buflist_findname(path); |
1610 vim_free(path); | 1610 vim_free(path); |
1611 if (bufp == NULL) | 1611 if (bufp == NULL) |
1612 { | 1612 { |
1613 nbdebug((" File %s not found in setBufferNumber\n", args)); | 1613 nbdebug((" File %s not found in setBufferNumber\n", args)); |
1614 semsg(e_file_str_not_found_in_setbuffernumber, args); | 1614 semsg(_(e_file_str_not_found_in_setbuffernumber), args); |
1615 return FAIL; | 1615 return FAIL; |
1616 } | 1616 } |
1617 buf->bufp = bufp; | 1617 buf->bufp = bufp; |
1618 buf->nbbuf_number = bufp->b_fnum; | 1618 buf->nbbuf_number = bufp->b_fnum; |
1619 | 1619 |
1634 else if (streq((char *)cmd, "setFullName")) | 1634 else if (streq((char *)cmd, "setFullName")) |
1635 { | 1635 { |
1636 if (buf == NULL) | 1636 if (buf == NULL) |
1637 { | 1637 { |
1638 nbdebug((" invalid buffer identifier in setFullName\n")); | 1638 nbdebug((" invalid buffer identifier in setFullName\n")); |
1639 emsg(e_invalid_buffer_identifier_in_setfullname); | 1639 emsg(_(e_invalid_buffer_identifier_in_setfullname)); |
1640 return FAIL; | 1640 return FAIL; |
1641 } | 1641 } |
1642 vim_free(buf->displayname); | 1642 vim_free(buf->displayname); |
1643 buf->displayname = nb_unquote(args, NULL); | 1643 buf->displayname = nb_unquote(args, NULL); |
1644 | 1644 |
1657 else if (streq((char *)cmd, "editFile")) | 1657 else if (streq((char *)cmd, "editFile")) |
1658 { | 1658 { |
1659 if (buf == NULL) | 1659 if (buf == NULL) |
1660 { | 1660 { |
1661 nbdebug((" invalid buffer identifier in editFile\n")); | 1661 nbdebug((" invalid buffer identifier in editFile\n")); |
1662 emsg(e_invalid_buffer_identifier_in_editfile); | 1662 emsg(_(e_invalid_buffer_identifier_in_editfile)); |
1663 return FAIL; | 1663 return FAIL; |
1664 } | 1664 } |
1665 // Edit a file: like create + setFullName + read the file. | 1665 // Edit a file: like create + setFullName + read the file. |
1666 vim_free(buf->displayname); | 1666 vim_free(buf->displayname); |
1667 buf->displayname = nb_unquote(args, NULL); | 1667 buf->displayname = nb_unquote(args, NULL); |
1683 { | 1683 { |
1684 nbdebug((" invalid buffer identifier in setVisible\n")); | 1684 nbdebug((" invalid buffer identifier in setVisible\n")); |
1685 // This message was commented out, probably because it can | 1685 // This message was commented out, probably because it can |
1686 // happen when shutting down. | 1686 // happen when shutting down. |
1687 if (p_verbose > 0) | 1687 if (p_verbose > 0) |
1688 emsg(e_invalid_buffer_identifier_in_setvisible); | 1688 emsg(_(e_invalid_buffer_identifier_in_setvisible)); |
1689 return FAIL; | 1689 return FAIL; |
1690 } | 1690 } |
1691 if (streq((char *)args, "T") && buf->bufp != curbuf) | 1691 if (streq((char *)args, "T") && buf->bufp != curbuf) |
1692 { | 1692 { |
1693 exarg_T exarg; | 1693 exarg_T exarg; |
1723 { | 1723 { |
1724 nbdebug((" invalid buffer identifier in setModified\n")); | 1724 nbdebug((" invalid buffer identifier in setModified\n")); |
1725 // This message was commented out, probably because it can | 1725 // This message was commented out, probably because it can |
1726 // happen when shutting down. | 1726 // happen when shutting down. |
1727 if (p_verbose > 0) | 1727 if (p_verbose > 0) |
1728 emsg(e_invalid_buffer_identifier_in_setmodified); | 1728 emsg(_(e_invalid_buffer_identifier_in_setmodified)); |
1729 return FAIL; | 1729 return FAIL; |
1730 } | 1730 } |
1731 prev_b_changed = buf->bufp->b_changed; | 1731 prev_b_changed = buf->bufp->b_changed; |
1732 if (streq((char *)args, "T")) | 1732 if (streq((char *)args, "T")) |
1733 buf->bufp->b_changed = TRUE; | 1733 buf->bufp->b_changed = TRUE; |
1806 #endif | 1806 #endif |
1807 | 1807 |
1808 if (buf == NULL || buf->bufp == NULL) | 1808 if (buf == NULL || buf->bufp == NULL) |
1809 { | 1809 { |
1810 nbdebug((" invalid buffer identifier in setDot\n")); | 1810 nbdebug((" invalid buffer identifier in setDot\n")); |
1811 emsg(e_invalid_buffer_identifier_in_setdot); | 1811 emsg(_(e_invalid_buffer_identifier_in_setdot)); |
1812 return FAIL; | 1812 return FAIL; |
1813 } | 1813 } |
1814 | 1814 |
1815 nb_set_curbuf(buf->bufp); | 1815 nb_set_curbuf(buf->bufp); |
1816 | 1816 |
1859 #endif | 1859 #endif |
1860 | 1860 |
1861 if (buf == NULL) | 1861 if (buf == NULL) |
1862 { | 1862 { |
1863 nbdebug((" invalid buffer identifier in close\n")); | 1863 nbdebug((" invalid buffer identifier in close\n")); |
1864 emsg(e_invalid_buffer_identifier_in_close); | 1864 emsg(_(e_invalid_buffer_identifier_in_close)); |
1865 return FAIL; | 1865 return FAIL; |
1866 } | 1866 } |
1867 | 1867 |
1868 #ifdef NBDEBUG | 1868 #ifdef NBDEBUG |
1869 if (buf->displayname != NULL) | 1869 if (buf->displayname != NULL) |
1873 { | 1873 { |
1874 nbdebug((" invalid buffer identifier in close\n")); | 1874 nbdebug((" invalid buffer identifier in close\n")); |
1875 // This message was commented out, probably because it can | 1875 // This message was commented out, probably because it can |
1876 // happen when shutting down. | 1876 // happen when shutting down. |
1877 if (p_verbose > 0) | 1877 if (p_verbose > 0) |
1878 emsg(e_invalid_buffer_identifier_in_close_2); | 1878 emsg(_(e_invalid_buffer_identifier_in_close_2)); |
1879 } | 1879 } |
1880 nbdebug((" CLOSE %d: %s\n", bufno, name)); | 1880 nbdebug((" CLOSE %d: %s\n", bufno, name)); |
1881 #ifdef FEAT_GUI | 1881 #ifdef FEAT_GUI |
1882 need_mouse_correct = TRUE; | 1882 need_mouse_correct = TRUE; |
1883 #endif | 1883 #endif |
1912 char_u *bg; | 1912 char_u *bg; |
1913 | 1913 |
1914 if (buf == NULL) | 1914 if (buf == NULL) |
1915 { | 1915 { |
1916 nbdebug((" invalid buffer identifier in defineAnnoType\n")); | 1916 nbdebug((" invalid buffer identifier in defineAnnoType\n")); |
1917 emsg(e_invalid_buffer_identifier_in_defineannotype); | 1917 emsg(_(e_invalid_buffer_identifier_in_defineannotype)); |
1918 return FAIL; | 1918 return FAIL; |
1919 } | 1919 } |
1920 | 1920 |
1921 cp = (char *)args; | 1921 cp = (char *)args; |
1922 typeNum = strtol(cp, &cp, 10); | 1922 typeNum = strtol(cp, &cp, 10); |
1940 } | 1940 } |
1941 fg = vim_strsave(args); | 1941 fg = vim_strsave(args); |
1942 bg = vim_strsave(p); | 1942 bg = vim_strsave(p); |
1943 if (STRLEN(fg) > MAX_COLOR_LENGTH || STRLEN(bg) > MAX_COLOR_LENGTH) | 1943 if (STRLEN(fg) > MAX_COLOR_LENGTH || STRLEN(bg) > MAX_COLOR_LENGTH) |
1944 { | 1944 { |
1945 emsg(e_highlighting_color_name_too_long_in_defineAnnoType); | 1945 emsg(_(e_highlighting_color_name_too_long_in_defineAnnoType)); |
1946 VIM_CLEAR(typeName); | 1946 VIM_CLEAR(typeName); |
1947 parse_error = TRUE; | 1947 parse_error = TRUE; |
1948 } | 1948 } |
1949 else if (typeName != NULL && tooltip != NULL && glyphFile != NULL) | 1949 else if (typeName != NULL && tooltip != NULL && glyphFile != NULL) |
1950 addsigntype(buf, typeNum, typeName, tooltip, glyphFile, fg, bg); | 1950 addsigntype(buf, typeNum, typeName, tooltip, glyphFile, fg, bg); |
1969 pos_T *pos; | 1969 pos_T *pos; |
1970 | 1970 |
1971 if (buf == NULL || buf->bufp == NULL) | 1971 if (buf == NULL || buf->bufp == NULL) |
1972 { | 1972 { |
1973 nbdebug((" invalid buffer identifier in addAnno\n")); | 1973 nbdebug((" invalid buffer identifier in addAnno\n")); |
1974 emsg(e_invalid_buffer_identifier_in_addanno); | 1974 emsg(_(e_invalid_buffer_identifier_in_addanno)); |
1975 return FAIL; | 1975 return FAIL; |
1976 } | 1976 } |
1977 | 1977 |
1978 do_update = 1; | 1978 do_update = 1; |
1979 | 1979 |