getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.58k stars 1.81k forks source link

Incorrect date formatting on Russian Locale #3050

Closed Vuizur closed 1 year ago

Vuizur commented 2 years ago

Issue

I am following the tutorial and have created a new project. The DEFAULT_LANG constant in pelicanconf has been set to "en", my system, however, is set to Russian.

I pasted the example MD file into the content folder and generate the HTML. However when I open the webpage I get as the published date Published: ?? 03 ??????? 2010. (I think this is probably caused by my PC language being set to Russian.) Here is the generated index.html file:

<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta name="generator" content="Pelican" />
        <title>Language Tech</title>
        <link rel="stylesheet" href="/theme/css/main.css" />
</head>

<body id="index" class="home">
        <header id="banner" class="body">
                <h1><a href="/">Language Tech</a></h1>
                <nav><ul>
                    <li><a href="/category/review.html">Review</a></li>
                </ul></nav>
        </header><!-- /#banner -->

            <aside id="featured" class="body">
                <article>
                    <h1 class="entry-title"><a href="/my-first-review.html">My First Review</a></h1>
<footer class="post-info">
        <abbr class="published" title="2010-12-03T10:20:00+01:00">
                Published: ?? 03 ??????? 2010
        </abbr>

        <address class="vcard author">
                By                         <a class="url fn" href="/author/hannes-krumbiegel.html">Hannes Krumbiegel</a>
        </address>
<p>In <a href="/category/review.html">Review</a>.</p>

</footer><!-- /.post-info --><p>Following is a review of my favorite mechanical keyboard.</p>                </article>
            </aside><!-- /#featured -->
        <section id="extras" class="body">
                <div class="blogroll">
                        <h2>links</h2>
                        <ul>
                            <li><a href="https://getpelican.com/">Pelican</a></li>
                            <li><a href="https://www.python.org/">Python.org</a></li>
                            <li><a href="https://palletsprojects.com/p/jinja/">Jinja2</a></li>
                            <li><a href="#">You can modify those links in your config file</a></li>
                        </ul>
                </div><!-- /.blogroll -->
                <div class="social">
                        <h2>social</h2>
                        <ul>

                            <li><a href="#">You can add links in your config file</a></li>
                            <li><a href="#">Another social link</a></li>
                        </ul>
                </div><!-- /.social -->
        </section><!-- /#extras -->

        <footer id="contentinfo" class="body">
                <address id="about" class="vcard body">
                Proudly powered by <a href="https://getpelican.com/">Pelican</a>, which takes great advantage of <a href="https://www.python.org/">Python</a>.
                </address><!-- /#about -->

                <p>The theme is by <a href="https://www.smashingmagazine.com/2009/08/designing-a-html-5-layout-from-scratch/">Smashing Magazine</a>, thanks!</p>
        </footer><!-- /#contentinfo -->

</body>
</html>

PS: Thanks for all the hard work creating this tool!

avaris commented 2 years ago

You probably need to define a LOCALE setting in your configuration.

Vuizur commented 2 years ago

Thanks for the answer! Setting the locale to anything like "ru", "en", or "de-DE" (which Powershell outputs as the system locale) works great with the desired result.

I have no idea why the default locale would not work though.

justinmayer commented 1 year ago

@Vuizur: Thanks for the kind words! Glad you are finding Pelican to be useful for you. If there is anything else we can do to assist, please let us know. 💫