-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Add lang.HasTranslation #10539
base: master
Are you sure you want to change the base?
Add lang.HasTranslation #10539
Conversation
1b80e61
to
13a5e59
Compare
13a5e59
to
c2b68be
Compare
A quick note for the documentation: While And I think this PR should do the above. |
I am looking at this for the first time, so please be gentle... It seems like the intent of this is to avoid falling back to the default language (currently always English due to #9216) when translating a string. So you would do something like:
Would it be easier to do this?
Or disable falling back to the default language via site configuration? Then you could just do:
One of the drawbacks with the |
I think you get a "best effort" language? My memory is ... hazy. Oh, well ... I didn't read the original issue very well, I just had some urge to ... implement something.
I like that use of But the thing is, if Hugo did a great job of finding a default, then this shouldn't be needed. I would think that in a 100 language Hugo site, I would prefer not having to manage this. And, as a Norwegian, I would be happy to get the Danish word for |
Hi I agree |
@regisphilibert I am not suggesting that we don't do it. I am, however, suggesting a couple of alternative implementations that, to me, seem easier to use. |
Oh I see @jmooring sorry for misinterpreting that. So your suggestion is adding a no fallback alternative so we can test if empty? It seems a good approach indeed. |
Fixes #10538