On Mittwoch, 8. Februar 2017 12:22:27 Michael Merickel wrote:
> On Wed, Feb 8, 2017 at 11:36 AM, Hans-Peter Jansen <h...@urpla.net
> > As a consequence, all these packages will depend on lingua then..
> Do the packages actually need to depend on lingua? I see that your PR to
> deform doesn't add it, however deform expects it to in the dev environment
> (tests, running i18n.sh, etc). I'm just trying to clarify if you're saying
> it would be a new runtime dependency.
AFAICS, it's not a runtime dependency, it's needed for i18n work only (as long
as the mo files are tarred up)..
> > One downside of this move: jinja2 support depends on babel, and needs some
> > configuration file support for pot-create, that has to be patched into
> > i18n.sh
> > before:
> The quick history here, as I know it:
> - Pyramid, etc shipped using babel for everything.
> - Babel didn't support py3.
> - For that reason and I'm sure many other reasons, Wichert created lingua
> and submitted a few PRs to pyramid to start using it in the documentation.
Thanks for the intro. Yeah, I know, Armin Ronacher add his Py3 crusade..
> I personally don't know what the state of the art is now that babel
> supports py3 I haven't needed to write a fully i18n app myself and so my
> knowledge is only limited to diving in and fixing certain bugs or reviewing
I'm just starting with Pyramid (ahem, websauna) in a project, that essentially
needs full i18n support.. Therefor, I try to wrap my head around all these
loose ends ATM. Not that easy, because the web is full of misleading
information in this regard as well.
Since I cannot depend on hearsay, I started with the simplest possible task,
having a pyramid-cookiecutter-starter project localized. Since that uses
jinja2 templating only, babel is sufficient. Adding deform makes lingua
necessary, since babel doesn't support chameleon templates (to my knowledge).
lingua depends on babel, when it comes to jinja2 extraction. Oh, well..
Sorry for not having expressed that from the beginning.
> I very much appreciate your work on this and would love to see things get
> standardized and modernized. I've had several people ask in #pyramid on IRC
> why things are not working as our docs kinda sort of tell you to use both
> babel and lingua without definitively explaining anything as I think they
> were only partially updated when switching to lingua.
Maybe, with your insight into Pyramid and my intention to have a properly
working i18n in _all_ these packages, we can tidy up that mess a bit.
As of now, I don't see the need for babel and lingua as runtime dependencies
at all. babel brings in a lot of useful things, that a fully localized app can
make use of, but none of that is used in the mentioned packages ATM. lingua is
created for message extraction only (with a script called pot-create). I can
add a test to i18n to check, if pot-create exists, and bail out with an
installation hint otherwise.
In order to make the translation infrastructure universally useful, we can:
* add the i18n.sh script
* ask for installation of babel and lingua, if one is missing
* add a lingua.cfg:
default-engine = tales
default-engine = tales
.jinja2 = babel-jinja2
.mako = babel-mako
Working with translations would boil down to:
* create language: ./i18n.sh lang
* everything else: ./i18n.sh
By default, neither babel nor lingua is a runtime dependency.