|
|
发表于 2009-9-25 22:26:09
|
显示全部楼层
确认偶这里 LANGUAGE 对 vim 起作用,确认 gvim 使用了 gettext:
编译时没有使用 --disable-nls, 另 gvim --version
- $ LANG= LC_ALL= gvim --version
- Compiled by root@localhost
- Normal version with GTK2 GUI. Features included (+) or not (-):
- -arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset +cindent
- +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
- +cryptv -cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic
- -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path
- +folding -footer +fork() [color="Red"]+gettext[/color] -hangul_input +iconv +insert_expand +jumplist
- -keymap -langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
- +mksession +modify_fname +mouse +mouseshape -mouse_dec +mouse_gpm
- -mouse_jsbterm -mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme
- +netbeans_intg -osfiletype +path_extra -perl +postscript +printer -profile
- -python +quickfix +reltime -rightleft -ruby +scrollbind +signs +smartindent
- -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
- -tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar
- +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
- +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact
- +xterm_clipboard -xterm_save
- system vimrc file: "/etc/vimrc"
- user vimrc file: "$HOME/.vimrc"
- user exrc file: "$HOME/.exrc"
- system gvimrc file: "$VIM/gvimrc"
- user gvimrc file: "$HOME/.gvimrc"
- system menu file: "$VIMRUNTIME/menu.vim"
- fall-back for $VIM: "/usr/share/vim"
- Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -g -O2
- Linking: gcc -L/usr/local/lib -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lXt -lncurses -lgpm
复制代码
确认 gnome 系软件包国际化不使用 gettext,LANGUAGE 无影响。
确认纯正 gtk 软件国际化,需要 gettext,LANGUAGE 有效,如 transmission,gvim 是特例。
另,debian lenny 默认不设置 LANGUAGE,执行 locale 也无输出;
但设置 LANGUAGE 后,执行 locale 有输出;
ubuntu 应是使用 debian glibc 补丁并默认设置该变量。
http://patch-tracker.debian.org/ ... print-LANGUAGE.diff
- Comments tell that LANG has to be the first value, and LC_ALL the last
- one. Thus LANGUAGE is printed between them.
- # DP: Dpatch author: Denis Barbier
- # DP: Patch author: Denis Barbier
- # DP: Upstream status: not submitted
- # DP: Date: 2006-01-08
- Index: locale/programs/locale.c
- ===================================================================
- --- locale/programs/locale.c.orig 2007-10-23 08:46:19.000000000 -0400
- +++ locale/programs/locale.c 2007-10-23 08:47:08.000000000 -0400
- @@ -752,6 +752,7 @@
- {
- size_t cat_no;
- const char *lcall = getenv ("LC_ALL");
- + const char *language = getenv ("LANGUAGE");
- const char *lang = getenv ("LANG") ? : "";
-
- auto void get_source (const char *name);
- @@ -770,6 +771,9 @@
- /* LANG has to be the first value. */
- printf ("LANG=%s\n", lang);
-
- + if (language != NULL && getenv ("POSIXLY_CORRECT") == NULL)
- + printf ("LANGUAGE=%s\n", language);
- +
- /* Now all categories in an unspecified order. */
- for (cat_no = 0; cat_no < NCATEGORIES; ++cat_no)
- if (cat_no != LC_ALL)
复制代码 |
|