savetheinternet / Tinyboard

The better imageboard software
http://tinyboard.org
Other
367 stars 306 forks source link

i18nized until() and ago() functions broken with gettext.php (ngettext) #125

Closed savetheinternet closed 11 years ago

savetheinternet commented 11 years ago

I believe this problem only appears when the PHP gettext extension isn't installed. The pure-PHP gettext library I included as a fallback (inc/lib/gettext) is not perfect.

Notice: Use of undefined constant INTEGER - assumed 'INTEGER' in inc/lib/gettext/gettext.php(361) : eval()'d code on line

Notice: Use of undefined constant EXPRESSION - assumed 'EXPRESSION' in inc/lib/gettext/gettext.php(361) : eval()'d code on line 1

Notice: Undefined index: EXPRESSION in inc/lib/gettext/gettext.php on line 396

I'm not sure whether the problem arises from the gettext library itself or from @czaks's implementation of ngettext in babeec8bb9f54eece943b74628c95f976f5ee814.

$config['locale'] = 'pl_PL.UTF-8'; // Errors appear
$config['locale'] = 'en'; // No problems

Screenshot

czak commented 11 years ago

It's @czaks not @czak :)

savetheinternet commented 11 years ago

What's the difference? Fix it, buddy.

savetheinternet commented 11 years ago

I used the Polish plural form from here in my fix.