I choose the german language files. If I choose to use "today" and "yesterday", the time stamp on these two days will look like this:
18:45
On the other days it will look like this:
18:45 Uhr
Is there any chance to fix this?
Looks good on my "test install"... except I don't know German and I rely on google... O:-)
Where does it look like that?
In forum index. With german language we need the "Uhr" every time.
Edit: "Am Heute um 16:45" too is not perfect. It should be "Heute um 16:45 Uhr". But that's nearly impossible to handle, right?
hmm...
Okay, without having realized it, that's exactly the problem I was thinking about yesterday while looking at the code.
The current strings are:
$txt['today'] = 'Today';
and used like:
$txt['today'] . $time
while it would be much better to have:
$txt['today'] = 'Today %1$s';
and use them like:
sprintf($txt['today'], $time)
that way in German it would become:
$txt['today'] = 'Heute um %1$s Uhr'];
That said, could you please have a look here:
http://www.elkarte.it/community/index.php?language=german
because it seems to me there is something different from your screen (the "vormittags"). Not sure how to relate it with the rest... :-[
The whole sentence is:
Much better. It would be perfect if it were like this:
am Heute um 09:15 Uhr vormittags O:-)
"Vormittags" is only needed with 12h instead of 24h. Or without any hour. It's nearly the same as "am" (vormittags) and "pm" (nachmittags).
Oh so the "am" there is not German but the English "am"?
Right. You can use one of these in german, they are all correct:
Heute vormittag um 9:45 Uhr. (which means today 9:45 am)
Gestern nachmittag um 17:45 Uhr. (which means yesterday 5:45 pm)
Heute um 9:45 Uhr.
Heute vormittag. (without time and s)
Gestern nachmittag. (without time and s)
Am 27.09. vormittags um 9:45 Uhr. (with time and s)
Am 27.09. nachmittags um 17:45 Uhr. (with time and s)
Am 27.09. um 9:45 Uhr.
Thanks for the explanation! :D
/me keeps this unread
You're welcome.
By the way: The "who's online" site is missing the "Uhr" after the time completely. O:-)
Will this "problem" be fixed in RC2 or final? O:-)
That one may be a bit tricky.
The main problem is that these strings are used in a kind of odd way in the "who is online" page too, and just replace them with an sprintf would create problems there.
In particular, in http://www.elkarte.net/community/index.php?action=who the "time" column is built like that:
* 1st the normal time is generated doing:
$time = $txt['today'] . $time
and obtaining "Today at 02:46:17 pm" for example,
* then, somewhere else, the "today at" is stripped out with a replace like this:
$time = strtr($time, array($txt['today'] => ''));
To solve that it requires to add two new strings in Who.{language}.php at least.
Let's see, try to apply these changes and see if the result looks good, then we can decide on applying it to RC2 or final.
In Subs.php:
return $txt['today'] . standardTime($log_time, $today_fmt, $offset_type);
return sprintf($txt['today'], standardTime($log_time, $today_fmt, $offset_type));
then:
return $txt['yesterday'] . standardTime($log_time, $today_fmt, $offset_type);
return sprintf($txt['yesterday'], standardTime($log_time, $today_fmt, $offset_type));
In index.english.php:
$txt['today'] = 'Today at ';
$txt['yesterday'] = 'Yesterday at ';
$txt['today'] = 'Today at %1$s';
$txt['yesterday'] = 'Yesterday at %1$s';
And the corresponding change in index.german.php.
Additionally, in Who.english.php and Who.german.php:
// Overrides the already defined strings to get clean results in the table
$txt['today'] = '%1$s';
$txt['yesterday'] = '%1$s';
Let me know if it works for you. ;)
Still have a "am Heute um 09:12" :(
What did you put in $txt['today'] and $txt['yesterday'] of the index.german.php file?
// Overrides the already defined strings to get clean results in the table
$txt['today'] = '%1$s';
$txt['yesterday'] = '%1$s';
Ah... There must be "Heute" und "Gestern" instead of "%1$s"? No... Now it's "Am Heute um" without any time.
Those have to go in
Who, not in index.german.php.
In index.german.php you have to find the:
$txt['today'] = 'Heute um ';
$txt['yesterday'] = 'Gestern um ';
and replace then with something like:
$txt['today'] = 'Heute um %1$s Uhr.';
$txt['yesterday'] = 'Gestern um %1$s Uhr.';
Yeah, my mistake. Made the changes the way you explained earlier. Still is "Am Heute um 09:12 Uhr".
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).
Well, whatever, I sent the PR, it should work, if not... oh well, not the first time I break something. :P
Oh, sorry. Do you want me to test something? :-[
No problem. ;)
If I can help give me concrete orders! I will obey! :D
Okay, let's see... In Subs.php I have:
// 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:
$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:
$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?
Why not use?
$txt['today'] = 'am heute um %1$s';
$txt['yesterday'] = 'am gestern um %1$s';
Because it's wrong. We don't have the leading "am" in this sentence.
$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.
So you don't want the "am".
The "am" in the board index comes from:
$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:
Letzter Beitrag von %1$s<br />in %2$s<br />am 17 January
and:
Letzter Beitrag von %1$s<br />in %2$s<br />today at
right?
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:
$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.
I guess the easiest way is:
$txt['last_post_message'] = '%2$s<br />by %1$s, %3$s';
or:
$txt['last_post_message'] = 'Latest: %2$s<br />by %1$s, %3$s';
Could work in German as well?
See my second edit please. :-[
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:
$txt['last_post_message'] = 'Latest: %2$s<br />by %1$s. %3$s';
The problem is that my example is a hell to code and maintain/translate... :-\
What would you think of my last proposal:
I feel like I'm in a TARDIS! :o
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:$txt['last_post_message'] = 'Latest: %2$s<br />by %1$s. %3$s';
Nah, looks better with:
$txt['last_post_message'] = 'Latest: %2$s<br />by %1$s - %3$s';
Look: http://support.elkarte-hilfe.de/index.php
The last from me in this case. I tried:
$txt['last_post_message'] = 'Letzter Beitrag: %2$s<br />%3$s von %1$s';
...and it looks perfect cause it's the same as in board index. First the date and time, and then the author. But why don't make the board index 100% the same as the forum index?
There are too many options!! LOL (Actually it's true: full time, today, today+yesterday, relative times and find a way to accommodate them all in all languages is messy...really.)
Anyway, your last is like:
$txt['last_post_message'] = 'Last post: {subject}<br />{time} by {author}';
right? (Sorry, bug German is not in the list of languages I know... :()
Because in the two there are different elements: in board index there is subject+time+author, while in message index there is only time+author and the subject is on the left... If I got it right.
Yes, that's how I use it now.
With board index you mean the forum index and with message index you mean the board index (the list of threads inside a board)? :o
lolOn board index you have date+time+author, and an image for the last message. But why this image? Why not a text link to the last message in the thread like it is on the forum index? What's so special that you need this icon? ;)
I usually refer to:
Board Index: http://www.elkarte.net/community/index.php
Message Index: http://www.elkarte.net/community/index.php?board=2.0
I borrow the terms from the source code, where the files and all the functions that handle these pages are called like that.
Yes, it's a bit odd, though I know them like that. :P
That said, you have "date+time+author" if you don't use relative times. ;)
On Board Index (see attach 276) you have:
Line 1: {subject} by {author}
Line 2: last post: {date/time}
On Message Index (see attach 277) you have:
Line 1: {date/time}
Line 2: by {author}
On Message Index the subject is already on the left, so repeat it would be.. a repetition.
The reason for the arrow is because of space mainly: a text link in the place where the arrow is would take too much space and potentially overlap with the numbers on the right (replies/views/likes).
Of course it could be set on multiple lines, though I see a lot of repeated stuff...
It could be either:
Line 1: {subject} by {author}
Line 2: last post: {date/time}
With the {subject} already present on the left, or:
Line 1: <link>last post</link> by {author}
Line 2: last post: {date/time}
with "last post" repeated twice in the two lines... :-\
Or you wanted to say something different that I missed?
I understand now, thank you very much. :-[ :-X ;)
Okay, it works great for me the kind I have it now at http://support.elkarte-hilfe.de. Will you use this with the final version? Otherwise I need to explain this problem and a solution at my german support board (not forum :P ).
I guess is the safest one. ;)
I'll change it to that one tomorrow:
http://www.elkarte.net/community/index.php?topic=1672.msg11528#msg11528