-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Add rating and votes label for specific rating #8788
Conversation
18aca43
to
d7eb9a9
Compare
I would guess it's best to keep it in line with the other ratings and votes labels and not add 10.000 if the others don't behave that way. |
The problem is that in Jarvis (at least in my setup) votes was a string with already built in punctuation (100,000). With my pr andrating as integer I changed how votes are displayed (and IMHO it looks weird too) |
I always prefer to show big numbers with the comma. I do that with all vote counts on the metadata sites so I think Kodi should do the same. |
if (rating.votes == 0) | ||
return StringUtils::Format("%.1f", rating.rating); | ||
else | ||
return StringUtils::Format("%.1f (%i %s)", rating.rating, rating.votes, g_localizeStrings.Get(20350).c_str()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Number formatting is language specific and must be handled in such way. Possibly with std::ios_base::imbue? |
d7eb9a9
to
ca346f2
Compare
@tamland |
See SetGlobalLocale in LangInfo.cpp, but for some reason it only sets collate because it "breaks atof() others similar functions" (?) |
After investigating better I discovered that it's possible to override global locale. It only doesn't work in windows. The problem is here: |
I guess this could go in since the existing label is already without formatting style. The formatting could be posted in a new pr (once I figure it out how :| ) |
@@ -11430,7 +11430,7 @@ msgid "No video files found in this path!" | |||
msgstr "" | |||
|
|||
msgctxt "#20350" | |||
msgid "votes" | |||
msgid "%.1f (%i votes)" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
ca346f2
to
9568fb1
Compare
Updated with explanation string |
jenkins build and merge |
Now skins can use directly a label with both votes and ratings.
do someone know if there is a number formatting method in kodi to transform for example
10000
in
10.000?