How to display an app in the user's selected admin language?

Topic summary

A developer is building a bilingual Shopify app and needs to detect the user’s admin language preference to display the app accordingly.

Initial Approaches Discussed:

  • Using the /admin/shop.json endpoint or GraphQL API to retrieve primary_locale, though this requires an extra HTTP request and the read_locales scope
  • The primary_locale field returns the store’s default language (from Settings > Languages), not the individual admin user’s selected language

Client-Side Solutions:

  • Early suggestions mentioned useShopifyUserLocale from @shopify/app-bridge-react, but this hook doesn’t exist in version 3.7.2
  • One user confirmed useLocale works in version 3.7.4
  • For newer app-bridge versions, use useAppBridge() and access the locale via appBridge.config.locale

Server-Side Solution:

  • Embedded apps automatically receive the admin user’s chosen locale as a locale request parameter in Shopify’s GET requests to the app (found in official documentation)
  • A GraphQL query for shop.accountOwner.locale exists but requires Shopify Plus/Advanced or finance embedded apps

Additional Resource:

  • Olelo Honua was suggested as a free, open-source tool for translating locale files into multiple languages
Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

Hi @JB27

This is Kate from PageFly - Landing page builder, I’d like to suggest this idea:

The Shopify API provides a way to access the current language for a shop by sending a GET request to the “/admin/shop.json” endpoint. You can retrieve the current language in the response, under the “primary_locale” key. You can use this information to determine the language to display your app in.

Here is an example in Ruby using the shopify_api gem:

require 'shopify_api'

# Connect to the shop
ShopifyAPI::Base.site = "https://#{api_key}:#{password}@#{shop_name}.myshopify.com/admin"

# Get the shop details
shop = ShopifyAPI::Shop.current

# Retrieve the current language
language = shop.primary_locale

If the language is available in your app, you can display the content in that language. If the language is not available, you can default to a different language or a fallback language of your choice.