Add translation hints for time format strings.
[ci skip]
This commit is contained in:
parent
02db53c928
commit
92e8e1cd86
2 changed files with 8 additions and 0 deletions
|
@ -44,25 +44,31 @@ std::string format_time_summary(std::time_t t) {
|
|||
if(days_apart == 0) {
|
||||
// save is from today
|
||||
if(preferences::use_twelve_hour_clock_format() == false) {
|
||||
// TRANSLATORS: 24-hour time, eg '13:59'
|
||||
format_string = _("%H:%M");
|
||||
}
|
||||
else {
|
||||
// TRANSLATORS: 12-hour time, eg '1:59 PM'
|
||||
format_string = _("%I:%M %p");
|
||||
}
|
||||
} else if(days_apart > 0 && days_apart <= current_time.tm_wday) {
|
||||
// save is from this week
|
||||
if(preferences::use_twelve_hour_clock_format() == false) {
|
||||
// TRANSLATORS: Day of week + 24-hour time, eg 'Sunday, 13:59'
|
||||
format_string = _("%A, %H:%M");
|
||||
}
|
||||
else {
|
||||
// TRANSLATORS: Day of week + 12-hour time, eg 'Sunday, 1:59 PM'
|
||||
format_string = _("%A, %I:%M %p");
|
||||
}
|
||||
} else {
|
||||
// save is from current year
|
||||
// TRANSLATORS: Month + day of month, eg 'Nov 02'. Format for your locale.
|
||||
format_string = _("%b %d");
|
||||
}
|
||||
} else {
|
||||
// save is from a different year
|
||||
// TRANSLATORS: Month + day of month + year, eg 'Nov 02 2021'. Format for your locale.
|
||||
format_string = _("%b %d %Y");
|
||||
}
|
||||
assert(!format_string.empty());
|
||||
|
|
|
@ -276,7 +276,9 @@ std::string save_info::format_time_local() const
|
|||
{
|
||||
if(std::tm* tm_l = std::localtime(&modified())) {
|
||||
const std::string format = preferences::use_twelve_hour_clock_format()
|
||||
// TRANSLATORS: Day of week + month + day of month + 12-hour time + year, eg 'Tue Nov 02 1:59 PM 2021'. Format for your locale.
|
||||
? _("%a %b %d %I:%M %p %Y")
|
||||
// TRANSLATORS: Day of week + month + day of month + 24-hour time + year, eg 'Tue Nov 02 13:59 2021'. Format for your locale.
|
||||
: _("%a %b %d %H:%M %Y");
|
||||
|
||||
return translation::strftime(format, tm_l);
|
||||
|
|
Loading…
Add table
Reference in a new issue