I have an item with version in
en only. I have set the
en-GB language to fallback to
en, and it works great. With Sitecore's language fallback functionality, I do not have to have a version in the
en-GB language, unless I decide to create one and localize some content.
The same is true for Datasource content items. I have them set to fallback and I only need to create localized versions if I am translating their content.
That said, this makes it very difficult for me to determine if a given page item/request/URL is falling back or not. Simply checking for the presence of the context item's language versions will not always work, as most, if not all, of the page's content is data-sourced.
Knowing this information would be useful for several scenarios:
- Determining whether or not to output hreflang's. For example, I would not want to generate hreflangs for a page that is falling back 100% and contains zero translations.
- Determining how to include the page in a sitemap.
- Determining whether or not to offer visitors a given language as a selection in a language switcher.
- Possibly something in reverse, such as alerting content authors that Datasource item is missing a translated version.
This begs the question: Is there a generally accepted way of determining whether a given page item/request/url is being translated?