Skip to content

Localization not working on Android #573

Open
@sheriffmarley

Description

@sheriffmarley

Describe the bug
We implemented adyen in our app, but it seems that the locale on android isn't working at all. We tried different Countrycodes and locales, either with both of the settings changed, sometimes only one, but it still defaults to english. On iOS it's working as expected

To Reproduce

  const getEnvironment = () => {
    if (testmode) return 'test';
    return 'live-eu';
  };
  const config: Configuration = {
    clientKey: sessionclientid,
    returnUrl: 'myapp://payment',
    countryCode: 'DE',
    locale: 'de-DE',
    amount: {
      value: Math.round(amount * 100),
      currency: 'EUR',
    },
    environment: getEnvironment(),
    applepay: {
      merchantID: applemerchantid,
    },
    card: {
      showStorePaymentField: false,
    },
    analytics: {
      verboseLogs: true,
    },
  };

  const client = new AdyenClient(apikey, apiendpoint);

  const createPayment = useCallback(async (data: any) => {
    const key = `${user.id}_${moment().unix()}`;
    const body = {
      reference: key,
      amount: config.amount,
      deliveryAddress: deliveryAddress,
      billingAddress: billingAddress,
      paymentMethod: data.paymentMethod,
      merchantAccount: merchantid,
      returnUrl: config.returnUrl,
      shopperInteraction: 'Ecommerce',
    };
    return await client.createPayment(body);
  }, []);

Expected behavior
The correct locale should be loaded. In our case german since it's supported according to https://github.com/Adyen/adyen-react-native/blob/develop/docs/Localization.md

Smartphone (please complete the following information):

  • Device: Samsung S24+
  • OS: Android 14
    Also testet on different emulators

Additional context
Part of our package.json

    "@adyen/react-native": "^2.4.1",
    "react": "18.2.0",
    "react-native": "0.73.1",

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug reportwhen a bug report is created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions