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
When adding a custom preview template with i18n, the template does not seem to receive a prop/data entry to indicate the current locale. This was requested in #5337, but the fix for that (#5875) only made sure the preview refreshes to receive the current locale content. For many cases, this is probably enough, but sometimes having the locale itself is helpful (i.e. the string 'en', 'zh', etc.). For example, the preview template might need to apply RTL/LTR classes or localize dates depending on the locale.
Describe the solution you'd like
A custom preview component should receive locale either as a prop or as metadata somewhere in the entry data.
Describe alternatives you've considered
Current alternatives would include trying to guess the locale from the content or duplicating data by adding a locale field to entries.
The text was updated successfully, but these errors were encountered:
delucis
added
the
type: feature
code contributing to the implementation of a feature and/or user facing functionality
label
Oct 20, 2021
When adding a custom preview template with i18n, the template does not seem to receive a prop/data entry to indicate the current locale. This was requested in #5337, but the fix for that (#5875) only made sure the preview refreshes to receive the current locale content. For many cases, this is probably enough, but sometimes having the locale itself is helpful (i.e. the string
'en'
,'zh'
, etc.). For example, the preview template might need to apply RTL/LTR classes or localize dates depending on the locale.Describe the solution you'd like
A custom preview component should receive
locale
either as a prop or as metadata somewhere in theentry
data.Describe alternatives you've considered
Current alternatives would include trying to guess the locale from the content or duplicating data by adding a
locale
field to entries.The text was updated successfully, but these errors were encountered: