Skip to content
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

There should be field for MONTHS_OF_THE_YEAR where to add translated month text. #2

Open
markosu opened this issue Nov 2, 2015 · 2 comments

Comments

@markosu
Copy link

markosu commented Nov 2, 2015

There should be field for MONTHS_OF_THE_YEAR where to add translated month text and archives plugin use it.
Like in twentyfifteen theme there is in languages.yaml file MONTHS_OF_THE_YEAR: [Tammikuu, Helmikuu, Maaliskuu, Huhtikuu, Toukokuu, Kesäkuu, Heinäkuu, Elokuu, Syyskuu, Lokakuu, Marraskuu, Joulukuu]

@flaviocopes
Copy link
Contributor

The next release of Grav will provide MONTHS_OF_THE_YEAR translations, so then it could use those.

@ghost
Copy link

ghost commented Jan 4, 2016

If you need that feature right now here is a fix until the next version of Grav is released:

Create a languages.yaml file in your theme root folder. Add the the following:

fi:
  MONTHS_OF_THE_YEAR: [Tammikuu, Helmikuu, Maaliskuu, Huhtikuu, Toukokuu, Kesäkuu, Heinäkuu, Elokuu, Syyskuu, Lokakuu, Marraskuu, Joulukuu]

Then in your archives.html.twig file on line 9 change:

{{ month }}

to

{{ 'MONTHS_OF_THE_YEAR'|ta(month|date('n') -1) }} {{ month|date('Y') }}

Here is a PR doing this: https://github.com/mikewink/grav-plugin-archives/commit/0042e989ba9ce931bc39fa4dcf658f2d6ff2c310

Hope that helps! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants