Regarding the latest few commits... Wouldn't it make sense to have a function like, 'complex_string', whose purpose would be to do the common string replacements? (boardurl, scripturl...)
It wouldn't be as fast, though. But from the moment you implemented {variables}, I suppose it mattered less than having a non-dynamic list of text strings.
Remember that AM/PM support was very late in the day, not only as a fix but as a report. It can't be that big a problem. It would be interesting to see what languages actually have updated $txt['am'] and $txt['pm'].
I totally forgot that this was recent, indeed...
I don't even know why people would need to translate this, meh.
Oh, and so... What about this %Y problem?
We *could* do it in a complicated way, such as {, %Y} where everything between {} would be removed if %Y is empty, but we'd need to apply this to all occurrences, which isn't cool... (Well, of course we could simply integrate the removal in the same code that gets rid of %Y in the first place.)
$show_today = str_replace(' %Y', '', $user_info['time_format']);
->
$show_today = preg_replace('~,? %Y~', '', $user_info['time_format']);
or
$show_today = str_replace(array(', %Y', ' %Y'), '', $user_info['time_format']);
(The second one is faster. strtr() has similar performance, can be 10%-20% faster or slower, totally randomly.)
Or simply remove the comma entirely..?
I really like not having the year when it's a recent post... It's halfway between hardcoded and dynamic dates. And it saves precious space.
Support is very limited. All it does is search for %p, work out whether it's AM or PM and substitute in the relevant $txt item. Since I removed the $txt items and the test... it is all gone. Basically it just brings us back to around 2.0 RC4 - but the language itself now dictates what format to use, rather than a language independent version set by the admin.
Definitely better...
Kill it. If it isn't being used, get rid of it, pure and simple.
We could also kill $txt['by']... Either do $txt['by_person'] = 'by %1$s', or a series of more strings that would allow for 'by <strong>%1$s</strong>', etc...
Dunno.
It's just that in Japanese, the 'by' is usually shown after the name. But I think it can be put before the name as well, if needed. It just doesn't feel as natural. (And yeah, I know, even SMF doesn't have a Japanese version... But Kyôdai Mahjongg does
:P)