Skip to content

Language fallbacks for extended language subtags #271

@jurgenbelien

Description

@jurgenbelien

A language tag consists of a primary language subtag and optional extended language subtags, ie. nl-BE, or en-GB. (See https://en.wikipedia.org/wiki/IETF_language_tag)

A site owner might want to have certain content localized for a region, based on the extended language subtag. A site owner might also not want to bother with localizing all content for all extended language subtags.

Currently they would encounter two problems:

  1. We are not using fallback locales for fetching content where the specified locale is unspecified.
  2. We cannot fetch a fallback locale for an indvidual record when using filter: { eq: $slug } in our GraphQL queries for individual pages records, because filter will not find the slug for the specified locale.

Solutions might be:

  • Add the fallback locales to graphql queries.
  • Add a retry to datocmsRequest with the fallback locale to fetch the primary language if available.
  • Fetch content from Dato based on ids instead of slugs, and use content collections to map the slugs to ids

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions