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

Fix localization of counts #4011

Conversation

ChunkyProgrammer
Copy link
Member

Fix localization of counts

Pull Request Type

  • Bugfix

Related issue

See: #3970 (comment)

Description

Use TC to properly handle plurals of view count, subscriber count, channel count, etc.

Testing

Test the following on both local and invidious api (remember to clear search cache if searching the same thing)

  • view a channel in search, look at subscriber and video count (ex: search the replacements - topic)
    image
  • view a video on search, look at view count
    image
  • click on a video, look at view count
    image
  • look at the subscribers count on a channel page
    image

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.19.0

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) September 8, 2023 18:03
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 8, 2023
PikachuEXE
PikachuEXE previously approved these changes Sep 9, 2023
@absidue
Copy link
Member

absidue commented Sep 9, 2023

Looking at the second screenshot it looks like you've removed the whitespace between the divider and the view count.

@absidue
Copy link
Member

absidue commented Sep 9, 2023

Also you should probably get rid of the old strings as they are presumably unused now.

@absidue absidue added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Sep 9, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@PikachuEXE
Copy link
Collaborator

Space between divider & view count still missing
image

ChunkyProgrammer and others added 2 commits September 11, 2023 09:54
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
@ChunkyProgrammer ChunkyProgrammer added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Sep 11, 2023
@github-actions github-actions bot added PR: merge conflicts / rebase needed and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Sep 11, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@ChunkyProgrammer ChunkyProgrammer added the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 11, 2023
Comment on lines +51 to +53
Subscriber Count: 1 subscriber | {count} subscribers
View Count: 1 view | {count} views
Watching Count: 1 watching | {count} watching
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though not mentioned by
https://kazupon.github.io/vue-i18n/guide/pluralization.html#pluralization

When zero value not provided and count is zero, the plural version is used (I tested locally) (for en at least)

Views: 'Views'
Loop Playlist: 'Loop Playlist'
Shuffle Playlist: 'Shuffle Playlist'
Reverse Playlist: 'Reverse Playlist'
Play Next Video: 'Play Next Video'
Play Previous Video: 'Play Previous Video'
# Context is "X People Watching"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do see that we're not including this comment anymore, which I think is fine as the pluralization and placement makes the context of the translation label more intuitive. As a sidenote, comments like these do make me wonder if having implicit subjects/objects in our labels is a burden for [a subset of] our translators; I have no idea.

@FreeTubeBot FreeTubeBot merged commit 67bdf71 into FreeTubeApp:development Sep 12, 2023
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 12, 2023
@ChunkyProgrammer ChunkyProgrammer deleted the fix-localization-of-counts branch September 12, 2023 20:10
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Sep 13, 2023
* development:
  Translated using Weblate (Chinese (Simplified))
  Translated using Weblate (Polish)
  Translated using Weblate (Czech)
  Translated using Weblate (Turkish)
  Translated using Weblate (French)
  Translated using Weblate (German)
  Fix localization of counts (FreeTubeApp#4011)
  Sort list of external players (FreeTubeApp#4036)
  Translated using Weblate (French)
  Translated using Weblate (Icelandic)
  Translated using Weblate (Estonian)
  Translated using Weblate (Chinese (Traditional))
  Translated using Weblate (Italian)
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.

5 participants