Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization not working on Android #573

Open
sheriffmarley opened this issue Jan 23, 2025 · 0 comments
Open

Localization not working on Android #573

sheriffmarley opened this issue Jan 23, 2025 · 0 comments
Labels
bug report when a bug report is created

Comments

@sheriffmarley
Copy link

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",
@sheriffmarley sheriffmarley added the bug report when a bug report is created label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report when a bug report is created
Projects
None yet
Development

No branches or pull requests

1 participant