Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

Language mixed in plugins fullcalendar and Archive

Solved by Werner Joss View solution

Started by Hanns Mattes 2 years ago · 6 replies · 355 views
2 years ago

Hi,

I'm running www.brueckenkopf-hanau.de, happily using grav. It's a german site, so it should use german locale etc., which is working fine on the main site.

But with the Archive and the fullcalendar plugin, I get a mixture of german/english translations/time and date formats. For example: in the Archive-Sidebar I get the correct german headline "Archiv", but the month-names are displayed in english. With the fullcalendar, I get "today" instead of "heute" an the dates in the calendar are using pm/am-notation, while something like "Heute sind keine Termine geplant." ist displayed correctly.

What did I mess up? Let me know, which configurations should be shared,

Any hints appreciated.

Regards Hanns

2 years ago

hey Hanns,
it looks like the fullcalendar Plugin does not recognise your site's language settings, which should be 'de' - please check.
otherwise, you can override this in any case with

TXT
lang: de

in the frontmatter of your calendar page.
HTH
Werner (the fullcalendar developer)

👍 1
2 years ago

Hi, Werner,

thanks for Your reply.

There was already

language: de

set. changing it to the suggested "lang: de" didn't change anything.

I also find:

root@freebsd:/usr/local/www/apache24/data/brueckenkopf-hanau# grep -r "language: de"
user/pages/06.termine/calendar.md~:language: de
user/pages/04.aktuelles/drum-talk-mit-curt-cress/item.md:language: de
user/pages/04.aktuelles/blog.md: language: de
user/accounts/admin.yaml:language: de
root@freebsd:/usr/local/www/apache24/data/brueckenkopf-hanau# grep -r "lang: de"

user/pages/06.termine/calendar.md:lang: de
user/www.brueckenkopf-hanau.de/config/site.yaml:default_lang: de
user/config/site.yaml:default_lang: de
user/config/system.yaml: default_lang: de
user/config/system.yaml~: default_lang: de

Any idea?

Thx in advance

Hanns

2 years ago Solution

ok, settings seem to fit, however, when I look into the source of your calendar page, I cannot find this entry:

HTML
<div id="cfgLocale" style="display:none;">de</div>

which should have been added by the page template, based on your settings.
are you sure your calendar page uses the correct template calendar.html.twig from the plugin ?
the relevant part of the template is this:

TWIG
{% set lang = grav.language.getLanguage   %}
{% if page.header.lang|length > 0   %}
    {% set lang = page.header.lang    %}
{% endif %}
<div id='cfgLocale' style='display:none;'>{{ lang }}</div>
2 years ago

Hi, Werner,

the admin-interface claims, that the page is using a template called "Calendar". Where can I check, if this is correct?

Thanks Hanns

2 years ago

Bingo.

Obviously, it was conflicting with the events-plugin, which i had installed earlier (and forgot about ist). At a first glance, things are looking good.

Thx for Your Help, Werner, I really appreciate that.

Regards Hanns

last edited 01/03/24 by Hanns Mattes
2 years ago

ok, fine 😃 - I've been out of ideas yet after your post from 14:13.

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 49 1 week ago
Plugins · by Xavier, 4 weeks ago
2 57 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1184 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 50 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 75 2 months ago