You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Peter N. Lundblad" <pe...@famlundblad.se> on 2005/06/02 19:57:40 UTC

Re: Language negotiation and localization of server-generated messages (see URL!)

On Thu, 2 Jun 2005, Nicolás Lichtmaier wrote:

> Daniel L. Rall wrote:
>
> >Nicolás Lichtmaier wrote something along the lines of the module
> >referenced in the "Possible implementation" section
> ><http://svn.haxx.se/dev/archive-2004-04/0788.shtml>, which has been
> >committed to the server-l10n branch.  However, it depends upon the GNU
> >gettext .mo format, and the GNU implementation may not be available on
> >all platforms (unless re-implemented).  This module will need to be
> >enhanced or replaced, ideally completely obviating the need for
> >linkage against a platform's own gettext implementation.
> >
>
> You seem to imply that my code depends in some way on GNU gettext code.
> That's not true. Of course there's a dependency on msgfmt for creating
> the .mo files, but that's already the case in Subversion. Using an
> accepted file format for message catalogs is not a downside, is a plus!
>
But is that file format the same in non-GNU gettext implementations? Else
we start depending on GNU gettext, and can't use the systems's gettext
anymore.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Language negotiation and localization of server-generated messages (see URL!)

Posted by Nicolás Lichtmaier <ni...@reloco.com.ar>.
>>>But is that file format the same in non-GNU gettext implementations? Else
>>>we start depending on GNU gettext, and can't use the systems's gettext
>>>anymore.
>>>      
>>>
>>But I see no other way. System implementations work with a per-process
>>locale. The only option I see other than forcing GNU's gettext
>>everywhere is to fork a child for each locale and delegate gettext
>>invocation to these childs...
>>    
>>
>Or invent our own format and write our own msgfmt (we could still use GNU
>tools to validate if available). I'm not saying that this is ideal, but
>it's another possibility.
>  
>

Why not just including it, as many projects do, and ignore the system 
gettexts? Gettext is LGPL, which is totally acceptable for Subversion.

>I don't knopw how big a problem it is to depend on GNU gettext.  But it
>seems fragile to depend on a proprietary .mo format.
>  
>

GNU's .mo format is not prprietary.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Language negotiation and localization of server-generated messages (see URL!)

Posted by Michael R Sweet <mi...@easysw.com>.
Daniel Rall wrote:
> On Thu, 2005-06-02 at 17:08 -0400, Michael Sweet wrote:
> ...
> 
>>I've actually got some code that reads .po files and compiles to a
>>compact binary format, which you can then load and use on-the-fly,
>>even supporting multiple languages from the same thread.
> 
> 
> Does it use the same format as the .mo files, which are easily mmap'd
> into shared memory?

Since the .mo format isn't documented (at least not that I've found,
anyways), my code uses its own binary format that is "compiled" from
the .po files.  It is conceivable that you could mmap() the files,
however I've avoided any non-portable constructs and just read the
files using stdio functions.

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Publishing Software        http://www.easysw.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Language negotiation and localization of server-generated messages (see URL!)

Posted by Daniel Rall <dl...@finemaltcoding.com>.
On Thu, 2005-06-02 at 17:08 -0400, Michael Sweet wrote:
...
>I've actually got some code that reads .po files and compiles to a
>compact binary format, which you can then load and use on-the-fly,
>even supporting multiple languages from the same thread.

Does it use the same format as the .mo files, which are easily mmap'd
into shared memory?



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Language negotiation and localization of server-generated messages (see URL!)

Posted by Michael Sweet <mi...@easysw.com>.
Peter N. Lundblad wrote:
> On Thu, 2 Jun 2005, Nicolás Lichtmaier wrote:
> 
> 
>>>But is that file format the same in non-GNU gettext implementations? Else
>>>we start depending on GNU gettext, and can't use the systems's gettext
>>>anymore.
>>>
>>>
>>
>>But I see no other way. System implementations work with a per-process
>>locale. The only option I see other than forcing GNU's gettext
>>everywhere is to fork a child for each locale and delegate gettext
>>invocation to these childs...
>>
> 
> Or invent our own format and write our own msgfmt (we could still use GNU
> tools to validate if available). I'm not saying that this is ideal, but
> it's another possibility.
> 
> I don't knopw how big a problem it is to depend on GNU gettext.  But it
> seems fragile to depend on a proprietary .mo format.

