Considerations needed to propose a binary dependency (Gettext)

218 views
Skip to first unread message

Ismael Venegas Castelló

unread,
Apr 20, 2016, 10:24:08 AM4/20/16
to julia-dev
Hello everyone!

In this case I'm interested in making Julia use and build GNU Gettext by default along with the other dependencies it currently has. I want to be able to use gettext in order to internationalize Julia, currently I'm working with the JuliaParser.jl (which I assume someday would replace the Femtolisp one?) something like this:

msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

msgid "true"
msgstr "verdadero"

msgid "false"
msgstr "falso"

msgid "begin"
msgstr "empezar"

msgid "while"
msgstr "mientras"

msgid "if"
msgstr "si"

msgid "for"
msgstr "por"

msgid "try"
msgstr "intentar"

msgid "return"
msgstr "retornar"

msgid "break"
msgstr "romper"

msgid "continue"
msgstr "continuar"

msgid "function"
msgstr "función"

msgid "stagedfunction"
msgstr "funciónetapas"

msgid "quote"
msgstr "comilla"

msgid "let"
msgstr "sea"

msgid "abstract"
msgstr "abstracto"

msgid "typealias"
msgstr "aliastipo"

msgid "type"
msgstr "tipo"

msgid "bitstype"
msgstr "tipobits"

msgid "immutable"
msgstr "inmutable"

msgid "ccall"
msgstr "llamarc"

msgid "do"
msgstr "hacer"

msgid "module"
msgstr "módulo"

msgid "baremodule"
msgstr "módulorazo"

msgid "using"
msgstr "usando"

msgid "import"
msgstr "importar"

msgid "export"
msgstr "exportar"

msgid "importall"
msgstr "importartodo"

msgid "else"
msgstr "sino"

msgid "elseif"
msgstr "osi"

msgid "end"
msgstr "fin"

msgid "catch"
msgstr "atrapar"

msgid "finally"
msgstr "finalmente"

But currently Gettext.jl uses PyCall. Anyway I also want to be able to translate all strings in Julia (errors, warnings, infos, show, repr, etc.) not only the reserved words. This would be part of a JulEP which I'm planning.

Currently I'm trying to refactor JuliaParser.jl in order to make it more modular and to document it, so I can elaborate my final JulEP and propose merging this functionality into base JuliaParser and eventually into Julia itself.

Thanks in advance, cheers!

Tony Kelman

unread,
Apr 20, 2016, 11:36:29 AM4/20/16
to julia-dev
Licensing and portability, mostly. GNU gettext is GPL which is not acceptable for new dependencies of base, unfortunately, unless there is a linking exception like libgit2 has. The other existing GPL dependencies of base are scheduled to be removed from base. If you can come up with a feasible design where internationalization happens as a plugin where the gettext library is not absolutely required but can be optionally added, that might work. Otherwise you'd need to find a BSD or MIT licensed implementation.

Milan Bouchet-Valat

unread,
Apr 20, 2016, 12:03:40 PM4/20/16
to juli...@googlegroups.com
I think I mentioned this in another thread, but libintl provides a BSD-
licensed implementation which is apparently more or less compatible
with gettext 0.18.1:
https://wiki.netbsd.org/projects/project/libintl/
https://gitlab.com/worr/libintl

Anyway, gettext is a typical case of an optional dependency: just
define a few fallbacks in the style of
_(x::AbstractString) = x

and you get a build without any dependency on gettext. You'd still need
it to manage translation files, but only for developers.


Regards

Ismael Venegas Castelló

unread,
Apr 20, 2016, 12:46:44 PM4/20/16
to julia-dev
Thank you very much Milan, yeah I had forgoten you mentioned it, is this legaly the same conditions as in BSD? I don't know to much about this:

libintl is under the following copyright:

Copyright (c) 2000, 2001 Citrus Project
Copyright (c) 2015 William Orr <will@worrbase.com>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification
, are permitted provided that the following conditions
are met
:
1. Redistributions of source code must retain the above copyright
   notice
, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
   notice
, this list of conditions and the following disclaimer in the
   documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS
``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES
, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED
.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT
, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY
, WHETHER IN CONTRACT, STRICT
LIABILITY
, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE
, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE
.

All other files (parts of NetBSD's libc) are under their original license in
the headers of the appropriate files.



I just want to make sure, this would be a BSD Clause 2 simplified license, am I right ans so is ok?  

Jim Garrison

unread,
Apr 20, 2016, 1:09:07 PM4/20/16
to juli...@googlegroups.com
If my memory serves correctly, the gettext code wrapped by Gettext.jl is actually built in to python, which is licensed permissively.  It happens to be compatible with GNU gettext, but it does not depend on it.  I believe it should be possible to translate this code to Julia (issue #1 of Gettext.jl).

Milan Bouchet-Valat

unread,
Apr 20, 2016, 1:19:48 PM4/20/16
to juli...@googlegroups.com
Le mercredi 20 avril 2016 à 09:46 -0700, Ismael Venegas Castelló a écrit :
> Thank you very much Milan, yeah I had forgoten you mentioned it, is
> this legaly the same conditions as in BSD? I don't know to much about
> this:
>
> libintl is under the following copyright:
>
> Copyright (c) 2000, 2001 Citrus Project
> Copyright (c) 2015 William Orr <wi...@worrbase.com>
Yes, as you can see, this is exactly the text of the 2-clause BSD
license. So you're safe.


Regards

Ismael Venegas Castelló

unread,
Apr 20, 2016, 3:49:17 PM4/20/16
to julia-dev
Thank you very much everyone for your input, Jim I wasn't sure about the Python license, thanks for clearing that out, I was under the impression that basing Julia code in Python standard library code was a no no.

Once again just to make sure, the license in the root of their git repository is the one that also covers this file and is ok:

https://github.com/python/cpython/blob/master/LICENSE

So many licensing details, if this is true, then this is the best version to port into Julia, great!

Páll Haraldsson

unread,
May 26, 2016, 8:46:54 AM5/26/16
to julia-dev

I do support you wanting GetText (or libintl or whatever) working (for Julia programs, if not the implementations itself).

Anyway I also want to be able to translate all strings in Julia (errors, warnings, infos, show, repr, etc.) not only the reserved words. This would be part of a JulEP which I'm planning.

I'm very conflicted on translated error [programmer] message etc.. [what will be the burden on those only using English for core Julia developers?] I've seen e.g. German ones in Ubuntu, and it divides the world of support.. Maybe ok, if English-language error is appended (prepended?).

There is an Icelandic language, Fjölnir (and Arabic, Chinese? etc.) that is not a huge success.. Maybe your plan will work to get beginners working, but wouldn't they want to learn the standard syntax anyway later? I understand Ruby has more (than Python) symbolic code over English-keywords, since Matz is Japanese..

Could some tool/macro? translate your source code to/from English?

Páll Haraldsson

unread,
May 26, 2016, 9:02:14 AM5/26/16
to julia-dev
On Wednesday, April 20, 2016 at 7:49:17 PM UTC, Ismael Venegas Castelló wrote:
I was under the impression that basing Julia code in Python standard library code was a no no.

https://www.openhub.net/p/JuliaLang/analyses/latest/languages_summary

I was little surprised seeing Python at 18,630 lines of code (second after "Mostly written in C")..

I believe this isn't true at all.. and should say Julia(?) as looks sufficiently similar?

Reply all
Reply to author
Forward
0 new messages