question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Capitalize first letter of a text in track selector menu items

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ojw28commented, 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.

0reactions
ojw28commented, 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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Automatically Capitalize Text the Way You Want - Zapier
Select your text, click the Format menu, then select Capitalization and choose the case you want. It supports upper and lower case, along...
Read more >
regex - Notepad++ Capitalize Every First Letter of Every Word
In case you have hyphenated words, like well-known , and you only want the first part to be capitalized, you can use [\w-]+...
Read more >
Convert text to all CAPS and more in Google Docs
UPPERCASE, to capitalize all the letters in your selection. Title Case, to capitalize the first letter of each word in your selection.
Read more >
Change the capitalization or case of text - Microsoft Support
To capitalize all of the letters, click UPPERCASE. To capitalize the first letter of each word and leave the other letters lowercase, click...
Read more >
Capitalization - Affinity Help
Capitalization transformations are available from the Text>Capitalization menu. Dynamic transformations. Items in the menu's first group are applied dynamically ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found