Skip to main content
Topic: [RC1] time format with "today" and "yesterday" (Read 8018 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: [RC1] time format with "today" and "yesterday"

Reply #15

Those have to go in Who, not in index.german.php.
In index.german.php you have to find the:
Code: [Select]
$txt['today'] = 'Heute um ';
$txt['yesterday'] = 'Gestern um ';
and replace then with something like:
Code: [Select]
$txt['today'] = 'Heute um %1$s Uhr.';
$txt['yesterday'] = 'Gestern um %1$s Uhr.';
Bugs creator.
Features destroyer.
Template killer.

Re: [RC1] time format with "today" and "yesterday"

Reply #16

Yeah, my mistake. Made the changes the way you explained earlier. Still is "Am Heute um 09:12 Uhr".

Re: [RC1] time format with "today" and "yesterday"

Reply #17

Can you attach here your index.german.php?
Never mind, it seems that transifex didn't recognize the commented out string...

ETA: https://github.com/elkarte/Elkarte/pull/1727
It was using the string I removed in that commit, that is also the one you have in the translation instead of the correct one (that is the one non commented).
Last Edit: July 14, 2014, 03:29:41 pm by emanuele
Bugs creator.
Features destroyer.
Template killer.

Re: [RC1] time format with "today" and "yesterday"

Reply #18

Well, whatever, I sent the PR, it should work, if not... oh well, not the first time I break something. :P
Bugs creator.
Features destroyer.
Template killer.

Re: [RC1] time format with "today" and "yesterday"

Reply #19

Oh, sorry. Do you want me to test something? :-[

Re: [RC1] time format with "today" and "yesterday"

Reply #20

No problem. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: [RC1] time format with "today" and "yesterday"

Reply #21

If I can help give me concrete orders! I will obey!  :D

Re: [RC1] time format with "today" and "yesterday"

Reply #22

Okay, let's see... In Subs.php I have:

Code: [Select]
		// Same day of the year, same year.... Today!
if ($then['yday'] == $now['yday'] && $then['year'] == $now['year'])
return sprintf($txt['today'], standardTime($log_time, $today_fmt, $offset_type));

// Day-of-year is one less and same year, or it's the first of the year and that's the last of the year...
if ($modSettings['todayMod'] == '2' && (($then['yday'] == $now['yday'] - 1 && $then['year'] == $now['year']) || ($now['yday'] == 0 && $then['year'] == $now['year'] - 1) && $then['mon'] == 12 && $then['mday'] == 31))
return sprintf($txt['yesterday'], standardTime($log_time, $today_fmt, $offset_type));
}
...and in index.german.php I have:

Code: [Select]
$txt['last_post'] = 'Letzter Beitrag';
$txt['first_post'] = 'Erster Beitrag';
$txt['last_poster'] = 'Antwort von';
$txt['last_post_message'] = 'Letzter Beitrag von %1$s<br />in %2$s<br />am %3$s';
// @todo - Clean this up a bit. See notes in template.
// Just moved a space, so the output looks better when things break to an extra line.
$txt['last_post_message'] = 'Letzter Beitrag von %1$s<br />in %2$s<br />am %3$s';
$txt['boardindex_total_posts'] = '%1$s Beiträge in %2$s Themen von %3$s Benutzern';

...and:
Code: [Select]
$txt['today'] = 'Heute um %1$s';
$txt['yesterday'] = 'Gestern um %1$s';

But: I still have the problem with the leading "am" before the date and time in the german translation.
See the screenshot please. In the list of the recent posts in info center there is no "am" before date and time and that's exactly what is needed in the index. Can't we copy this code part from the info center?

Re: [RC1] time format with "today" and "yesterday"

Reply #23

Why not use?
Code: [Select]
$txt['today'] = 'am heute um %1$s';
$txt['yesterday'] = 'am gestern um %1$s';
Bugs creator.
Features destroyer.
Template killer.

Re: [RC1] time format with "today" and "yesterday"

Reply #24

Because it's wrong. We don't have the leading "am" in this sentence.

Code: [Select]
$txt['today'] = 'Heute um %1$s';
$txt['yesterday'] = 'Gestern um %1$s';

This is correct, but there seems to be a "am" for the index which is not part of the index.german.php.

Re: [RC1] time format with "today" and "yesterday"

Reply #25

So you don't want the "am".
The "am" in the board index comes from:
Code: [Select]
$txt['last_post_message'] = 'Letzter Beitrag von %1$s<br />in %2$s<br />am %3$s'

So if I understood correctly you would like to have:
Code: [Select]
Letzter Beitrag von %1$s<br />in %2$s<br />am 17 January
and:
Code: [Select]
Letzter Beitrag von %1$s<br />in %2$s<br />today at
right?
Bugs creator.
Features destroyer.
Template killer.

 

Re: [RC1] time format with "today" and "yesterday"

Reply #26

Near, but if the last post was today, then we have again an "am" too much.

The "am" is only neccessary when a date in the format "12. Oktober 2013" is shown. With "Heute" and "Gestern" or "vormittags um 9:45" we don't need the "am".

Confusing, hm?

A solution I can live with can be:

Code: [Select]
$txt['last_post_message'] = 'Letzter Beitrag von: %1$s<br />Thema: %2$s<br />Datum: %3$s

Then it's not a whole sentence, but it will work with all kinds of date formats, because the "am" is nowhere then.

Edit: See the screenshot how this will look. Oh, maybe it's better looking if the third row will not be under the avatar, but building a line with the first and second row?

Edit2: Oh, sorry, didn't get it. I'm ill. You're right with your example, that's exactly what is needed.

Re: [RC1] time format with "today" and "yesterday"

Reply #27

I guess the easiest way is:
Code: [Select]
$txt['last_post_message'] = '%2$s<br />by %1$s, %3$s';
or:
Code: [Select]
$txt['last_post_message'] = 'Latest: %2$s<br />by %1$s, %3$s';
Could work in German as well?
Bugs creator.
Features destroyer.
Template killer.

Re: [RC1] time format with "today" and "yesterday"

Reply #28

See my second edit please.  :-[

Quote from: emanuele – I guess the easiest way is:
Code: [Select]
$txt['last_post_message'] = '%2$s<br />by %1$s, %3$s';
or:
Code: [Select]
$txt['last_post_message'] = 'Latest: %2$s<br />by %1$s, %3$s';
Could work in German as well?
Yes, this will work too. But then the "Heute" and "Gestern" must be "heute" and "gestern", while in info center it must be "Heute" and "Gestern" because it starts a sentence there. OMG!!!

We could make it:

Code: [Select]
$txt['last_post_message'] = 'Latest: %2$s<br />by %1$s. %3$s';

Re: [RC1] time format with "today" and "yesterday"

Reply #29

The problem is that my example is a hell to code and maintain/translate... :-\

What would you think of my last proposal:
Quote from: emanuele – I guess the easiest way is:
Code: [Select]
$txt['last_post_message'] = '%2$s<br />by %1$s, %3$s';
or:
Code: [Select]
$txt['last_post_message'] = 'Latest: %2$s<br />by %1$s, %3$s';
Could work in German as well?
Bugs creator.
Features destroyer.
Template killer.