Giter Club home page Giter Club logo

Comments (21)

alexandrevicenzi avatar alexandrevicenzi commented on June 15, 2024

Hi, here's the right config.

# Default theme language.
# You can't change this one.
I18N_TEMPLATES_LANG = 'en'

# Your language.
DEFAULT_LANG = 'de'
OG_LOCALE = 'de_DE'
LOCALE = 'de_DE'

from flex.

ncharlot avatar ncharlot commented on June 15, 2024

Thx @alexandrevicenzi.

I did already try that but it's not working better...
Any idea?

This this the actual conf:

I18N_TEMPLATES_LANG = 'en'
DEFAULT_LANG = 'fr'
LOCALE = 'fr_FR'
OG_LOCALE = 'fr_FR'

JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']}

PLUGIN_PATHS = ['pelican-plugins']
PLUGINS = ['i18n_subsites']

from flex.

alexandrevicenzi avatar alexandrevicenzi commented on June 15, 2024

Try with German, Spanish or any other.

If none works is some Pelican misconfig. If not, it's a problem with the french translation.

from flex.

ncharlot avatar ncharlot commented on June 15, 2024

So it seems to be a Pelican misconfig :(

from flex.

JesusMtnez avatar JesusMtnez commented on June 15, 2024

In #73 I reported a similar problem. Using pelican 3.6.3 it works.

from flex.

JesusMtnez avatar JesusMtnez commented on June 15, 2024

@ncharlot what version are you using?

from flex.

ncharlot avatar ncharlot commented on June 15, 2024
$ pip freeze
...
pelican==3.7.0
...

from flex.

JesusMtnez avatar JesusMtnez commented on June 15, 2024

Try 3.6.3

from flex.

ncharlot avatar ncharlot commented on June 15, 2024

Downgrade to 3.6.3 causes this error:

AttributeError: 'Environment' object has no attribute 'install_gettext_translations'

from flex.

JesusMtnez avatar JesusMtnez commented on June 15, 2024

Replace

JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']}

with

JINJA_EXTENSIONS = ['jinja2.ext.i18n']

from flex.

ncharlot avatar ncharlot commented on June 15, 2024

It's ok!

So it was a regression.

from flex.

alexandrevicenzi avatar alexandrevicenzi commented on June 15, 2024

Actually it's a Flex bug, due the version 3.7.

from flex.

alexandrevicenzi avatar alexandrevicenzi commented on June 15, 2024

Due the change in Pelican 3.7:

Old way

JINJA_EXTENSIONS = ['jinja2.ext.i18n']

New way

JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']}

This code breaks.

The solution is change the way we validade if i18n is enabled.

from flex.

ncharlot avatar ncharlot commented on June 15, 2024

Ok I can look at the fix.

from flex.

alexandrevicenzi avatar alexandrevicenzi commented on June 15, 2024

@ncharlot remember, It must work with 3.6 and 3.7, so we just need to add an OR statement.

from flex.

ncharlot avatar ncharlot commented on June 15, 2024

Ok.

from flex.

ncharlot avatar ncharlot commented on June 15, 2024

PR: #75

from flex.

alexandrevicenzi avatar alexandrevicenzi commented on June 15, 2024

Fixed by #75

from flex.

Phyks avatar Phyks commented on June 15, 2024

Trying master with Pelican 3.7.1 and Jinja2 up to date, gives a CRITICAL: UndefinedError: 'gettext' is undefined error, when trying to use this snippet in combination with JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']}.

from flex.

alexandrevicenzi avatar alexandrevicenzi commented on June 15, 2024

@Phyks what OS?

from flex.

Phyks avatar Phyks commented on June 15, 2024

I am using Linux.

from flex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.