Skip to main content

How to Set the Map Language and Locale Using the Page URL

RP Promap lets you pass a language and locale through the store locator page URL by adding the lang parameter.

How to Set the Map Language and Locale Using the Page URL

RP Promap lets you pass a language and locale through the store locator page URL by adding the lang parameter. This is useful when you want the map interface and geographic labels to follow a particular country or language convention.

For example, the following URL requests Canadian English:

https://your-store.com/pages/store-locator?lang=en-CA

The first part of the value identifies the language, and the second part identifies the country or locale:

  • en-CA — English, Canada

  • fr-CA — French, Canada

  • en-US — English, United States

  • en-GB — English, United Kingdom

  • fr-FR — French, France

Why the locale matters

A map's labels can vary based on the selected language and country locale. Country-specific names, regional naming conventions, map controls, and certain geographic labels may therefore appear differently when the locale changes.

For example, a map opened with ?lang=en-CA can use Canadian English labeling around Lake Ontario, while a different locale can produce different country-specific labels or naming conventions, such as “Lake America,” when that label is available in Google's map data.

Label comparison example

The following RP Promap examples show the same general Toronto and Lake Ontario area using different locale settings.

Canadian English locale: “Lake Ontario”

RP Promap using the Canadian English locale and displaying the Lake Ontario label

Example using Canadian English, such as ?lang=en-CA. The map displays the label “Lake Ontario.”

Alternate locale: “Lake America”

RP Promap using an alternate locale and displaying the Lake America label

Example using a different locale. In this map presentation, Google displays the label “Lake America.”

Important: RP Promap passes the requested locale to Google Maps, but Google controls the final basemap content. The exact label shown can depend on Google's available map data, the map's zoom level, and the selected locale. A particular label is therefore not guaranteed to appear at every zoom level.

Set the language for one map link

Add ?lang= followed by the desired language-locale code to the end of your store locator URL:

https://your-store.com/pages/store-locator?lang=en-CA

If the URL already contains another parameter, add the language using &lang= instead:

https://your-store.com/pages/store-locator?tags=retail&lang=en-CA

You can use different links for different markets or languages:

Canadian English: https://your-store.com/pages/store-locator?lang=en-CA  Canadian French: https://your-store.com/pages/store-locator?lang=fr-CA

Make a locale the default for your store locator

The simplest and most reliable option is to update every store navigation link, button, and promotional link so it points directly to the URL containing the locale:

/pages/store-locator?lang=en-CA

This makes Canadian English the default whenever shoppers use those links, without changing the underlying page or creating a redirect.

Set a site-wide default in Shopify

Do not add ?lang=en-CA to the page's URL handle or use Shopify's native URL Redirect tool for this purpose. Shopify can normalize a URL containing a query string and turn:

/pages/store-locator?lang=en-CA

into:

/pages/store-locator-lang-en-ca

The normalized address no longer passes the lang parameter to RP Promap.

Recommended: use the complete URL in your Shopify menu

  1. From Shopify admin, go to Content > Menus.

  2. Open the menu containing the Store Locator item.

  3. Edit the Store Locator menu item.

  4. Paste the complete web address into the link field, for example:
    ​https://justcozy.ca/pages/store-locator?lang=en-CA

  5. Do not select the Store Locator page from Shopify's page picker. Use the complete pasted web address.

  6. Save the menu and test the link in a private or incognito window.

If clicking the menu immediately produces the hyphenated address, delete the existing menu item and recreate it using the complete pasted URL.

Incorrect setup example

The screenshot below shows ?lang=en-CA entered in the page's URL handle with Create a URL redirect enabled. Do not use this configuration because Shopify may rewrite the query string as part of the page handle.

Shopify store locator page showing the URL handle with ?lang=en-CA and the Create a URL redirect option selected

Incorrect example: adding ?lang=en-CA to the page URL handle and enabling Shopify's automatic redirect can produce a hyphenated URL instead of a working query string.

Optional: automatically add the default locale with theme JavaScript

If visitors can reach the store locator from links you cannot update, add the following script to theme.liquid immediately before </body>:

<script>   document.addEventListener('DOMContentLoaded', function () {     const locatorPath = '/pages/store-locator';      if (       window.location.pathname === locatorPath &&       !new URLSearchParams(window.location.search).has('lang')     ) {       window.location.replace(locatorPath + '?lang=en-CA');     }   }); </script>

Change locatorPath if your Store Locator page uses a different path. The script adds Canadian English only when the URL does not already contain a lang value, so links such as ?lang=fr-CA remain unchanged.

Shopify documents that redirects involving query strings might not work as expected. For that reason, use a direct menu link whenever possible and use the conditional theme script only when automatic forwarding is required. See Shopify's URL redirect documentation.

How to test the result

  1. Open the store locator in a private or incognito browser window.

  2. Confirm that the URL contains the expected value, such as ?lang=en-CA.

  3. Navigate to the applicable country or border region.

  4. Compare the map with another locale, such as ?lang=en-US or ?lang=fr-CA.

  5. Try multiple zoom levels because Google may display different geographic labels as the zoom changes.

Troubleshooting

The language does not change

  • Confirm that the parameter is spelled lang.

  • Use a hyphen in the locale value, such as en-CA, rather than an underscore.

  • Use ? before the first URL parameter and & before additional parameters.

  • Clear the page cache and test in an incognito window.

  • Confirm that another theme script or app is not loading Google Maps before RP Promap initializes.

A specific map label is still different

The locale requests the appropriate language and regional map presentation, but individual labels remain controlled by Google. Try changing the zoom level and confirm that the correct locale is present in the page URL.

Need help?

If the map does not use the requested language or locale, send Rose Perl Technology Support the store locator URL, the locale code being tested, and a screenshot of the displayed map.

Did this answer your question?