microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.29k stars 1.14k forks source link

Alert: 'OK' text needs to be localized #3742

Open kmelmon opened 4 years ago

kmelmon commented 4 years ago

In the windows implementation of Alert, we currently have 'OK' hard-coded in English in the javascript. This should be localized. iOS does this on the native side, we should probably copy this pattern.

See vnext/src/libraries/alert/alert.windows.js

BartoszKlonowski commented 3 years ago

@chrisglein @kmelmon I have some experience with localization, so please assign me to this issue - I'll see what I can do.

BartoszKlonowski commented 3 years ago

@kmelmon I've been searching for a localization mechanism in both react-native-windows and react-native and couldn't find any. Is the localization even supported? If it is then could you point me the native implementation of Alert for iOS which the comment mentions?

BartoszKlonowski commented 3 years ago

@kmelmon Kind reminder: Is there a localization even supported in the React Native Windows, or React Native?

BartoszKlonowski commented 3 years ago

@chrisglein Can you (or a team in general) take a look at this issue? Does the RN or RNW support the localization?

NickGerleman commented 3 years ago

https://docs.microsoft.com/en-us/windows/uwp/app-resources/localize-strings-ui-manifest would be a good reference for string resources on the system level.

I don't think there's an exposed RN specific localization framework. For most components I think strings are handled app-level, or by the built-in component.

chrisglein commented 3 years ago

This should call through to native, not use anything RN specific. We don't today have localized resources for RNW. The first time we need to do that it'll have some definite startup cost. However if it exists in XAML or somewhere in the system then we should be able to pull in an existing localization (which for 'OK' should already exist).