Add translation hints for time format strings.

Also mark Add-On Manager time string for translation.
Resolves #6246.
This commit is contained in:
Wedge009 2021-11-02 10:19:16 +11:00
parent 38b8fc1f50
commit c7cab90d5d
2 changed files with 8 additions and 4 deletions

View file

@ -955,11 +955,13 @@ static std::string format_addon_time(std::time_t time)
if(time) {
std::ostringstream ss;
const char* format = preferences::use_twelve_hour_clock_format()
? "%Y-%m-%d %I:%M %p"
: "%Y-%m-%d %H:%M";
const std::string format = preferences::use_twelve_hour_clock_format()
// TRANSLATORS: Four-digit year + numeric month + day of month + 12-hour time, eg '2021-11-02 1:59 PM'. Format for your locale.
? _("%Y-%m-%d %I:%M %p")
// TRANSLATORS: Four-digit year + numeric month + day of month + 24-hour time, eg '2021-11-02 13:59'. Format for your locale.
: _("%Y-%m-%d %H:%M");
ss << std::put_time(std::localtime(&time), format);
ss << translation::strftime(format, std::localtime(&time));
return ss.str();
}

View file

@ -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 + year + 12-hour time, eg 'Tue Nov 02 2021, 1:59 PM'. Format for your locale.
? _("%a %b %d %Y, %I:%M %p")
// TRANSLATORS: Day of week + month + day of month + year + 24-hour time, eg 'Tue Nov 02 2021, 13:59'. Format for your locale.
: _("%a %b %d %Y, %H:%M");
return translation::strftime(format, tm_l);