Azure-Samples / communication-services-ui-library-react-native

UI library sample for React Native Bridge
MIT License
10 stars 11 forks source link

React Native IOS app startCallComposite Localization is in Hebrew and cannot change language #47

Open JeronimoGarciaBielsa opened 1 month ago

JeronimoGarciaBielsa commented 1 month ago

Hi! I am working on an app adding videocall, I can successfully start the calls but on IOS I cannot change the language. By default use Hebrew language and I do not know why. I tried to modify the swift files inside pods but I could not find where it is getting the languages.

Versions: 'AzureCommunicationUICalling', '1.9.0' "react": "18.2.0", "react-native": "0.72.2",

If anyone needs help for implementing this library I am free to help. This is a very powerful library and, once learn how to use it, very easy to add into an App

ahammer commented 3 weeks ago

Hi Jeronimo,

It sounds like you're encountering an issue with the localization behavior of the AzureCommunicationUICalling SDK on iOS. By default, the SDK applies the locale based on the device's settings, which might be why it's defaulting to Hebrew in your case.

To modify the language, you don't need to edit the Swift files directly inside the pods. Instead, you can use the SDK's localization APIs to set the desired language programmatically. You can refer to the official documentation on localization here for more detailed guidance.

If you still need help or if there's a specific part of the implementation that’s unclear, feel free to ask.

JeronimoGarciaBielsa commented 3 weeks ago

Hi! I will try this. I am working on another task, but already set another in the board to investigate. What I found strange is that on Android every thing works perfect, if I change the language inside the startCallComposite, it works find. I almost can see all the languages using the method getSupportedLocales() on Android, but on IOS just give an array with "en".

This is my startCallComposite: try { await RNAzureCommunicationUICalling.startCallComposite( // local options { "displayName": "token1", "title": "token1", "subtitle": "token1", "disableLeaveCallConfirmation": false }, // localAvatarImageResource null, // remote options { "token": token1, "meeting": "${groupId-uuid}" }, // remoteAvatarImageResource null, // localization options { "locale": "it", "layout": false }, // orientationOptions { "setupOrientation": "PORTRAIT", "callOrientation": "PORTRAIT" } ) } catch (error) { console.error(error.message) }

If I set the locale to "it", on Android change but on IOS still in Hebrew "he"

try { const locales = await RNAzureCommunicationUICalling.getSupportedLocales() console.log(locales) } catch (error) { console.error(error) }

And this method on Android give me an array with all the languages, but on IOS give me an array with just "en", but do not work either in English, still Hebrew.

I will investigate, thanks! If I find a solution, I will give more information (Sorry about my english, I am from Argentina)

ahammer commented 2 weeks ago

Hi Jeronimo,

We've done some investigations on our side and have not as of yet been able to reproduce this issue.

Can you give more details about the devices used for testing? Is it only one iPhone? Simulator?

Are the bindings/samples being used without modification?

Can you tell me what is available in iOS SupportedLocale.values field?

Are you using this file for your bindings in a unmodified way? https://github.com/Azure-Samples/communication-services-ui-library-react-native/blob/main/demo/ios/RNAzureCommunicationUICalling.swift

Please let us know if you have any more information.

JeronimoGarciaBielsa commented 2 days ago

Hi! Sorry about the late answer. I still working on another task but next one is VideoCall

This error is on phisic iPhone and simulator iphone too ( I tried 15, 15pro, 14 ). Reading the doc I found this method who give us all the locales

try { const locales = await RNAzureCommunicationUICalling.getSupportedLocales() console.log(locales) } catch (error) { console.error(error) } Output iOS => ["en"]

Output Android => ["ar", "ar", "de", "de", "en", "en", "en", "es", "es", "fi", "fi", "fr", "fr", "it", "it", "iw", "ja", "ja", "ko", "ko", "nb", "nl", "nl", "pl", "pl", "pt", "pt", "ru", "ru", "sv", "tr", "tr", "zh", "zh", "zh"]

The wear thing is on iOS said "en" as default but i see in hebrew. I am working for Italy so for now I modify the hebrew file with Italian. I found the locales and I just copy-paste the Italian language into the Hebrew. Just for keep going on in project.

I saw some updates and new commits that I must try. Maybe someone find a solution. Let me know if I can help with something else. Thanks!