-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Spin off hms as selectable time format #9924
Conversation
ba0e055
to
dafc9e9
Compare
How about... hear me... "hms"? :D EDIT: Except l10n is going to piss on my parade on that one, nevermind :/. |
Looks fine at a quick glance (all the changes from modern seem to make sense, AFAICT). |
Good to go ? |
What was literal again? I recall wanting to think about something better. |
I think one of us suggested it in the other discussion, which may or may not have been a joke ("littoral" was it?). I like it cuz it's literal without using symbols. Or maybe it was meant to be "letter-al" because it uses letters... that's nice. So maybe we could call it "Letters" My first thought "hms" is not very translation friendly, even tho seems to be what people call it if they ever call it anything. Doesn't matter that much since we give an example next to it |
that must have been me, |
Why do you say it's not? |
I guess it could be. The letters themselves are translatable after all. Do you prefer "Letters" or "HMS"? |
Is there any particular reason to try to avoid hours minutes seconds? |
Seems out of the pithy theme of "Classic" and "Modern" :) |
So, all good (bis) ? |
Well, there's a lack of screenshots and I don't really want to fetch it, so I have no idea one way or the other. |
Where did we land on the exact wording instead of "Literal"? |
Please provide some screenshots to figure that out. ;-) |
Gentle ping ;). |
I said it, but I won't stand for it :):
|
"Written" might be a decent alternative. |
"Spelled out"? |
That makes me think it's currently twenty-two forty-seven o'clock. |
True enough ;o). |
I like "Written" too. Actually wait, I saw the "Letters" suggestion, and I like that even better |
|
Pushed |
@@ -1872,7 +1872,7 @@ function ReaderStatistics:getDatesFromAll(sdays, ptype, book_mode) | |||
local stop_month = os.time{year=year_end, month=month_end, day=1, hour=0, min=0 } | |||
table.insert(results, { | |||
date_text, | |||
T(N_("%1 (%2 page)", "%1 (%2 pages)", tonumber(result_book[2][i])), datetime.secondsToClockDuration(user_duration_format, tonumber(result_book[3][i]), false, true), tonumber(result_book[2][i])), | |||
T(N_("%1 (%2 page)", "%1 (%2 pages)", tonumber(result_book[2][i])), datetime.secondsToClockDuration(user_duration_format, tonumber(result_book[3][i]), false), tonumber(result_book[2][i])), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly is this saying? Is the first meant to be %1 (1 page)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a mistake from when the workings of gettext
were a mystery, a mystery compounded by the order of the variables, left over from the statistics PR. It should say this, I think:
T(N_("%2 (1 page)", "%2 (%1 pages)", tonumber(result_book[2][i])), datetime.secondsToClockDuration(user_duration_format, tonumber(result_book[3][i]), false), tonumber(result_book[2][i])),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind fixing it in a mini-PR if your mind's still in tune with this code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, but as a sanity check, is the corrected line I posted actually correct? The gettext part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely, always write it sensibly, i.e., it should look like "%1 (1 page)", "%1 (%2 pages)"
.
It's the code that should adapt, not what's given to the translators. ^_^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always always forget that the N_() does nothing except choose one of the strings depending on the number given in the second arg
Btw, wouldn't you prefer your letters'ed duration to get a little spacing ? |
@poire-z I made the exact same patch for myself, with the added spaces! But didn't think you guys would like it. I think it looks better with the spaces, no hairline required. I'm down to do a mini PR to add the space if everyone else is fine with it too |
No objection here ;). |
Fix some of my early blunders in using the `N_()` gettext function. Mini-PR from #9924 (comment) (@Frenzie). There was also one line for generating this same `%1 (%2 pages)` text that confusingly uses different ordering in the SQL query output; switched the two SELECT arguments around to make it match the other 5 usages. Works the same as before
The bare minimum changes to do this as talked about in that other PR. Mostly updating
datetime.secondsToClockDuration()
usages. Updated testsThe name of the hms option is up for debate. "Literal" is the stand-in
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)