george-gca / multi-language-al-folio

A beautiful, simple, clean, and responsive Jekyll theme for academics, with support for multiple languages
https://george-gca.github.io/multi-language-al-folio/
MIT License
81 stars 26 forks source link

Fixed News Title Localisation #5

Closed DavidKrassnig closed 1 year ago

DavidKrassnig commented 1 year ago

Added modified variant of the page layout named news and converted all news to the news layout. Functionally equivalent to currently displayed news with the exception of working title localization.

DavidKrassnig commented 1 year ago

I originally tried to fix this by fixing the post layout, but for some reason that kept crashing (using the very same code with regards to the title as in the new news layout). Edit: Especially confusing, since the post layout is already working for the blog but not for the news…

george-gca commented 1 year ago

I believe this is the cleanest possible solution. I also previously struggled with this, and added a TODO somewhere for me to remember to take a look at it.

What happens with the post layout is that the title and the contents are not translated via t tag. Instead, all of its contents are fetched from the localized _posts directories. When you try to translate the title in the post layout, it did ok for the news, but it also tries to translate the title of the posts that are already translated, so it ends looking for a key in the translation files that is the actual title. Something like looking for the key a post with formatting and links in the translation files.

Thanks for the contribution btw.

DavidKrassnig commented 9 months ago

By the way, not certain what exactly changed because I've been away for quite some while, but the error is back. You seem to have gone from .html files to .liquid files but there no longer appears to be a news.html (or rather news.liquid under the current system). Should I open a new issue on this? Edit: Can be seen on this page of yours

george-gca commented 9 months ago

Hummmm I probably missed this while merging new changes from al-folio into this repository. Will try to fix this.

george-gca commented 9 months ago

Fixed @DavidKrassnig

DavidKrassnig commented 9 months ago

@george-gca Great, thanks!