You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be beneficial to be able to include the current locale in the array of links returned by the locale_links filter. This would make sense for a variety of use cases:
for <link rel=alternate>, the recommendation is to include <link> tags for the current page, as well as for alternatives in other languages
it would provide direct access to the localized name of the current language, with the current locale at a stable position in the array, for various types of language switchers.
For #1, the workaround is provided as an example in the docs page — just print out the current page separately.
For #2 you can add iso-639-1 as a direct dependency and use iso639.getNativeName() on the current page's lang to get the localized name of the current language. Then override locale_links:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I think it would be beneficial to be able to include the current locale in the array of links returned by the
locale_links
filter. This would make sense for a variety of use cases:<link rel=alternate>
, the recommendation is to include<link>
tags for the current page, as well as for alternatives in other languagesFor #1, the workaround is provided as an example in the docs page — just print out the current page separately.
For #2 you can add
iso-639-1
as a direct dependency and useiso639.getNativeName()
on the current page'slang
to get the localized name of the current language. Then overridelocale_links
:Would adding an option to the
locale_links
filter, e.g.locale_links(true)
make sense to simplify this use-case?Beta Was this translation helpful? Give feedback.
All reactions