getpelican / pelican-plugins

Collection of plugins for the Pelican static site generator
Other
1.39k stars 846 forks source link

Pelican 4.0.0 - language "th" not supported: Docutils-generated text will be in English #1087

Closed siongui closed 5 years ago

siongui commented 5 years ago

I use i18n_subsites to build websites with 2 lang - en and th (Thai). After upgrading to Pelican 4.0.0, I got the following similar messages for each processed article:

  | SystemMessage: /home/travis/build/siongui/ajahn-jayasaaro/content/articles/why-is-it-that-we-so-love-dhamma-by-ajahn-jayasaaro%en.rst:: (WARNING/2) language "th" not supported: Docutils-generated text will be in English.

Detail log on Travis CI

I googled the error message and found similar issue in getnikola/nikola#2437 This issue disappears when I use Pelican 3.7.1.

justinmayer commented 5 years ago

In the future, if reporting an issue related to plugins (like this one), please do so in the Pelican Plugins repository — not in the Pelican core repository. Thank you.

siongui commented 5 years ago

In the future, if reporting an issue related to plugins (like this one), please do so in the Pelican Plugins repository — not in the Pelican core repository. Thank you.

Thanks @justinmayer for the advice. I open in core repo because it happens on Pelican 4.0.0 but not on 3.7.1 with the same i18n_subsites code. So I think it's related to core repo instead of plugin. Actually this is the second issue related to Pelican 4 + i18n_subsites, and the first one opened in plugin repo ( getpelican/pelican-plugins#1086 ) has been fixed.

justinmayer commented 5 years ago

While we try to avoid it when we can, it’s not uncommon for changes in core to break plugins. When that happens, it’s usually not an indication that something is wrong with core, but that the plugin needs to be updated for compatibility with the latest core release.

avaris commented 5 years ago

We may need to revert getpelican/pelican#2256 or at the very least be a bit more smart about it (i.e. don't use any language code docutils not happy about).

cc @mosra

avaris commented 5 years ago

@siongui As a workaround for the time being, you can use the following to override the setting:

DOCUTILS_SETTINGS = {'language_code': 'en'}

That should make docutils not grumpy.

siongui commented 5 years ago

@avaris the workaround added in pelicanconf.py does not work.

CRITICAL: KeyError: 'filenames'

Please refer to the build log of Travis CI for complete log.

avaris commented 5 years ago

@siongui That's a different issue. Can we get output with --debug or DEBUG=1 make publish if you prefer that.

PS: I'm suspecting a plugin.

Edit: I think I found it. Yeah, this needs updating for pelican 4.0. (@oulenz, want to volunteer? :))

siongui commented 5 years ago

@avaris I enabled the debug output and I think your finding is correct. Please see last failed build log.

avaris commented 5 years ago

Yes.

Good news: Workaround is working. Bad news: i18n_subsites needs a look over before it's ready for pelican 4. I'm not surprised that it broke though, that plugin is tied to pelican internals very tightly.

siongui commented 5 years ago

Thanks @avaris and everybody for your advice. I used Pelican + i18n_subsites plugin for at least 10+ websites so it's important for me to keep them working without breaks. I will downgrade to Pelican 3.7.1 and wait for the final fixes. If you guys need someone to test your fixes, please tell me and I will see if I can help. Thanks!

oulenz commented 5 years ago

I may be able to have a look this weekend, although I have never used the i18n_subsites plugin myself.

avaris commented 5 years ago

@oulenz no worries. I meant, since you know a lot of the core changes and if you go over the code you might spot some obvious stuff easier. I'll go over it this weekend too.

@siongui Is it OK if I use this repo you've been linking to check and verify fixes?

siongui commented 5 years ago

@siongui Is it OK if I use this repo you've been linking to check and verify fixes?

@avaris Sure. I already invited you as collaborators. You can make any files changes (except content dir) and commits as you wish. The Travis CI build will be triggered automatically after you push commits of master branch to GitHub. Now I revert the changes of workaround and debug output and use Pelican 3.7.1. You can add it back and change it. Thanks!

avaris commented 5 years ago

@siongui I was planning to use it locally for testing and wanted to inform you. It's not easy to come up with a working setup that uses this plugin. I didn't have any intention of pushing anything to the repo, so I'm going to decline but thanks :).

oulenz commented 5 years ago

Ok, took me some time to understand that there's two issues now, and it's the second issue that's specific to i18n_subsites.

I think I figured out the source of the problem: this broke with my PR https://github.com/getpelican/pelican/pull/2381/files . I'll try to fix it tomorrow.

avaris commented 5 years ago

this broke with my PR

Yeah, that's why I pinged you :).