-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
date format and translate #8
Comments
Installed on a Grav with the language enabled (e.g. in system.yaml:
the months will be translated, IF the months translation is available in Grav. You don't mention which language you want. Check your language file in https://github.com/getgrav/grav/tree/develop/system/languages contains MONTHS_OF_THE_YEAR translation |
And still english text |
see syndes.nl |
Post your plugin configuration, |
|
Are you using the latest release of this plugin? Because of a bug I just noticed, it will just use that format, and not use the format set in the plugin options, was a recent PR side-effect which I'm going to fix. As for the blog post date, that's another thing. That's handled by the theme, which might not be using the translation functionality. Which theme is that? |
Archive version 1.4.0. |
About the theme and the date. |
Yes Antimatter is not translating the date currently. Am trying to look how the dates can be translated automatically based on the language. The date format of the Archives plugin should be like this: http://gravstrap.diblas.net/my-gravtastic-blog |
So, this is an issue caused by the I checked it because it was too strange. That plugin overrides this Archives plugin output (and other plugins output too) in https://github.com/giansi/grav-plugin-blog/blob/master/templates/blog/bootstrap/blog_theme.html.twig#L160-L178, thus causing a bit of an issue here, because the output is different, causing this confusion. Meanwhile I added a PR to Grav to allow translating dates automatically, so even in this case the date should be automatically translated based on the locale. |
thanks a lot 👍 |
@flaviocopes |
Issue is fixed by pull request #7 that fixes blueprints.yaml submitted February, a year ago. Please commit! |
Unfortunately a late report. I think since GRAV 1.3 update the translation is broken. Up to then it worked perfectly for the months. I could not find what changed that could be the reason for this. |
As a summary, for now until it gets fixed what is the solution to get the translation working in the archives section? |
This issue is still reproduced on Grav v1.5.8 with Archives v1.5.1 and without BlogInjector installed. I found two solutions:
<span class="archive_date">{{ month|localizeddate('none', 'none', 'ru', 'Europe/Moscow', 'LLLL y')|capitalize }}</span>``` |
the latest version of grav is not working with the |
It's true this plugin is not using the Grav translation strings, as it's just using PHP date format strings, and those translations are going to be powered by the Please make sure you have this installed. |
If you, like me, updated Grav from 1.5 to 1.6 and saw this: And replace |
Any working solution for Grav v1.6.15 and Archives v1.6.0 ? |
Almost 5 years passed since opened issue! |
What works for me, as a workaround is:
<span class="archive_date">{{
'GRAV.MONTHS_OF_THE_YEAR'|ta(month|date('n') -1) }} {{ month|date('Y')
}} </span>
If you see no difference (like me while testing) make sure there is no
archives.html.twig in user/themes/yourtheme/templates/partials/
respectively alter it there.
|
@eisenherzz there is another solution, which forum member suggested yesterday: |
Thank you! That's the only solution that works for me. |
I'm a new user and this bug does not just affect archives but all dates in the front-end. I don't really want to twerk something in code. This often leads to problems later on when the bug if officially fixed. I'm using Grav 1.7.23 and Antimatter (all other themes have the same bug) Language is set to German, everywhere. Page itself is German, same with admin-panel. So could cou please keep me updated when this will be fixed by a Grav developer? I really wonder that this bug is open since 5 years. |
Same issue here in Germany. |
Still an issue after 6 years... |
Another dirty workaround that works for us in Quark theme is to force
|
Hi,
how can I translate the months?
its now in English, we want it in the local language
best regards
The text was updated successfully, but these errors were encountered: