]> git.sesse.net Git - wloh/blobdiff - www/index.pl
Support per-language ordinal styles.
[wloh] / www / index.pl
index efa55175bd828ef927a485e0d6172004fc138435..eb6d1761f613376d16bc4dd9dc98d07043337621 100755 (executable)
@@ -203,7 +203,7 @@ sub make_table {
        # Make list of ranks. (Relegation is handled specially.)
        my @ranks = ();
        for my $i (1..$num_games) {
-               push @ranks, { 'th' => "$i." };
+               push @ranks, { 'th' => wloh_common::get_ordinal($i, $locale) };
        }
 
        my @players = ();
@@ -380,13 +380,13 @@ if (defined($match_player) && defined($match_position)) {
                print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+5m');
                wloh_common::process_template('scenario-not-found', $locale, {
                        '#nick' => $player_name,
-                       '#rank' => sprintf("%d.", $match_position + 1)
+                       '#rank' => wloh_common::get_ordinal($match_position + 1, $locale)
                });
        } else {
                print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+5m');
                wloh_common::process_template('scenario', $locale, {
                        '#nick' => $player_name,
-                       '#rank' => sprintf("%d.", $match_position + 1),
+                       '#rank' => wloh_common::get_ordinal($match_position + 1, $locale),
                        '#results' => \@scenario
                });
        }