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
Is your feature request related to a problem? Please describe.
I'm currently migrating a site to Eleventy and the way we would like to do i18n doesn't line up with the approaches shown in the documentation. Alternative language files should reside in the same directory with a language suffix (i.e., index.en.html and index.de.html). If a page is not localized it should fallback to the other language and add a note that the content is not localized.
I've been able to build this behavior by scanning input files and adding missing localizations as virtual templates. However, when using the dev server, changes to the original file, will not update the virtual fallback page.
I was then attempting to watch for changes to the original file and trigger an update to the virtual template, by calling addVirtualTemplate again, which results in an error: Virtual template conflict: you can’t add multiple virtual templates that have the same inputPath.
Describe the solution you'd like
I would like to be able to call an updateVirtualTemplate function, which takes the new content of the virtual template and properly build and update the page if it's currently previewed in a browser.
Describe alternatives you've considered
Maybe using virtual templates to achieve this was incorrect in the first place. I also considered relying on pagination for this, but decided against it, because the pages themselves may require pagination.
Additional context
Our approach to localization is probably a niche application, but having the option to asynchronously update virtual templates, can be very beneficial for other use cases as well.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'm currently migrating a site to Eleventy and the way we would like to do i18n doesn't line up with the approaches shown in the documentation. Alternative language files should reside in the same directory with a language suffix (i.e.,
index.en.html
andindex.de.html
). If a page is not localized it should fallback to the other language and add a note that the content is not localized.I've been able to build this behavior by scanning input files and adding missing localizations as virtual templates. However, when using the dev server, changes to the original file, will not update the virtual fallback page.
I was then attempting to watch for changes to the original file and trigger an update to the virtual template, by calling
addVirtualTemplate
again, which results in an error:Virtual template conflict: you can’t add multiple virtual templates that have the same inputPath
.Describe the solution you'd like
I would like to be able to call an
updateVirtualTemplate
function, which takes the new content of the virtual template and properly build and update the page if it's currently previewed in a browser.Describe alternatives you've considered
Maybe using virtual templates to achieve this was incorrect in the first place. I also considered relying on pagination for this, but decided against it, because the pages themselves may require pagination.
Additional context
Our approach to localization is probably a niche application, but having the option to asynchronously update virtual templates, can be very beneficial for other use cases as well.
The text was updated successfully, but these errors were encountered: