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

Unable to use registerLocaleForEsBuild with locales such as "de-DE" #21483

Open
1 task done
SecTex opened this issue Nov 28, 2024 · 0 comments · May be fixed by #21484
Open
1 task done

Unable to use registerLocaleForEsBuild with locales such as "de-DE" #21483

SecTex opened this issue Nov 28, 2024 · 0 comments · May be fixed by #21484
Labels

Comments

@SecTex
Copy link
Contributor

SecTex commented Nov 28, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Description

When using the registerLocaleForEsBuild function, locales such as "de-DE" are not supported even when provided in the cultureNameLocaleFileMap. The function does not respect the cultureNameLocaleFileMap when checking for supported cultures.

Also, one may provide a cultureNameLocaleFileMap with unsupported locales (e.g. {de:"deffinitly-unsupported"}); however, the locale (=de) parameter is checked against the localeSupportList, but the l (=deffinitly-unsupported) variable (which may have been mapped to a unsupported locale) is used later on.

Reproduction Steps

import { registerLocaleForEsBuild } from '@abp/ng.core/locale';

registerLocaleForEsBuild({
  cultureNameLocaleFileMap: {
    'de-DE': 'de',
  },
})('de-DE').then(x => console.log(x));
// ERROR TypeError: Cannot read properties of undefined (reading 'then')

Expected behavior

The function should support locales specified in the cultureNameLocaleFileMap, allowing for locales like "de-DE" to be registered properly. The cultureNameLocaleFileMap should be respected when determining supported locales.

Actual behavior

Locales like "de-DE" are not supported, and the cultureNameLocaleFileMap is ignored when determining supported locales. The locale parameter is checked against a predefined localeSupportList, and if it doesn't match, the function returns early without considering the mappings in cultureNameLocaleFileMap.

Regression?

No response

Known Workarounds

No response

Version

9.0.0

User Interface

Angular

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant