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

Languages with dialects aren't downloading #227

Closed
serejaonly opened this issue Aug 28, 2023 · 1 comment · Fixed by #232
Closed

Languages with dialects aren't downloading #227

serejaonly opened this issue Aug 28, 2023 · 1 comment · Fixed by #232
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@serejaonly
Copy link

serejaonly commented Aug 28, 2023

Describe the bug
Languages with dialects (pt-BR) aren't downloading (it might be only for Crowdin Enterprise)

To Reproduce
Steps to reproduce the behavior:

  1. Set pt-BR language in the app
  2. Start the app
  3. See that strings aren't downloaded

Expected behavior
Expected to download it as different languages

Screenshots
image

Smartphone (please complete the following information):

  • Device: iPhone 12 Pro
  • OS: iOS 16.4

Additional context
Languages with dialects are denoted with a hyphen (pt-BR), and locales are denoted with an underscore (pt_BR).
There seems to be a confusion of these two concepts in the SDK at the stage of adding downloadable languages to CrowdinRemoteLocalisationStorage.
The final stage where the error occurs is the ManifestManager.iOSLanguageCode(for:) method, because it takes the locale code instead of the language code.

func iOSLanguageCode(for crowdinLocalization: String) -> String? {
    allLanguages.first(where: { $0.id == crowdinLocalization })?.osxLocale
}

I think it makes sense to replace the osxLocale with iOSLanguageCode to fix that.

@serejaonly serejaonly added the bug Something isn't working label Aug 28, 2023
@andrii-bodnar andrii-bodnar added the help wanted Extra attention is needed label Sep 14, 2023
@andrii-bodnar
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants