From devi.webmaster at gmail.com Wed Mar 5 13:57:40 2008 From: devi.webmaster at gmail.com (Daniel Brumbaugh Keeney) Date: Wed, 5 Mar 2008 12:57:40 -0600 Subject: [gettext-u-en] Backticks instead of _() Message-ID: <3bceeb2d0803051057mc97fd19ga9d2282efbe38f2c@mail.gmail.com> ---------- Forwarded message ---------- From: Trans Date: Mon, Mar 3, 2008 at 9:53 AM Subject: Re: Named sprintf parameters To: Daniel Brumbaugh Keeney ... Although my use-case wasn't language based, just template based, I see how this could be used. But I never much cared for they syntax such libraries used. It really clutters the code --I know _() tried to mitigate that, and it helps, but it still clutters. It's too bad there 's no way to tap into Ruby's String.new call for string literals. That would be pretty slick. However, it does occur to me that #` could be overridden and used. That would be pretty nice too. For example: require 'gettext' class Test include GetText bindtextdomain("hello") def say_hello puts `Hello World` end end It does mean that the normal system call use of #` can't be used in the same module, but that's easy to work around via an alias. I would be much more inclined to use a lib like gettext if it were That clean. T. First of all, I think trapping string literals, even if it were possible, is not adviseable. There are a great many strings which are not for translation. However, Trans' suggestion regarding backticks is possible and "cleaner". I'm inclined to consider it. Could it be done? Could it be optional? Moving from a 5 character deliminator to a 2 character delimiter makes a lot of difference to some people. ( _("") vs `` ) I'm not really sure if it's worth such a backwards-incompatible change or not, but I thought this message deserved forwarding. Daniel Brumbaugh Keeney