I've actually got some code that reads .po files and compiles to a
compact binary format, which you can then load and use on-the-fly,
even supporting multiple languages from the same thread.  The code
will be part of CUPS 1.2 and I've been using it in flPhoto and the
CUPS DDK for a couple years now.

Let me know if you are interested, I'll be happy to donate to the
cause!

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Document Software          http://www.easysw.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Language negotiation and localization of server-generated messages (see URL!)

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Thu, 2 Jun 2005, Nicolás Lichtmaier wrote:

>
> >But is that file format the same in non-GNU gettext implementations? Else
> >we start depending on GNU gettext, and can't use the systems's gettext
> >anymore.
> >
> >
>
> But I see no other way. System implementations work with a per-process
> locale. The only option I see other than forcing GNU's gettext
> everywhere is to fork a child for each locale and delegate gettext
> invocation to these childs...
>
Or invent our own format and write our own msgfmt (we could still use GNU
tools to validate if available). I'm not saying that this is ideal, but
it's another possibility.

I don't knopw how big a problem it is to depend on GNU gettext.  But it
seems fragile to depend on a proprietary .mo format.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Language negotiation and localization of server-generated messages (see URL!)

Posted by Nicolás Lichtmaier <ni...@reloco.com.ar>.
>>You seem to imply that my code depends in some way on GNU gettext code.
>>That's not true. Of course there's a dependency on msgfmt for creating
>>the .mo files, but that's already the case in Subversion. Using an
>>accepted file format for message catalogs is not a downside, is a plus!
>>    
>>
>But is that file format the same in non-GNU gettext implementations? Else
>we start depending on GNU gettext, and can't use the systems's gettext
>anymore.
>  
>

Oh, you are right. I've missed that. The .mo format is gettext specific.

But I see no other way. System implementations work with a per-process 
locale. The only option I see other than forcing GNU's gettext 
everywhere is to fork a child for each locale and delegate gettext 
invocation to these childs...


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Language negotiation and localization of server-generated messages (see URL!)

Posted by Daniel Rall <dl...@finemaltcoding.com>.
On Thu, 2005-06-02 at 21:57 +0200, Peter N. Lundblad wrote:
>On Thu, 2 Jun 2005, Nicolás Lichtmaier wrote:
>
>> Daniel L. Rall wrote:
>>
>> >Nicolás Lichtmaier wrote something along the lines of the module
>> >referenced in the "Possible implementation" section
>> ><http://svn.haxx.se/dev/archive-2004-04/0788.shtml>, which has been
>> >committed to the server-l10n branch.  However, it depends upon the GNU
>> >gettext .mo format, and the GNU implementation may not be available on
>> >all platforms (unless re-implemented).  This module will need to be
>> >enhanced or replaced, ideally completely obviating the need for
>> >linkage against a platform's own gettext implementation.
>> >
>>
>> You seem to imply that my code depends in some way on GNU gettext code.
>> That's not true. Of course there's a dependency on msgfmt for creating
>> the .mo files, but that's already the case in Subversion. Using an
>> accepted file format for message catalogs is not a downside, is a plus!
>>
>But is that file format the same in non-GNU gettext implementations? Else
>we start depending on GNU gettext, and can't use the systems's gettext
>anymore.

Peter's clarification here is where the statement upon GNU gettext
dependency -- on the package which supplies msgfmt, rather than the API
-- originally came from.  Do you know whether the format of the .mo
files created by GNU msgfmt is "standard"?

Here's a somewhat relevant section from configure.in:

USE_NLS="no"
if test "$enable_nls" = "yes"; then
  dnl First, check to see if there is a working msgfmt.
  AC_PATH_PROG(MSGFMT, msgfmt, none)
  AC_PATH_PROG(MSGMERGE, msgmerge, none)
  AC_PATH_PROG(XGETTEXT, xgettext, none)
  if test "$MSGFMT" != "none"; then
    AC_SEARCH_LIBS(bindtextdomain, [intl], [],
                   [
                    AC_MSG_WARN([bindtextdomain() not found.  Disabling
NLS.])
                    enable_nls="no"
                   ])
    if test "$enable_nls" = "yes"; then
      AC_DEFINE(ENABLE_NLS, 1,
                [Define to 1 if translation of program messages to the
user's
                 native language is requested.])
      USE_NLS="yes"
    fi
  fi
fi



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org