R.swift icon indicating copy to clipboard operation
R.swift copied to clipboard

Global language change in R.Swift

Open mobile-sergey opened this issue 3 years ago • 2 comments

Yesterday I change all my strings(~1k) to R.string in my app. In my app I can change language of app. But after change strings to R.string - change language in app not working. I need global change of locale in R.swift. How I can do it?

mobile-sergey avatar Feb 22 '22 11:02 mobile-sergey

I found #553 - but there is about preferredLanguages, not about dynamically global change locale.

mobile-sergey avatar Feb 22 '22 11:02 mobile-sergey

I run sed to replace NSLocalizedString to MyLocalizedString. Something like this

"$PODS_ROOT/R.swift/rswift" generate --accessLevel internal "$NEW_FILE"
/usr/bin/sed -i 's/NSLocalizedString/MyLocalizedString/g' "${NEW_FILE}"

I think option to select localization function will be good idea

aoleynik812 avatar Mar 29 '22 16:03 aoleynik812

+1

Lucky1st avatar Nov 08 '22 15:11 Lucky1st