Skip to content

Update locale_get_display_x() return types #4085

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

Open
wants to merge 1 commit into
base: 2.1.x
Choose a base branch
from

Conversation

cfahner
Copy link

@cfahner cfahner commented Jul 10, 2025

For issue #12942 I updated the signatures of the following functions:

  • locale_get_display_language() and Locale::getDisplayLanguage()
  • locale_get_display_name() and Locale::getDisplayName()
  • locale_get_display_region() and Locale::getDisplayRegion()
  • locale_get_display_script() and Locale::getDisplayScript()
  • locale_get_display_variant() and Locale::getDisplayVariant()

The _language() and _name() variants never seem to return an empty string (at least I could not find any case for which they did), so I left them at non-empty-string.

The _region() function returns an empty string when you give it a language code without a region.

When you pass in a very long string these methods all return false (C source code).

I added my quick testing script as an attachment. This is my first PR here so let me know if there are any other requirement.

test.zip

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

Successfully merging this pull request may close these issues.

1 participant