-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Translations with language+region fails #317
Comments
Interesting... Following returns print("Locale.current.languageCode = \(String(describing: Locale.current.languageCode))")
print("Locale.current.collatorIdentifier = \(String(describing: Locale.current.collatorIdentifier))")
print("NSLocale.current.languageCode = \(String(describing: NSLocale.current.languageCode))")
print("NSLocale.current.collatorIdentifier = \(String(describing: NSLocale.current.collatorIdentifier))") |
BTW I believe those folders with translations should be named after collatorIdentifier, like fr-FR.lproj. |
I think the best solution is, as you said, to use the collatorIdentifier. |
BTW Issue was reported to Swift bugtracking about those |
Hi team,
Thank you for your quick fix #314 about missing french translation ;-)
I have another issue with this. The french strings bundle is named
fr.lproj
. SwiftDate targets the folder using thecollatorIdentifier
property ofNSLocale
. On my device, the result isfr-FR
, so the french translation is not loaded but the english one (DateInRegionFormatter
line 124).Even stranger, on another french device (same language and region settings, both on iOS version 10.0.2), the result is
fr
and everything works as expected.Do you have any solution for that?
Maybe by using
NSLocale.languageCode
which returnsfr
in all cases, but I don't know if it's ok for other languages like chinese ones.Also, the issue may affects other languages in the bundle.
Thanks!
The text was updated successfully, but these errors were encountered: