Log in
Model

LocaleResolver

Magento\Paypal\Model\Express\LocaleResolver

What it does

This class resolves and validates locale codes for PayPal Express payment method, ensuring the store's locale is supported by PayPal.

It maps Magento locale codes to PayPal-compatible formats and falls back to 'en_US' if the store's locale isn't supported by PayPal.

Developers would use this when integrating PayPal Express to ensure proper language/region display in PayPal's checkout interface.

Public Methods

  • getDefaultLocalePath()
  • setDefaultLocale()
  • getDefaultLocale()
  • setLocale()
  • getLocale()
  • emulate()
  • revert()