📄 localize.c
字号:
/* | localize.c | | $Header: /home/hugh/sources/aee/RCS/localize.c,v 1.25 1999/01/31 04:29:57 hugh Exp $ *//* | Copyright (c) 1994, 1995, 1996, 1998, 1999 Hugh Mahon. */#include "aee.h"#ifndef NO_CATGETS#if defined(__STDC__) || defined(__cplusplus)#define P_(s) s#else#define P_(s) ()#endifchar *catgetlocal P_((int number, char *string));#undef P_/* | Get the catalog entry, and if it got it from the catalog, | make a copy, since the buffer will be overwritten by the | next call to catgets(). */char *catgetlocal(number, string)int number;char *string;{ char *temp1; char *temp2; temp1 = catgets(catalog, 1, number, string); if (temp1 != string) { temp2 = malloc(strlen(temp1) + 1); strcpy(temp2, temp1); temp1 = temp2; } return(temp1);}#endif /* NO_CATGETS *//* | The following is to allow for using message catalogs which allow | the software to be 'localized', that is, to use different languages | all with the same binary. For more information, see your system | documentation, or the X/Open Internationalization Guide. */void strings_init(){ int counter;#ifndef NO_CATGETS setlocale(LC_ALL, ""); catalog = catopen("aee", 0);#endif /* NO_CATGETS */ ae_help_file = catgetlocal( 1, "/usr/local/lib/help.ae"); main_buffer_name = catgetlocal( 2, "main"); /* | allocate space for strings here for settings menu */ for (counter = 1; counter < (NUM_MODES_ITEMS - 1); counter++) { modes_menu[counter].item_string = malloc(80); } modes_menu[0].item_string = catgetlocal( 3, "modes menu"); mode_strings[1] = catgetlocal( 4, "tabs to spaces "); mode_strings[2] = catgetlocal( 5, "case sensitive search "); mode_strings[3] = catgetlocal( 6, "literal search "); mode_strings[4] = catgetlocal( 7, "search direction "); mode_strings[5] = catgetlocal( 8, "observe margins "); mode_strings[6] = catgetlocal( 9, "info window "); mode_strings[7] = catgetlocal( 10, "status line "); mode_strings[8] = catgetlocal( 11, "auto indent "); mode_strings[9] = catgetlocal( 12, "overstrike "); mode_strings[10] = catgetlocal( 13, "auto paragraph format "); mode_strings[11] = catgetlocal( 14, "multi windows "); mode_strings[12] = catgetlocal( 15, "left margin "); mode_strings[13] = catgetlocal( 16, "right margin "); mode_strings[14] = catgetlocal( 376, "info window height "); mode_strings[15] = catgetlocal( 393, "text/binary mode is "); mode_strings[16] = catgetlocal( 394, "current file type is "); mode_strings[17] = catgetlocal( 385, "save editor config "); leave_menu[0].item_string = catgetlocal( 17, "leave menu"); leave_menu[1].item_string = catgetlocal( 18, "save changes"); leave_menu[2].item_string = catgetlocal( 19, "no save"); leave_menu_2[0].item_string = catgetlocal( 20, "multiple buffers exist"); leave_menu_2[1].item_string = catgetlocal( 21, "stay in editor"); leave_menu_2[2].item_string = catgetlocal( 22, "leave anyway"); file_menu[0].item_string = catgetlocal( 23, "file menu"); file_menu[1].item_string = catgetlocal( 24, "read a file"); file_menu[2].item_string = catgetlocal( 25, "write a file"); file_menu[3].item_string = catgetlocal( 26, "save file"); file_menu[4].item_string = catgetlocal( 27, "print editor contents"); file_menu[5].item_string = catgetlocal( 375, "recover from journal"); search_menu[0].item_string = catgetlocal( 28, "search/replace menu"); search_menu[1].item_string = catgetlocal( 29, "search for ..."); search_menu[2].item_string = catgetlocal( 30, "search"); search_menu[3].item_string = catgetlocal( 31, "replace prompt ..."); search_menu[4].item_string = catgetlocal( 32, "replace"); spell_menu[0].item_string = catgetlocal( 33, "spell menu"); spell_menu[1].item_string = catgetlocal( 34, "use 'spell'"); spell_menu[2].item_string = catgetlocal( 35, "use 'ispell'"); misc_menu[0].item_string = catgetlocal( 36, "miscellaneous menu"); misc_menu[1].item_string = catgetlocal( 37, "format paragraph"); misc_menu[2].item_string = catgetlocal( 38, "shell command"); misc_menu[3].item_string = catgetlocal( 39, "check spelling"); edit_menu[0].item_string = catgetlocal( 40, "edit menu"); edit_menu[1].item_string = catgetlocal( 41, "mark text"); edit_menu[2].item_string = catgetlocal( 42, "copy marked text"); edit_menu[3].item_string = catgetlocal( 43, "cut (delete) marked text"); edit_menu[4].item_string = catgetlocal( 44, "paste"); main_menu[0].item_string = catgetlocal( 45, "main menu"); main_menu[1].item_string = catgetlocal( 46, "leave editor"); main_menu[2].item_string = catgetlocal( 47, "help"); main_menu[3].item_string = catgetlocal( 48, "edit"); main_menu[4].item_string = catgetlocal( 49, "file operations"); main_menu[5].item_string = catgetlocal( 50, "redraw screen"); main_menu[6].item_string = catgetlocal( 51, "settings"); main_menu[7].item_string = catgetlocal( 52, "search/replace"); main_menu[8].item_string = catgetlocal( 53, "miscellaneous"); SL_line_str = catgetlocal( 54, "line=%d"); SL_col_str = catgetlocal( 55, "col=%d"); SL_lit_str = catgetlocal( 56, " lit "); SL_nolit_str = catgetlocal( 57, " nolit"); SL_fwd_str = catgetlocal( 58, " fwd "); SL_rev_str = catgetlocal( 59, " rev "); SL_over_str = catgetlocal( 60, "over "); SL_insrt_str = catgetlocal( 61, "insrt "); SL_indent_str = catgetlocal( 62, "indent "); SL_noindnt_str = catgetlocal( 63, "noindnt "); SL_marg_str = catgetlocal( 64, " marg "); SL_nomarg_str = catgetlocal( 65, "nomarg "); SL_mark_str = catgetlocal( 66, "mark"); ascii_code_str = catgetlocal( 67, "ascii code: "); left_err_msg = catgetlocal( 68, "attempted to move cursor before start of file"); right_err_msg = catgetlocal( 69, "attempted to move past end of file"); help_err_msg = catgetlocal( 70, "unable to open help file %s"); prompt_for_more = catgetlocal( 71, "(press RETURN for more): "); topic_prompt = catgetlocal( 72, "topic? (TAB then RETURN to go to the main menu. RETURN to exit): "); topic_err_msg = catgetlocal( 73, "cannot find topic %s"); continue_prompt = catgetlocal( 74, "press return to continue "); printing_msg = catgetlocal( 75, "sending contents of buffer %s to \"%s\" "); EXPAND_str = catgetlocal( 76, "EXPAND"); NOEXPAND_str = catgetlocal( 77, "NOEXPAND"); NOJUSTIFY_str = catgetlocal( 78, "NOJUSTIFY"); JUSTIFY_str = catgetlocal( 79, "JUSTIFY"); EXIT_str = catgetlocal( 80, "EXIT"); QUIT_str = catgetlocal( 81, "QUIT"); AUTOFORMAT_str = catgetlocal( 82, "AUTOFORMAT"); NOAUTOFORMAT_str = catgetlocal( 83, "NOAUTOFORMAT"); INFO_str = catgetlocal( 84, "INFO"); NOINFO_str = catgetlocal( 85, "NOINFO"); TABS_str = catgetlocal( 86, "TABS"); UNTABS_str = catgetlocal( 87, "UNTABS"); WRITE_str = catgetlocal( 88, "WRITE"); READ_str = catgetlocal( 89, "READ"); SAVE_str = catgetlocal( 90, "SAVE"); LITERAL_str = catgetlocal( 91, "LITERAL"); NOLITERAL_str = catgetlocal( 92, "NOLITERAL"); STATUS_str = catgetlocal( 93, "STATUS"); NOSTATUS_str = catgetlocal( 94, "NOSTATUS"); MARGINS_str = catgetlocal( 95, "MARGINS"); NOMARGINS_str = catgetlocal( 96, "NOMARGINS"); INDENT_str = catgetlocal( 97, "INDENT"); NOINDENT_str = catgetlocal( 98, "NOINDENT"); OVERSTRIKE_str = catgetlocal( 99, "OVERSTRIKE"); NOOVERSTRIKE_str = catgetlocal( 100, "NOOVERSTRIKE"); LEFTMARGIN_str = catgetlocal( 101, "LEFTMARGIN"); RIGHTMARGIN_str = catgetlocal( 102, "RIGHTMARGIN"); LINE_str = catgetlocal( 103, "LINE"); FILE_str = catgetlocal( 104, "FILE"); COPYRIGHT_str = catgetlocal( 105, "COPYRIGHT"); CHARACTER_str = catgetlocal( 106, "CHARACTER"); REDRAW_str = catgetlocal( 107, "REDRAW"); RESEQUENCE_str = catgetlocal( 108, "RESEQUENCE"); AUTHOR_str = catgetlocal( 109, "AUTHOR"); VERSION_str = catgetlocal( 110, "VERSION"); CASE_str = catgetlocal( 111, "CASE"); NOCASE_str = catgetlocal( 112, "NOCASE"); EIGHT_str = catgetlocal( 113, "EIGHT"); NOEIGHT_str = catgetlocal( 114, "NOEIGHT"); WINDOWS_str = catgetlocal( 115, "WINDOWS"); NOWINDOWS_str = catgetlocal( 116, "NOWINDOWS"); DEFINE_str = catgetlocal( 117, "DEFINE"); SHOW_str = catgetlocal( 118, "SHOW"); HELP_str = catgetlocal( 119, "HELP"); PRINT_str = catgetlocal( 120, "PRINT"); BUFFER_str = catgetlocal( 121, "BUFFER"); DELETE_str = catgetlocal( 122, "DELETE"); GOLD_str = catgetlocal( 123, "GOLD"); tab_msg = catgetlocal( 124, "set tabs are: "); file_write_prompt_str = catgetlocal( 125, "name of file to write: "); file_read_prompt_str = catgetlocal( 126, "name of file to read: "); left_mrg_err_msg = catgetlocal( 127, "cannot set left margin to value greater than right margin"); right_mrg_err_msg = catgetlocal( 128, "cannot set right margin to value less than left margin"); left_mrg_setting = catgetlocal( 129, "left margin is set to %d"); right_mrg_setting = catgetlocal( 130, "right margin is set to %d"); line_num_str = catgetlocal( 131, "line %d"); lines_from_top = catgetlocal( 132, ", lines from top = %d, "); total_lines_str = catgetlocal( 133, "total number of lines = %d"); current_file_str = catgetlocal( 134, "current file is \"%s\" "); char_str = catgetlocal( 135, "character = %d"); key_def_msg = catgetlocal( 136, "key is defined as \"%s\""); unkn_syntax_msg = catgetlocal( 137, "unknown syntax beginning at \"%s\""); current_buff_msg = catgetlocal( 138, "current buffer is %s"); unkn_cmd_msg = catgetlocal( 139, "unknown command \"%s\""); usage_str = catgetlocal( 140, "usage: %s file [-j] [-r] [-e] [-t] [-n] [i] [+line]\n"); read_only_msg = catgetlocal( 141, " read only"); no_rcvr_fil_msg = catgetlocal( 142, "no recover file"); cant_opn_rcvr_fil_msg = catgetlocal( 143, " can't open new recover file"); fin_read_file_msg = catgetlocal( 144, "finished reading file %s"); rcvr_op_comp_msg = catgetlocal( 145, "recover operation complete"); file_is_dir_msg = catgetlocal( 146, "file %s is a directory"); path_not_a_dir_msg = catgetlocal( 147, "path is not a directory"); access_not_allowed_msg = catgetlocal( 148, "mode of file %s does not allow access"); new_file_msg = catgetlocal( 149, "new file %s"); cant_open_msg = catgetlocal( 150, "can't open %s"); bad_rcvr_msg = catgetlocal( 151, " can't open old recover file"); reading_file_msg = catgetlocal( 152, "reading file %s"); file_read_lines_msg = catgetlocal( 153, "file %s, %d lines"); other_buffs_exist_msg = catgetlocal( 154, "other buffers exist, information will be lost, leave anyway? (y/n) "); changes_made_prompt = catgetlocal( 155, "changes have been made, are you sure? (y/n [n]) "); no_write_access_msg = catgetlocal( 156, "mode of file %s does not allow write access"); file_exists_prompt = catgetlocal( 157, "file already exists, overwrite? (y/n) [n] "); cant_creat_fil_msg = catgetlocal( 158, "unable to create file %s"); writing_msg = catgetlocal( 159, "writing file %s"); file_written_msg = catgetlocal( 160, "%s %d lines, %d characters"); searching_msg = catgetlocal( 161, " ...searching"); fwd_srch_msg = catgetlocal( 162, " forward..."); rev_srch_msg = catgetlocal( 163, " reverse..."); str_str = catgetlocal( 164, "string "); not_fnd_str = catgetlocal( 165, " not found"); search_prompt_str = catgetlocal( 166, "search for: "); mark_not_actv_str = catgetlocal( 167, "mark not active, must set 'mark' before cut or copy (see 'help' in the menu)"); mark_active_str = catgetlocal( 168, "mark active"); mark_alrdy_actv_str = catgetlocal( 169, "mark is already active"); no_buff_named_str = catgetlocal( 170, "\nno buffer named \"%s\"\n"); press_ret_to_cont_str = catgetlocal( 171, "press return to continue "); fn_GOLD_str = catgetlocal( 172, "GOLD"); fn_DL_str = catgetlocal( 173, "DL"); fn_DC_str = catgetlocal( 174, "DC"); fn_CL_str = catgetlocal( 175, "CL"); fn_NP_str = catgetlocal( 176, "NP"); fn_PP_str = catgetlocal( 177, "PP"); fn_NB_str = catgetlocal( 178, "NB"); fn_PB_str = catgetlocal( 179, "PB"); fn_UDL_str = catgetlocal( 180, "UDL"); fn_UDC_str = catgetlocal( 181, "UDC"); fn_DW_str = catgetlocal( 182, "DW"); fn_UDW_str = catgetlocal( 183, "UDW"); fn_UND_str = catgetlocal( 184, "UND"); fn_EOL_str = catgetlocal( 185, "EOL"); fn_BOL_str = catgetlocal( 186, "BOL"); fn_BOT_str = catgetlocal( 187, "BOT"); fn_EOT_str = catgetlocal( 189, "EOT"); fn_FORMAT_str = catgetlocal( 190, "FORMAT"); fn_MARGINS_str = catgetlocal( 191, "MARGINS"); fn_NOMARGINS_str = catgetlocal( 192, "NOMARGINS"); fn_IL_str = catgetlocal( 193, "IL"); fn_PRP_str = catgetlocal( 194, "PRP"); fn_RP_str = catgetlocal( 195, "RP"); fn_MC_str = catgetlocal( 196, "MC"); fn_PSRCH_str = catgetlocal( 197, "PSRCH"); fn_SRCH_str = catgetlocal( 198, "SRCH"); fn_AL_str = catgetlocal( 199, "AL"); fn_AW_str = catgetlocal( 200, "AW"); fn_AC_str = catgetlocal( 201, "AC"); fn_PW_str = catgetlocal( 202, "PW"); fn_CUT_str = catgetlocal( 203, "CUT"); fn_FWD_str = catgetlocal( 204, "FWD"); fn_REV_str = catgetlocal( 205, "REV"); fn_MARK_str = catgetlocal( 206, "MARK"); fn_UNMARK_str = catgetlocal( 207, "UNMARK"); fn_APPEND_str = catgetlocal( 208, "APPEND"); fn_PREFIX_str = catgetlocal( 209, "PREFIX"); fn_COPY_str = catgetlocal( 210, "COPY"); fn_CMD_str = catgetlocal( 211, "CMD"); fn_PST_str = catgetlocal( 212, "PST"); fn_RD_str = catgetlocal( 213, "RD"); fn_UP_str = catgetlocal( 214, "UP"); fn_DOWN_str = catgetlocal( 215, "DOWN"); fn_LEFT_str = catgetlocal( 216, "LEFT"); fn_RIGHT_str = catgetlocal( 217, "RIGHT"); fn_BCK_str = catgetlocal( 218, "BCK"); fn_CR_str = catgetlocal( 219, "CR"); fn_EXPAND_str = catgetlocal( 220, "EXPAND"); fn_NOEXPAND_str = catgetlocal( 221, "NOEXPAND"); fn_EXIT_str = catgetlocal( 222, "EXIT"); fn_QUIT_str = catgetlocal( 223, "QUIT"); fn_LITERAL_str = catgetlocal( 224, "LITERAL"); fn_NOLITERAL_str = catgetlocal( 225, "NOLITERAL"); fn_STATUS_str = catgetlocal( 226, "STATUS"); fn_NOSTATUS_str = catgetlocal( 227, "NOSTATUS"); fn_INDENT_str = catgetlocal( 228, "INDENT"); fn_NOINDENT_str = catgetlocal( 229, "NOINDENT"); fn_OVERSTRIKE_str = catgetlocal( 230, "OVERSTRIKE"); fn_NOOVERSTRIKE_str = catgetlocal( 231, "NOOVERSTRIKE"); fn_CASE_str = catgetlocal( 232, "CASE"); fn_NOCASE_str = catgetlocal( 233, "NOCASE"); fn_WINDOWS_str = catgetlocal( 234, "WINDOWS"); fn_NOWINDOWS_str = catgetlocal( 235, "NOWINDOWS"); fn_HELP_str = catgetlocal( 236, "HELP"); fn_MENU_str = catgetlocal( 237, "MENU"); fwd_mode_str = catgetlocal( 238, "forward mode"); rev_mode_str = catgetlocal( 239, "reverse mode"); ECHO_str = catgetlocal( 240, "ECHO"); cmd_prompt = catgetlocal( 241, "command: "); PRINTCOMMAND_str = catgetlocal( 242, "PRINTCOMMAND"); replace_action_prompt = catgetlocal( 243, "replace (r or <return>), skip (s), all occurrances (a), quit (q): "); replace_prompt_str = catgetlocal( 244, "/old_string/new_string/ : "); replace_r_char = catgetlocal( 245, "r"); replace_skip_char = catgetlocal( 246, "s"); replace_all_char = catgetlocal( 247, "a"); quit_char = catgetlocal( 248, "q"); yes_char = catgetlocal( 249, "y"); no_char = catgetlocal( 250, "n"); cant_find_match_str = catgetlocal( 251, "unable to find matching character"); fmting_par_msg = catgetlocal( 252, "...formatting paragraph..."); cancel_string = catgetlocal( 253, "press Esc to cancel"); menu_too_lrg_msg = catgetlocal( 254, "menu too large for window");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -