Make locales
case insensitive. Allow automatic resolving to the URL with the casing provided in the locales
property.
#775
Labels
Is your feature request related to a problem? Please describe.
When locales are specified according to the IETF BCP 47 specification, a mismatch in character casing in a URL request can lead to issues. For instance, if the locales are defined as
[bn-BD, en-UK, ...]
but a request is made using a URL with an incorrect casing, such asbn-bd
, this discrepancy results in a 404 error.Describe the solution you'd like
To address the issue described, the solution should involve implementing a case-insensitive matching mechanism for locale identifiers in the package. This means that when a URL request is made, the package should recognize and correctly handle locales regardless of their character casing. For example, if the locales are defined as
[bn-BD, en-UK, ...]
, the package should treat a request withbn-bd
as valid and correctly map it tobn-BD
, also rewrite the URL to reflect the correct case, changingbn-bd
tobn-BD
. This approach will prevent 404 errors due to case mismatches and ensure that the package adheres to the flexibility often expected in handling language tags as per the IETF BCP 47 specification. In summary, the desired outcome is a more forgiving and robust handling of locale identifiers, accommodating variations in character casing.Describe alternatives you've considered
This is my current workaround:
The text was updated successfully, but these errors were encountered: