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:

  1. 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.
  2. Determining how to include the page in a sitemap.
  3. Determining whether or not to offer visitors a given language as a selection in a language switcher.
  4. 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?

  • Does the IsFallback property not work as suggested here? sitecore.stackexchange.com/a/7273/890
    – maz
    Sep 19 '18 at 19:40
  • @maz Thanks for the link. I've updated my question to be a bit more specific. IsFallback seems to work at the item level, whereas, I'm looking for a way to determine if a request (context item plus all datasource items) contains one or more translated versions. Sep 19 '18 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.