Cannot translate payment gateways

The query below is supposed to return the corresponding translation, but instead it returns nothing under translation, even though the resource gets translated in the admin panel.

For example “Bank Deposit” will be translated to “Depósito Bancário” in Portuguese, but nothing shows up here:

query TranslatePayment {
  translatableResource(resourceId: "gid://shopify/PaymentGateway/80760406169") {
    resourceId
    translatableContent {
      value
      locale
      key
    }
    translations(locale: "pt-BR") {
      key
      value
    }
  }
}

Result

{
  "data": {
    "translatableResources": {
      "nodes": [
        {
          "resourceId": "gid://shopify/PaymentGateway/80760406169",
          "translations": [],
          "translatableContent": [
            {
              "key": "name",
              "value": "Cash on Delivery (COD)",
              "locale": "pt-BR"
            },
            {
              "key": "message",
              "value": "",
              "locale": "pt-BR"
            },
            {
              "key": "before_payment_instructions",
              "value": "",
              "locale": "pt-BR"
            }
          ]
        },
        {
          "resourceId": "gid://shopify/PaymentGateway/80760438937",
          "translations": [],
          "translatableContent": [
            {
              "key": "name",
              "value": "Bank Deposit",
              "locale": "pt-BR"
            },
            {
              "key": "message",
              "value": "",
              "locale": "pt-BR"
            },
            {
              "key": "before_payment_instructions",
              "value": "",
              "locale": "pt-BR"
            }
          ]
        },
        {
          "resourceId": "gid://shopify/PaymentGateway/80760471705",
          "translations": [],
          "translatableContent": [
            {
              "key": "name",
              "value": "Money Order",
              "locale": "pt-BR"
            },
            {
              "key": "message",
              "value": "",
              "locale": "pt-BR"
            },
            {
              "key": "before_payment_instructions",
              "value": "",
              "locale": "pt-BR"
            }
          ]
        },
        {
          "resourceId": "gid://shopify/PaymentGateway/86935371929",
          "translations": [],
          "translatableContent": [
            {
              "key": "name",
              "value": "Pix",
              "locale": "pt-BR"
            },
            {
              "key": "message",
              "value": "",
              "locale": "pt-BR"
            },
            {
              "key": "before_payment_instructions",
              "value": "",
              "locale": "pt-BR"
            }
          ]
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 29,
      "actualQueryCost": 8,
      "throttleStatus": {
        "maximumAvailable": 2000,
        "currentlyAvailable": 1992,
        "restoreRate": 100
      }
    }
  }
}

How do we get what users see when referring to “Bank Deposit” for example?

Hey @David_Arbias

The empty translations array indicates that no Portuguese translations have been created for these payment gateways yet. While the translatableContent shows "locale": "pt-BR", those are the original English values being returned with your store’s default locale label.

What you’re seeing in the admin panel as “Depósito Bancário” is likely the built-in localization for standard payment method names, but these aren’t stored as translatable resources accessible through the GraphQL API.

To get the Portuguese translations, you’ll need to explicitly create them using the translationsRegister mutation (or a translation app). Once those translations exist, they’ll appear in the translations array.

Kinda sad, because our app allows customer to choose which payment methods they want to hide using a “Shopify Function” based on conditions and it’s not clear which payments get translated and what translations they get.

So far it seems these payment names get translated:

  • Money order
  • Bank Deposit
  • COD

Hey David,

To make sure I understand this properly, in your app UI, you are pulling in the payment options but not all of them are localized for the merchants using your app (understandably confusing if so).

Are the non translated fields from custom options configured or from specific gateways?

Hey David, are you still needing further help here?

Oh yes I forgot to reply.

The non translated fields all come from this part of the dashboard under “Manual payment methods”, it seems Shopify automatically translates Bank Deposit, Money order and cash on delivery, using the store checkout language.

We’ve managed to find the translation for the 2 most popular languages, but if the store is from a country that we don’t know the translation, we won’t be able to match it.

For example, if the user chooses “Bank deposit” in our app, but his checkout shows the french translation, we won’t be able to match it using Shopify functions. We’re also not able to know which payment method names are available to the user.

Thanks for sharing that David. This gives more clarity in to what’s happening.

The issue here looks to be that the standard (default methods) are translated because they are available to any store to select. However, the custom values added, would need to be translated first.

Would it work in your payment customization function, to target operations using the ID field rather than trying to match translated names?

Additionally, if you need to provide custom text when renaming manual methods, you can supply your own translations following our localization guidance for functions.