Skip to Content

pathByLocale

Translate a URL path to another locale. Returns the equivalent path in the target locale, or null if not found. Useful for language switching to redirect users to the same page in their new language.

Authentication

Public Access: Accessible with the public API key

Query Structure

{ pathByLocale(path: String!, locale: String!) }

Arguments

ArgumentTypeRequiredDescription
pathStringYesThe current URL path to translate (e.g., “/tuotteet/example-product”)
localeStringYesThe target locale/language code (e.g., “en”, “fi”)

Return Type

Returns a String representing the translated URL path in the target locale, or null if the translation is not found.

Example

query { pathByLocale(path: "/tuotteet/example-product", locale: "en") }
  • String