From 075131dfe0c1ced40ae5b348160cce8a150f576d Mon Sep 17 00:00:00 2001 From: Chris Moore Date: Sun, 11 Sep 2011 02:04:26 -0700 Subject: [PATCH] A bunch of changes to allow translation via gettext. Not finished yet. --- 404.php | 12 +++-- add_cash.php | 23 ++++----- commission.php | 24 +++++----- db.php | 2 +- deposit.php | 95 +++++++++++++++++++++---------------- errors.php | 2 +- footer.php | 30 ++++++------ freeze.php | 19 ++++---- header.php | 6 +-- htdocs/config.php | 25 ++++++++++ login.php | 42 ++++++++++------- util.php | 116 +++++++++++++++++++++++++--------------------- 12 files changed, 233 insertions(+), 163 deletions(-) diff --git a/404.php b/404.php index f4b8251..943bf49 100644 --- a/404.php +++ b/404.php @@ -1,10 +1,14 @@
-

Page Not Found

- +

- Sorry, but ">that page no longer exists. +', getenv("REQUEST_URI")), + ""); ?>

-


thanks to Matthew Inman for the image
+

+', + ""); ?>

diff --git a/add_cash.php b/add_cash.php index 8da28c9..d58db53 100644 --- a/add_cash.php +++ b/add_cash.php @@ -31,8 +31,8 @@ function show_similar_codes($reference) if ($score >= 50) { if ($first) { $first = false; - echo "

Did you mean one of these? Higher percentage = closer match.

\n"; - echo "

Click an entry to copy it to the form below, then click 'Deposit' again.

\n"; + echo "

" . _("Did you mean one of these? Higher percentage = closer match.") . "

\n"; + echo "

" . _("Click an entry to copy it to the form below, then click 'Deposit' again.") . "

\n"; echo "\n"; } echo "\n"; -echo "

Deposit cash

\n"; +echo "

" . _("Deposit cash") . "

\n"; if (!$is_admin) throw new Error("GTFO", "How did you get here?"); @@ -78,15 +78,16 @@ function show_similar_codes($reference) VALUES ('DEPOS', '" . CURRENCY . "', $user, $amount_internal) "; do_query($query); - echo "

added request to deposit $amount " . CURRENCY . - " to user $user's purse (reference $reference)

\n"; - echo "

deposit should show up in their account in a minute or two

\n"; - echo "

make another deposit?

\n"; + printf("

" . _("added request to deposit %s to user %s's purse (reference %s)") . "

\n", + ($amount . " " . CURRENCY), $user, $reference); + echo "

" . _("deposit should show up in their account") . " " . _("in a minute or two") . "

\n"; + echo "

" . _("make another deposit?") . "

\n"; $amount= $reference = ''; } else { - echo "

'$reference' isn't a valid reference code\n"; + printf("

" . _("'%s' isn't a valid reference code") . "

\n", + $reference); show_similar_codes($reference); - echo "

try again?

\n"; + echo "

" . _("try again?") . "

\n"; } } else $amount = $reference = ''; @@ -95,10 +96,10 @@ function show_similar_codes($reference) - + - + diff --git a/commission.php b/commission.php index 2e85405..6069d6d 100644 --- a/commission.php +++ b/commission.php @@ -14,7 +14,7 @@ function active_table_cell($uid, $txid, $orderid, $sub, $amount, $precision) echo "\n"; echo "
\n"; -echo "

Commission

\n"; +echo "

" . _("Commission") . "

\n"; $query = " SELECT txid, @@ -50,12 +50,12 @@ function active_table_cell($uid, $txid, $orderid, $sub, $amount, $precision) echo "
"; echo ""; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; echo ""; } @@ -111,10 +111,12 @@ function active_table_cell($uid, $txid, $orderid, $sub, $amount, $precision) } $commissions = fetch_balances('1'); -echo "

In the commission purse, there is ", - internal_to_numstr($commissions[CURRENCY], FIAT_PRECISION), " " . CURRENCY . " and ", - internal_to_numstr($commissions['BTC'], BTC_PRECISION), " BTC.\n"; -echo "Hopefully that matches with the totals shown above.

\n"; +printf("

" . _("In the commission purse, there is %s %s and %s %s.") . "\n", + internal_to_numstr($commissions[CURRENCY], FIAT_PRECISION), + CURRENCY, + internal_to_numstr($commissions['BTC'], BTC_PRECISION), + "BTC"); +echo _("Hopefully that matches with the totals shown above.") . "

\n"; ?>
BTC
TIDGotFeeGotFeeDate" . _("TID") . "" . _("Got") . "" . _("Fee") . "" . _("Got") . "" . _("Fee") . "" . _("Date") . "