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
| Argument | Type | Required | Description |
|---|---|---|---|
| path | String | Yes | The current URL path to translate (e.g., “/tuotteet/example-product”) |
| locale | String | Yes | The 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")
}Related Types
String