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

Odd condition on "You May Also Enjoy" translated string displaying #900

Closed
3 of 5 tasks
Bounga opened this issue Mar 15, 2017 · 2 comments
Closed
3 of 5 tasks

Odd condition on "You May Also Enjoy" translated string displaying #900

Bounga opened this issue Mar 15, 2017 · 2 comments

Comments

@Bounga
Copy link
Contributor

Bounga commented Mar 15, 2017

  • This is a question about using the theme.
  • I believe this to be a bug with the theme --- not Jekyll, GitHub Pages or one of the bundled plugins.
  • This is a feature request.
  • I have updated all gems with bundle update.
  • I have tested locally with bundle exec jekyll build.

Environment informations

  • Minimal Mistakes version: 4.3.0
  • github-pages or jekyll gem version: 3.4.2
  • Operating system: OS X 10.11.6

Expected behavior

The string "You May Also Enjoy" string or it's translation should always be displayed before related posts section. It should be displayed whether you have a translation file available or not and even if you have a translation file without the matching key (related_label).

As of today, if you don't have a translation file (that's how I understood that the translations wasn't bundled with the gem) this string won't display so it will leave the "related posts" section without any description what could be confusing for the reader.

It's because of the conditional available here: https://github.com/mmistakes/minimal-mistakes/blob/master/_layouts/single.html#L66

I think that we don't want this test at all since the line in the condition has a default value.

Steps to reproduce the behavior

Pretty simple:

  • create a new Jekyll site
  • add the minimal-mistakes gem
  • enable related posts
  • add multiple posts
  • run jekyll s
  • go to the latest post
  • check "related posts" section

The related label will be missing.

capture d ecran 2017-03-15 a 10 51 55

Add the translation file with the key and then it displays as intended:

capture d ecran 2017-03-15 a 10 53 36

If it helps I can PR a patch. Oh and BTW you theme is really awesome

@mmistakes
Copy link
Owner

Looks like a legit bug to me. If you want to submit a PR against the develop branch that removes the {% if site.data.ui-text[site.locale].related_label %} around that heading I'll get it merged in.

Bounga added a commit to Bounga/minimal-mistakes that referenced this issue Mar 15, 2017
This removes a buggy conditional that checks if `related_label` is
available in translations before displaying the header for related
posts but this header already handle missing translation by using a
default string.

With this fix the header is displayed even if the translation for this
label isn't available.

Fix mmistakes#900
@Bounga
Copy link
Contributor Author

Bounga commented Mar 15, 2017

Here it is #901

RobinYu added a commit to RobinYu/robinyuuu.github.io that referenced this issue Mar 18, 2017
This removes a buggy conditional that checks if `related_label` is
available in translations before displaying the header for related
posts but this header already handle missing translation by using a
default string.

With this fix the header is displayed even if the translation for this
label isn't available.

Fix mmistakes#900
kkunapuli pushed a commit to kkunapuli/kkunapuli.github.io that referenced this issue May 30, 2019
This removes a buggy conditional that checks if `related_label` is
available in translations before displaying the header for related
posts but this header already handle missing translation by using a
default string.

With this fix the header is displayed even if the translation for this
label isn't available.

Fix mmistakes#900
makaroniame added a commit to makaroniame/makaroniame-old.github.io that referenced this issue May 18, 2022
This removes a buggy conditional that checks if `related_label` is
available in translations before displaying the header for related
posts but this header already handle missing translation by using a
default string.

With this fix the header is displayed even if the translation for this
label isn't available.

Fix mmistakes#900
jchwenger pushed a commit to jchwenger/jchwenger.github.io that referenced this issue May 5, 2023
This removes a buggy conditional that checks if `related_label` is
available in translations before displaying the header for related
posts but this header already handle missing translation by using a
default string.

With this fix the header is displayed even if the translation for this
label isn't available.

Fix mmistakes#900
yesterz pushed a commit to yesterz/yesterz.github.io-test that referenced this issue Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants