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

Capitalize first letter of a text in track selector menu items #9452

Closed
moneytoo opened this issue Sep 19, 2021 · 5 comments
Closed

Capitalize first letter of a text in track selector menu items #9452

moneytoo opened this issue Sep 19, 2021 · 5 comments
Assignees
Labels

Comments

@moneytoo
Copy link
Contributor

This is how the audio selector of StyledPlayerView looks like in two languages (English and Czech):

languages

In Czech (and other languages probably as well), the language name (angličtina) is in all lower case characters. But because of the use in this menu, I think the first letter should be upper cased in DefaultTrackNameProvider.buildLanguageOrLabelString().

  • ExoPlayer version number: 2.15.0
  • Android version: Android 10
  • Android device: OnePlus 7
@krocard
Copy link
Contributor

krocard commented Sep 29, 2021

This is the string returned by Local.getDisplayName, I'm not sure we want to do any transformation on it. The characters returned might not even have a upper case concept. @ojw28 you are marked as UI owner in our triage guide, so assigning to you as minor.

@ojw28
Copy link
Contributor

ojw28 commented Sep 29, 2021

I think Locale.getDisplayName returns a string that would be suitable for use mid-sentence. In English, language names are generally capitalized whether they occur at the start or in the middle of a sentence, so it makes no difference. I'm guessing this is not the case in Czech, which is why this ends up being problematic. We probably want to use UCharacter.toTitleCase to convert the string into a suitable title case before returning it.

@moneytoo
Copy link
Contributor Author

Locale names are "title cased" at least in the platform Settings app. This is what it uses internally: https://android.googlesource.com/platform/frameworks/base.git/+/refs/tags/android-11.0.0_r45/core/java/com/android/internal/app/LocaleHelper.java#68

@ojw28
Copy link
Contributor

ojw28 commented Sep 29, 2021

Thanks for the pointer!

marcbaechinger pushed a commit that referenced this issue Oct 4, 2021
Issue: #9452
PiperOrigin-RevId: 400680794
kim-vde pushed a commit that referenced this issue Oct 4, 2021
*** Original commit ***

Fix capitalization of language in track selector

Issue: #9452

***

PiperOrigin-RevId: 400706984
marcbaechinger pushed a commit that referenced this issue Oct 5, 2021
*** Original commit ***

Rollback of 8ed6c9f

*** Original commit ***

Fix capitalization of language in track selector

Issue: #9452

***

***

PiperOrigin-RevId: 400942287
@ojw28
Copy link
Contributor

ojw28 commented Oct 6, 2021

This is fixed by the three commits ref'd above (the second is a rollback, and third is a roll forward that includes a fix for the initial commit).

@ojw28 ojw28 closed this as completed Oct 6, 2021
@google google locked and limited conversation to collaborators Dec 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants