duanpang5583 2009-04-29 13:37
浏览 37

如何说服其他程序员使用Gettext?

I have used GNU Gettext successfully in many projects I have worked in, but at my latest job I have suddenly found myself forced to work with a really awkward localization system.

The current system stores translations in database and adding new translation goes something like this:

  • add function call with translation key to source code, e.g. print translate('foo');
  • add few SQL INSERT statements to translations.sql file.
  • create file with name (current revision nr + 1).sql
  • execute .sql file in database.
  • commit your changes (before somebody else manages to commit and change current revision number).

All this process is completely manual and you have to repeat almost all of it even when you need to fix a small typo. There is no support for plural forms. The whole translations database is quite a mess as translations almost never get deleted from it - only added and updated.

I have tried several arguments to convince other developers (especially one particular dev):

  • I have talked about Gettext being established standard and that there are many tools available for working with PO files.
  • I have tried to explain that storing translations in database has no benefits over storing them to text file - we are just retrieving translations from database by key, nothing more.
  • The other developer is working on PHP part of our app and PHP has Gettext built in. I'm working on JavaScript side, which doesn't have Gettext support, but I have built my own tools for it in the past.
  • Our app isn't so big, that converting from old system to Gettext would take a lot of time even when done manually and I'm quite sure it can be easily automated.
  • I have even successfully used Gettext for one smaller app in our company.

But people still aren't convinced. What might I be doing wrong?

Edit:

A few months after posting this question we are now finally transitioning to Gettext. When we needed to support more than two languages the disadvantages of our current system bacame more apparent to those resisting it so far.

  • 写回答

3条回答 默认 最新

  • dongzao9044 2009-04-29 13:45
    关注

    I can see several options for you:

    • You could try estimating the time (money) saved by using your method.
    • You could show (demo?) how much easier it is to maintain (less headaches).
    • You could go ahead and use the system that is already in place.
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度