+#: templates/scenario.xml:13
+#, no-wrap
+msgid ": "
+msgstr ""
+
+#. type: Content of:
+#: templates/scenario-not-found.xml:11
+#, no-wrap
+msgid "Fant ingen måte "
+msgstr ""
+
+#. type: Content of:
+#: templates/scenario-not-found.xml:11
+#, no-wrap
+msgid " kan ende på "
+msgstr ""
+
+#. type: Content of:
+#: templates/scenario-not-found.xml:11
+#, no-wrap
+msgid " plass på."
+msgstr ""
diff --git a/po4a.config b/po4a.config
new file mode 100644
index 0000000..65fa2c5
--- /dev/null
+++ b/po4a.config
@@ -0,0 +1,5 @@
+[po_directory] po/
+[type:xml] templates/index.xml en:templates/index.en.xml
+[type:xml] templates/rating.xml en:templates/rating.en.xml
+[type:xml] templates/scenario.xml en:templates/scenario.en.xml
+[type:xml] templates/scenario-not-found.xml en:templates/scenario-not-found.en.xml
diff --git a/templates/index.en.xml b/templates/index.en.xml
new file mode 100644
index 0000000..90e9354
--- /dev/null
+++ b/templates/index.en.xml
@@ -0,0 +1,117 @@
+
+
+
+
+ WLoH ranking probability calculation
+
+
+
+
+
+
+ ::
+
+
+
+
+
+ WLoH ranking probability calculation
+
+ This is a hobby project from a third party, and not an official part of Wordfeud League of Honour .
+
+ The calculation does not take into account uneven playing strength, information from the forum etc.; it assumes that any unplayed games are drawn from a Gaussian distribution with standard deviation points. The probabilities might not sum to 100%, due to roundoff errors. The numbers will vary a bit between runs, since the calculation is stochastic. For scenario example, click in a cell.
+
+ The players are sorted by nickname.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Below is a variant that takes relative playing strength into account; see the ratings page .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Covariance matrix:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Average rating in this subdivision is .
+ The database was last synchronized .
+
+
diff --git a/templates/rating.en.xml b/templates/rating.en.xml
new file mode 100644
index 0000000..e570bea
--- /dev/null
+++ b/templates/rating.en.xml
@@ -0,0 +1,85 @@
+
+
+
+
+ WLoH rating
+
+
+
+
+
+ ::
+
+
+
+
+
+ WLoH rating
+
+ This is a hobby project from a third party, and not an official part of Wordfeud League of Honour .
+
+ Even so, the rating is based on play data from WLoH (thanks to Lobotommy for access!), and is updated every hour. It is completely unofficial and has no bearing on WLoH, but is used to estimate win probabilities in the probability calculation .
+
+ The model can change at any time I feel like it :-) Do not take the rating too seriously, even though it is based on relatively reasonable mathematical models. Remember that all statistics say more about the past than about the future.
+
+ Model parameters
+
+ For those so inclined. There is also a longer, more detailed explanation intended for non-mathematicians.
+
+
+ MLE-based model with one scalar (strength) per player and to global scalars (both standard deviations; see below), solved using cyclic MM (minorization-maximization). Number of iterations to convergence: .
+ Likelihood function, prior: Gaussian distribution with µ=500, Ï= (est.)
+ Likelihood function, for each match: Gaussian distribution with µ=(score1 - score2), Ï= (est.)
+ Weight: Current and previous three seasons are given full weight (equal to the prior). Older seasons are weighted exponentially less, with half-life of three seasons. Matches stored as 0-0, 150-0, 0-150 eller 150-150 are ignored.
+
+
+ List of divisions
+
+
+
+
+ Div.
+ Average
+ Std.dev
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ranking list
+
+
+
+
+
+ Nickname
+ Rating
+ Std.dev
+ Last seen
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The database was last synchronized .
+
+
diff --git a/templates/scenario-not-found.en.xml b/templates/scenario-not-found.en.xml
new file mode 100644
index 0000000..7c52aa0
--- /dev/null
+++ b/templates/scenario-not-found.en.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ WLoH ranking probability calculation
+
+
+
+ Couldn't find a situation where ends up in place.
+
+
diff --git a/templates/scenario.en.xml b/templates/scenario.en.xml
new file mode 100644
index 0000000..27aed09
--- /dev/null
+++ b/templates/scenario.en.xml
@@ -0,0 +1,16 @@
+
+
+
+
+ WLoH ranking probability calculation
+
+
+
+ Scenario where ends in place:
+
+
+
diff --git a/www/index.pl b/www/index.pl
index 2b7dcaf..4fef4a7 100755
--- a/www/index.pl
+++ b/www/index.pl
@@ -138,9 +138,9 @@ sub get_covariance_matrix {
}
sub write_parms_to_file {
- my ($aux_parms, $match_stddev, $used_ratings, $used_cov) = @_;
+ my ($locale, $aux_parms, $match_stddev, $used_ratings, $used_cov) = @_;
- POSIX::setlocale(&POSIX::LC_ALL, 'nb_NO.UTF-8');
+ wloh_common::set_locale($locale);
my @sorted_players = sort { $players{$a} cmp $players{$b} } keys %players;
@@ -175,7 +175,7 @@ sub write_parms_to_file {
}
close MCCALC;
- POSIX::setlocale(&POSIX::LC_ALL, 'nb_NO.UTF-8');
+ wloh_common::set_locale($locale);
return $tmpnam;
}
@@ -183,7 +183,7 @@ sub write_parms_to_file {
sub make_table {
my ($locale, $aux_parms, $match_stddev, $lowest_division, $used_ratings, $used_cov, $division, $subdivision, $table_id) = @_;
- my $tmpnam = write_parms_to_file($aux_parms, $match_stddev, $used_ratings, $used_cov);
+ my $tmpnam = write_parms_to_file($locale, $aux_parms, $match_stddev, $used_ratings, $used_cov);
my %prob = ();
open MCCALC, "$config::base_dir/mcwordfeud $trials < $tmpnam |"
@@ -352,7 +352,7 @@ get_players_and_ratings($dbh, $locale, $season, $division, $subdivision);
my $cov = get_covariance_matrix($dbh, keys %players);
if (defined($match_player) && defined($match_position)) {
- my $tmpnam = write_parms_to_file($aux_parms, $match_stddev, \%ratings, $cov);
+ my $tmpnam = write_parms_to_file($locale, $aux_parms, $match_stddev, \%ratings, $cov);
--$match_player;
--$match_position;
@@ -377,20 +377,20 @@ if (defined($match_player) && defined($match_position)) {
if (scalar @scenario == 0) {
print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+5m');
- wloh_common::process_template('scenario-not-found.xml', {
+ wloh_common::process_template('scenario-not-found', $locale, {
'#nick' => $player_name,
'#rank' => sprintf("%d.", $match_position + 1)
});
} else {
print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+5m');
- wloh_common::process_template('scenario.xml', {
+ wloh_common::process_template('scenario', $locale, {
'#nick' => $player_name,
'#rank' => sprintf("%d.", $match_position + 1),
'#results' => \@scenario
});
}
} else {
- POSIX::setlocale(&POSIX::LC_ALL, 'nb_NO.UTF-8');
+ wloh_common::set_locale($locale);
my $max_division = $divisions[$#divisions];
my $lowest_division = ($division == $max_division);
@@ -401,7 +401,7 @@ if (defined($match_player) && defined($match_position)) {
my $avg_rating = find_avg_rating(\%ratings);
print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+5m');
- wloh_common::process_template('index.xml', {
+ wloh_common::process_template('index', $locale, {
'#navbar' => wloh_common::get_navbar($cgi, $dbh, $locale),
'#division-selector/action' => "/$locale/",
'#division' => get_division_selector(\@divisions, $division),
diff --git a/www/rating.pl b/www/rating.pl
index c69d5a7..dca62d8 100755
--- a/www/rating.pl
+++ b/www/rating.pl
@@ -26,7 +26,7 @@ my $locale = wloh_common::get_locale($cgi);
my $aux_parms = wloh_common::get_auxillary_parameters($dbh, $locale);
-POSIX::setlocale(&POSIX::LC_ALL, 'nb_NO.UTF-8');
+wloh_common::set_locale($locale);
my $season = wloh_common::get_max_season($dbh, $locale);
@@ -98,7 +98,7 @@ while (my $ref = $q->fetchrow_hashref) {
}
print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+5m');
-wloh_common::process_template('rating.xml', {
+wloh_common::process_template('rating', $locale, {
'#navbar' => wloh_common::get_navbar($cgi, $dbh, $locale),
'iterations' => $aux_parms->{'num_iterations'},
'rating-prior-stddev' => sprintf("%.1f", $aux_parms->{'rating_prior_stddev'}),
--
2.39.2