summaryrefslogtreecommitdiff
path: root/lib/VNDB/Func.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-01-19 20:29:40 +0100
committerYorhel <git@yorhel.nl>2016-01-20 21:16:55 +0100
commita6836df277867d73a71c55797984c947449772cc (patch)
treec72a326dd844c3c23a932dc76dc159200c1dfcdb /lib/VNDB/Func.pm
parent0caed2e7674e8ee7419365e76f86d06c33b8c8aa (diff)
L10N: Intern all VNDB::Util::* stuff
With some related edits in other parts of the code, mostly due to interface changes to htmlRevision() and htmlFormError(). Trivial replacements were automated by a super awesome script.
Diffstat (limited to 'lib/VNDB/Func.pm')
-rw-r--r--lib/VNDB/Func.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm
index 42d1b7f2..7549207f 100644
--- a/lib/VNDB/Func.pm
+++ b/lib/VNDB/Func.pm
@@ -11,7 +11,7 @@ use VNDBUtil;
our @EXPORT = (@VNDBUtil::EXPORT, qw|
clearfloat cssicon tagscore mt minage fil_parse fil_serialize parenttags
childtags charspoil imgpath imgurl
- fmtvote fmtmedia fmtvnlen fmtage fmtdatestr fmtdate fmtuser
+ fmtvote fmtmedia fmtvnlen fmtage fmtdatestr fmtdate fmtuser fmtrating
json_encode json_decode script_json
form_compare
|);
@@ -273,6 +273,20 @@ sub fmtuser {
return !$id ? '[deleted]' : sprintf '<a href="/u%d">%s</a>', $id, xml_escape $n;
}
+# Turn a (natural number) vote into a rating indication
+sub fmtrating {
+ ['worst ever',
+ 'awful',
+ 'bad',
+ 'weak',
+ 'so-so',
+ 'decent',
+ 'good',
+ 'very good',
+ 'excellent',
+ 'masterpiece']->[shift()-1];
+}
+
# JSON::XS::encode_json converts input to utf8, whereas the below functions