翻译po

翻译一个po文件。确认安装了gettext工具包。

cd到po目录,创建pot
intltool-update –pot

创建相应的语言文件,例如zh_CN
msginit -l zh_CN.utf8

程序会提示选择或输入邮箱,之后就会生成zh_CN.po文件,打开文件,逐条编辑msgstr即可。

手动编辑LINGUAS文件,按顺序将zh_CN添加到其中。

可以通过这个命令查看翻译的进度
msgfmt -cv zh_CN.po

对于更新pot更新的情况,可以使用命令更新po文件
intltool-update zh_CN

参考:

Emerillon: map viewer for gnome desktop

自从libchamplain / geoclue等库发布之后,gnome桌面的地理信息工具和支持发展很迅速:例如之前提到过的eye-of-gnome的地理信息插件,根据EXIF信息在地图上显示。现在gnome桌面上终于有一个专门的地图查看器了,仍然是基于libchamplain,名字叫做emerillon

Emerillon Map Viewer

仍然是使用open street maps,这两年上海的地图发展的非常不错,连最新的二号线东延都已经被标注出来了。相比之下,南京的地图就还是一片空白。

在Ubuntu上安装emerillon,可以从其网站上下载源码编译安装:
http://www.novopia.com/emerillon/download.html

emerillon的几个主要依赖:

  • libchamplain
  • librest
  • ethos

libchamplain在ubuntu 9.10的仓库已经包含

librest也在软件仓库中,不过需要注意的是ubuntu将librest安装在pkg-config里时的名字叫做rest.pc,而emerillon查找的是rest-0.6.pc,所以需要手动建立一个软连接:
sudo ln -s /usr/lib/pkgconfig/rest.pc /usr/lib/pkgconfig/rest-0.6.pc

ethos是一个Gtk的插件框架,目前还不在软件仓库中,需要从网站下载代码编译:
http://git.dronelabs.com/ethos/
ethos网站上提到的PPA源中的版本偏旧,不建议使用。

实际上也可以直接添加emerillon的PPA源:
deb http://ppa.launchpad.net/mathieu-tl/emerillon/ubuntu karmic main
deb-src http://ppa.launchpad.net/mathieu-tl/emerillon/ubuntu karmic main

另外,也可以通过Ubuntu Tweak安装。

作者Blog:
http://blog.pierlux.com/en/

Restore Nautilus to open gnome menu after installed PCManFM

After installed PCMan File Manager with LXDE, the gnome “places” menu items were opened by PCManFM as default. To switch back to nautilus, follow these steps:

  1. check /usr/share/applications/nautilus-folder-hanlder.desktop
    make sure the line “Exec=nautilus” is not modified. (There are lots of hack article that teach user to change default file manager by modify this)
  2. check /usr/share/applications/defaults.list
    grep the line “x-directory” by
    cat /usr/share/applications/defaults.list | grep x-directory
    make sure the value was kept as “nautilus-folder-handler.desktop”, if not, restore it.
    Then grep the line “inode” by
    cat /usr/share/applications/defaults.list | grep inode
    also be sure about the result “nautilus-folder-handler.desktop”. if not, restore it again.
  3. So it must be your own configuration that has been changed. check ~/.local/share/applications/defaults.list
    grep the two lines described above, it must be changed to “pcmanfm-folder-handler.desktop”, so replace them by “nautilus-folder-handler.desktop”

To check the result, click menu item at once (no restart or logout needed), again, you see the slow file manager…

Jetty7/JSP, Eclipse/GTK2.18

Jetty7.0上周发布了,这是jetty迁进eclipse社区之后的第一个正式版本。但是下载之后发现这个版本居然没有jsp支持。原来,jetty的jsp实现一直使用的是glassfish的实现,嵌入eclipse社区之后,这变成了一个问题。功能完全的版本(hightide)依然可以从codehaus的镜像里下载:
http://dist.codehaus.org/jetty/

比较一下大小就能看出,eclipse的版本只有2.1M,hightide的版本15M。为此,社区里有详细的讨论:
http://dev.eclipse.org/mhonarc/lists/jetty-dev/msg00198.html

Gnome2.28发布了,但是Eclipse在Gtk2.18上工作时,会发生按钮失灵的问题,主要集中在finish next和ok等关键的按钮。简单的解决方法是焦点在按钮上时通过按回车来执行。比较彻底的方法是在eclipse执行的环境中,设置环境变量GDK_NATIVE_WINDOWS=true

这个bug被报告在这里:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=291257

Gnome Shell

续昨,好吧,这个无聊的国庆假期就献给karmic了。gnome-shell已经可以在软件仓库里找到了,apt-get安装即可。要使用gnome-shell可以执行
gnome-shell –replace

要把gnome-shell作为默认的窗口管理器,打开gnome的配置编辑器,找到/desktop/gnome/session/required_components,把panel和windown-manager全部改成gnome-shell,重新登录即可。

上个图:

当然了,还没有正式release,大家试用尝鲜注意安全第一。