1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-10-13 18:03:39 -04:00

Place all output strings within gettext invocations

This commit is contained in:
John Zaitseff 2011-08-16 21:03:41 +10:00
parent bf76fa312c
commit 6c1c272780
6 changed files with 312 additions and 298 deletions

View File

@ -95,9 +95,9 @@ void exchange_stock (void)
box(curwin, 0, 0); box(curwin, 0, 0);
center(curwin, 1, 0, attr_title, 0, 0, 1, center(curwin, 1, 0, attr_title, 0, 0, 1,
" Interstellar Stock Exchange "); _(" Interstellar Stock Exchange "));
center(curwin, 2, 0, attr_normal, attr_highlight, 0, 1, center(curwin, 2, 0, attr_normal, attr_highlight, 0, 1,
"Player: ^{%s^}", player[current_player].name); _("Player: ^{%s^}"), player[current_player].name);
all_off_map = true; all_off_map = true;
for (i = 0; i < MAX_COMPANIES; i++) { for (i = 0; i < MAX_COMPANIES; i++) {
@ -109,20 +109,20 @@ void exchange_stock (void)
if (all_off_map) { if (all_off_map) {
center(curwin, 8, 0, attr_normal, attr_highlight, 0, 1, center(curwin, 8, 0, attr_normal, attr_highlight, 0, 1,
"No companies on the map"); _("No companies on the map"));
} else { } else {
mvwhline(curwin, 4, 2, ' ' | attr_subtitle, w - 4); mvwhline(curwin, 4, 2, ' ' | attr_subtitle, w - 4);
mvwhline(curwin, 5, 2, ' ' | attr_subtitle, w - 4); mvwhline(curwin, 5, 2, ' ' | attr_subtitle, w - 4);
left(curwin, 4, 4, attr_subtitle, 0, 0, 2, "\nCompany"); left(curwin, 4, 4, attr_subtitle, 0, 0, 2, _("\nCompany"));
right(curwin, 4, w - 4, attr_subtitle, 0, 0, 2, "Shares\nleft"); right(curwin, 4, w - 4, attr_subtitle, 0, 0, 2, _("Shares\nleft"));
right(curwin, 4, w - 6 - STOCK_LEFT_COLS, attr_subtitle, 0, 0, right(curwin, 4, w - 6 - STOCK_LEFT_COLS, attr_subtitle, 0, 0,
2, "Shares\nissued"); 2, _("Shares\nissued"));
right(curwin, 4, w - 8 - STOCK_LEFT_COLS - STOCK_ISSUED_COLS, right(curwin, 4, w - 8 - STOCK_LEFT_COLS - STOCK_ISSUED_COLS,
attr_subtitle, 0, 0, 2, "Return\n(%%)"); attr_subtitle, 0, 0, 2, _("Return\n(%%)"));
right(curwin, 4, w - 10 - STOCK_LEFT_COLS - STOCK_ISSUED_COLS right(curwin, 4, w - 10 - STOCK_LEFT_COLS - STOCK_ISSUED_COLS
- SHARE_RETURN_COLS, attr_subtitle, 0, 0, 2, - SHARE_RETURN_COLS, attr_subtitle, 0, 0, 2,
"Price per\nshare (%s)", lconvinfo.currency_symbol); _("Price per\nshare (%s)"), lconvinfo.currency_symbol);
for (line = 6, i = 0; i < MAX_COMPANIES; i++) { for (line = 6, i = 0; i < MAX_COMPANIES; i++) {
if (company[i].on_map) { if (company[i].on_map) {
@ -154,16 +154,16 @@ void exchange_stock (void)
newtxwin(6, WIN_COLS, 18, WCENTER, true, attr_normal_window); newtxwin(6, WIN_COLS, 18, WCENTER, true, attr_normal_window);
left(curwin, 3, 2, attr_normal, attr_keycode, 0, 1, left(curwin, 3, 2, attr_normal, attr_keycode, 0, 1,
"^{<1>^} Display stock portfolio"); _("^{<1>^} Display stock portfolio"));
left(curwin, 4, 2, attr_normal, attr_keycode, 0, 1, left(curwin, 4, 2, attr_normal, attr_keycode, 0, 1,
"^{<2>^} Display galaxy map"); _("^{<2>^} Display galaxy map"));
left(curwin, 3, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1, left(curwin, 3, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1,
"^{<3>^} Visit the Trading Bank"); _("^{<3>^} Visit the Trading Bank"));
left(curwin, 4, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1, left(curwin, 4, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1,
"^{<4>^} Exit the Stock Exchange"); _("^{<4>^} Exit the Stock Exchange"));
center(curwin, 1, -1, attr_normal, attr_keycode, attr_highlight, 1, center(curwin, 1, -1, attr_normal, attr_keycode, attr_highlight, 1,
"Enter selection [^[Company letter^]/^{1^}-^{4^}]: "); _("Enter selection [^[Company letter^]/^{1^}-^{4^}]: "));
curs_set(CURS_ON); curs_set(CURS_ON);
wrefresh(curwin); wrefresh(curwin);
@ -263,25 +263,26 @@ void visit_bank (void)
// Show the informational part of the Bank // Show the informational part of the Bank
newtxwin(10, WIN_COLS - 4, 5, WCENTER, true, attr_normal_window); newtxwin(10, WIN_COLS - 4, 5, WCENTER, true, attr_normal_window);
center(curwin, 1, 0, attr_title, 0, 0, 1, " Interstellar Trading Bank "); center(curwin, 1, 0, attr_title, 0, 0, 1,
_(" Interstellar Trading Bank "));
mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin) - 4, &width, mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin) - 4, &width,
1, "Current cash: "); 1, _("Current cash: "));
x = (getmaxx(curwin) + width - (BANK_VALUE_COLS + 2)) / 2; x = (getmaxx(curwin) + width - (BANK_VALUE_COLS + 2)) / 2;
rightch(curwin, 3, x, chbuf, 1, &width); rightch(curwin, 3, x, chbuf, 1, &width);
right(curwin, 3, x + BANK_VALUE_COLS + 2, attr_normal, attr_highlight, 0, right(curwin, 3, x + BANK_VALUE_COLS + 2, attr_normal, attr_highlight, 0,
1, " ^{%N^} ", player[current_player].cash); 1, " ^{%N^} ", player[current_player].cash);
right(curwin, 4, x, attr_normal, 0, 0, 1, "Current debt: "); right(curwin, 4, x, attr_normal, 0, 0, 1, _("Current debt: "));
right(curwin, 4, x + BANK_VALUE_COLS + 2, attr_normal, attr_highlight, 0, right(curwin, 4, x + BANK_VALUE_COLS + 2, attr_normal, attr_highlight, 0,
1, " ^{%N^} ", player[current_player].debt); 1, " ^{%N^} ", player[current_player].debt);
right(curwin, 5, x, attr_normal, 0, 0, 1, "Interest rate: "); right(curwin, 5, x, attr_normal, 0, 0, 1, _("Interest rate: "));
right(curwin, 5, x + BANK_VALUE_COLS + 2, attr_normal, attr_highlight, 0, right(curwin, 5, x + BANK_VALUE_COLS + 2, attr_normal, attr_highlight, 0,
1, " ^{%.2f%%^} ", interest_rate * 100.0); 1, " ^{%.2f%%^} ", interest_rate * 100.0);
right(curwin, 7, x, attr_highlight, 0, 0, 1, "Credit limit: "); right(curwin, 7, x, attr_highlight, 0, 0, 1, _("Credit limit: "));
whline(curwin, ' ' | attr_title, BANK_VALUE_COLS + 2); whline(curwin, ' ' | attr_title, BANK_VALUE_COLS + 2);
right(curwin, 7, x + BANK_VALUE_COLS + 2, attr_title, 0, 0, 1, right(curwin, 7, x + BANK_VALUE_COLS + 2, attr_title, 0, 0, 1,
" %N ", credit_limit); " %N ", credit_limit);
@ -292,14 +293,14 @@ void visit_bank (void)
newtxwin(7, WIN_COLS - 4, 15, WCENTER, true, attr_normal_window); newtxwin(7, WIN_COLS - 4, 15, WCENTER, true, attr_normal_window);
center(curwin, 3, 0, attr_normal, attr_keycode, 0, 1, center(curwin, 3, 0, attr_normal, attr_keycode, 0, 1,
"^{<1>^} Borrow money "); _("^{<1>^} Borrow money "));
center(curwin, 4, 0, attr_normal, attr_keycode, 0, 1, center(curwin, 4, 0, attr_normal, attr_keycode, 0, 1,
"^{<2>^} Repay debt "); _("^{<2>^} Repay debt "));
center(curwin, 5, 0, attr_normal, attr_keycode, 0, 1, center(curwin, 5, 0, attr_normal, attr_keycode, 0, 1,
"^{<3>^} Exit from the Bank"); _("^{<3>^} Exit from the Bank"));
center(curwin, 1, 0, attr_normal, attr_keycode, 0, 1, center(curwin, 1, 0, attr_normal, attr_keycode, 0, 1,
"Enter selection [^{1^}-^{3^}]: "); _("Enter selection [^{1^}-^{3^}]: "));
curs_set(CURS_ON); curs_set(CURS_ON);
wrefresh(curwin); wrefresh(curwin);
@ -338,8 +339,8 @@ void visit_bank (void)
if (credit_limit == 0.0) { if (credit_limit == 0.0) {
txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, 0, 0, attr_error_title, attr_error_highlight, 0, 0,
attr_error_waitforkey, " Insufficient Credit Limit ", attr_error_waitforkey, _(" Insufficient Credit Limit "),
"The Bank will not lend you any more money."); _("The Bank will not lend you any more money."));
} else { } else {
chtype *chbuf_cursym; chtype *chbuf_cursym;
int width_cursym; int width_cursym;
@ -359,7 +360,7 @@ void visit_bank (void)
mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin) mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin)
- BANK_INPUT_COLS - width_cursym - 6, &width, 1, - BANK_INPUT_COLS - width_cursym - 6, &width, 1,
"How much do you wish to borrow? "); _("How much do you wish to borrow? "));
x = (getmaxx(curwin) + width - BANK_INPUT_COLS - width_cursym x = (getmaxx(curwin) + width - BANK_INPUT_COLS - width_cursym
- n) / 2; - n) / 2;
rightch(curwin, 3, x, chbuf, 1, &width); rightch(curwin, 3, x, chbuf, 1, &width);
@ -391,13 +392,13 @@ void visit_bank (void)
if (player[current_player].debt == 0.0) { if (player[current_player].debt == 0.0) {
txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, 0, 0, attr_error_title, attr_error_highlight, 0, 0,
attr_error_waitforkey, " No Debt ", attr_error_waitforkey, _(" No Debt "),
"You have no debt to repay."); _("You have no debt to repay."));
} else if (player[current_player].cash == 0.0) { } else if (player[current_player].cash == 0.0) {
txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, 0, 0, attr_error_title, attr_error_highlight, 0, 0,
attr_error_waitforkey, " No Cash ", attr_error_waitforkey, _(" No Cash "),
"You have no cash with which to repay the debt!"); _("You have no cash with which to repay the debt!"));
} else { } else {
chtype *chbuf_cursym; chtype *chbuf_cursym;
int width_cursym; int width_cursym;
@ -417,7 +418,7 @@ void visit_bank (void)
mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin) mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin)
- BANK_INPUT_COLS - width_cursym - 6, &width, 1, - BANK_INPUT_COLS - width_cursym - 6, &width, 1,
"How much do you wish to repay? "); _("How much do you wish to repay? "));
x = (getmaxx(curwin) + width - BANK_INPUT_COLS - width_cursym x = (getmaxx(curwin) + width - BANK_INPUT_COLS - width_cursym
- n) / 2; - n) / 2;
rightch(curwin, 3, x, chbuf, 1, &width); rightch(curwin, 3, x, chbuf, 1, &width);
@ -490,36 +491,36 @@ void trade_shares (int num, bool *bid_used)
newtxwin(9, WIN_COLS - 4, 5, WCENTER, true, attr_normal_window); newtxwin(9, WIN_COLS - 4, 5, WCENTER, true, attr_normal_window);
w = getmaxx(curwin); w = getmaxx(curwin);
center(curwin, 1, 0, attr_title, 0, 0, 1, " Stock Transaction in %s ", center(curwin, 1, 0, attr_title, 0, 0, 1, _(" Stock Transaction in %s "),
company[num].name); company[num].name);
mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, w / 2, &width, 1, mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, w / 2, &width, 1,
"Shares issued: "); _("Shares issued: "));
leftch(curwin, 3, 2, chbuf, 1, &width); leftch(curwin, 3, 2, chbuf, 1, &width);
right(curwin, 3, width + SHARE_PRICE_COLS + 2, attr_normal, attr_highlight, right(curwin, 3, width + SHARE_PRICE_COLS + 2, attr_normal, attr_highlight,
0, 1, "^{%'ld^}", company[num].stock_issued); 0, 1, "^{%'ld^}", company[num].stock_issued);
left(curwin, 4, 2, attr_normal, 0, 0, 1, "Shares left: "); left(curwin, 4, 2, attr_normal, 0, 0, 1, _("Shares left: "));
right(curwin, 4, width + SHARE_PRICE_COLS + 2, attr_normal, attr_highlight, right(curwin, 4, width + SHARE_PRICE_COLS + 2, attr_normal, attr_highlight,
0, 1, "^{%'ld^}", company[num].max_stock - company[num].stock_issued); 0, 1, "^{%'ld^}", company[num].max_stock - company[num].stock_issued);
left(curwin, 5, 2, attr_normal, 0, 0, 1, "Price per share: "); left(curwin, 5, 2, attr_normal, 0, 0, 1, _("Price per share: "));
right(curwin, 5, width + SHARE_PRICE_COLS + 2, attr_normal, attr_highlight, right(curwin, 5, width + SHARE_PRICE_COLS + 2, attr_normal, attr_highlight,
0, 1, "^{%N^}", company[num].share_price); 0, 1, "^{%N^}", company[num].share_price);
left(curwin, 6, 2, attr_normal, 0, 0, 1, "Return: "); left(curwin, 6, 2, attr_normal, 0, 0, 1, _("Return: "));
right(curwin, 6, width + SHARE_PRICE_COLS + 2, attr_normal, attr_highlight, right(curwin, 6, width + SHARE_PRICE_COLS + 2, attr_normal, attr_highlight,
0, 1, "^{%.2f%%^}", company[num].share_return * 100.0); 0, 1, "^{%.2f%%^}", company[num].share_return * 100.0);
left(curwin, 3, w / 2, attr_normal, 0, 0, 1, "Current holdings: "); left(curwin, 3, w / 2, attr_normal, 0, 0, 1, _("Current holdings: "));
right(curwin, 3, w - 2, attr_normal, attr_highlight, 0, 1, " ^{%'ld^} ", right(curwin, 3, w - 2, attr_normal, attr_highlight, 0, 1, " ^{%'ld^} ",
player[current_player].stock_owned[num]); player[current_player].stock_owned[num]);
left(curwin, 4, w / 2, attr_normal, 0, 0, 1, "Percentage owned: "); left(curwin, 4, w / 2, attr_normal, 0, 0, 1, _("Percentage owned: "));
right(curwin, 4, w - 2, attr_normal, attr_highlight, 0, 1, " ^{%.2f%%^} ", right(curwin, 4, w - 2, attr_normal, attr_highlight, 0, 1, " ^{%.2f%%^} ",
ownership * 100.0); ownership * 100.0);
left(curwin, 6, w / 2, attr_highlight, 0, 0, 1, "Current cash: "); left(curwin, 6, w / 2, attr_highlight, 0, 0, 1, _("Current cash: "));
whline(curwin, ' ' | attr_title, TRADE_VALUE_COLS + 2); whline(curwin, ' ' | attr_title, TRADE_VALUE_COLS + 2);
right(curwin, 6, w - 2, attr_title, 0, 0, 1, " %N ", right(curwin, 6, w - 2, attr_title, 0, 0, 1, " %N ",
player[current_player].cash); player[current_player].cash);
@ -530,16 +531,16 @@ void trade_shares (int num, bool *bid_used)
newtxwin(7, WIN_COLS - 4, 14, WCENTER, true, attr_normal_window); newtxwin(7, WIN_COLS - 4, 14, WCENTER, true, attr_normal_window);
left(curwin, 3, 2, attr_normal, attr_keycode, 0, 1, left(curwin, 3, 2, attr_normal, attr_keycode, 0, 1,
"^{<1>^} Buy stock from company"); _("^{<1>^} Buy stock from company"));
left(curwin, 4, 2, attr_normal, attr_keycode, 0, 1, left(curwin, 4, 2, attr_normal, attr_keycode, 0, 1,
"^{<2>^} Sell stock back to company"); _("^{<2>^} Sell stock back to company"));
left(curwin, 3, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1, left(curwin, 3, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1,
"^{<3>^} Bid company to issue more shares"); _("^{<3>^} Bid company to issue more shares"));
left(curwin, 4, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1, left(curwin, 4, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1,
"^{<4>^} Exit to the Stock Exchange"); _("^{<4>^} Exit to the Stock Exchange"));
center(curwin, 1, 0, attr_normal, attr_keycode, 0, 1, center(curwin, 1, 0, attr_normal, attr_keycode, 0, 1,
"Enter selection [^{1^}-^{4^}]: "); _("Enter selection [^{1^}-^{4^}]: "));
curs_set(CURS_ON); curs_set(CURS_ON);
wrefresh(curwin); wrefresh(curwin);
@ -581,14 +582,14 @@ void trade_shares (int num, bool *bid_used)
if (company[num].max_stock - company[num].stock_issued == 0) { if (company[num].max_stock - company[num].stock_issued == 0) {
txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, 0, 0, attr_error_title, attr_error_highlight, 0, 0,
attr_error_waitforkey, " No Shares Available ", attr_error_waitforkey, _(" No Shares Available "),
"No more shares are available for purchase."); _("No more shares are available for purchase."));
} else if (maxshares <= 0) { } else if (maxshares <= 0) {
txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, 0, 0, attr_error_title, attr_error_highlight, 0, 0,
attr_error_waitforkey, " Insufficient Cash ", attr_error_waitforkey, _(" Insufficient Cash "),
"You do not have enough cash\n" _("You do not have enough cash\n"
"to purchase additional shares."); "to purchase additional shares."));
} else { } else {
maxshares = MIN(maxshares, company[num].max_stock - maxshares = MIN(maxshares, company[num].max_stock -
company[num].stock_issued); company[num].stock_issued);
@ -598,11 +599,11 @@ void trade_shares (int num, bool *bid_used)
box(curwin, 0, 0); box(curwin, 0, 0);
center(curwin, 2, 0, attr_normal, attr_highlight, 0, 1, center(curwin, 2, 0, attr_normal, attr_highlight, 0, 1,
"You can purchase up to ^{%'ld^} shares.", maxshares); _("You can purchase up to ^{%'ld^} shares."), maxshares);
mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin) mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1,
- TRADE_INPUT_COLS - 4, &width, 1, getmaxx(curwin) - TRADE_INPUT_COLS - 4, &width, 1,
"How many shares do you wish to purchase? "); _("How many shares do you wish to purchase? "));
x = (getmaxx(curwin) + width - TRADE_INPUT_COLS) / 2; x = (getmaxx(curwin) + width - TRADE_INPUT_COLS) / 2;
rightch(curwin, 4, x, chbuf, 1, &width); rightch(curwin, 4, x, chbuf, 1, &width);
@ -623,19 +624,19 @@ void trade_shares (int num, bool *bid_used)
if (maxshares == 0) { if (maxshares == 0) {
txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, 0, 0, attr_error_title, attr_error_highlight, 0, 0,
attr_error_waitforkey, " No Shares ", attr_error_waitforkey, _(" No Shares "),
"You do not have any shares to sell."); _("You do not have any shares to sell."));
} else { } else {
wbkgdset(curwin, attr_normal_window); wbkgdset(curwin, attr_normal_window);
werase(curwin); werase(curwin);
box(curwin, 0, 0); box(curwin, 0, 0);
center(curwin, 2, 0, attr_normal, attr_highlight, 0, 1, center(curwin, 2, 0, attr_normal, attr_highlight, 0, 1,
"You can sell up to ^{%'ld^} shares.", maxshares); _("You can sell up to ^{%'ld^} shares."), maxshares);
mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin) mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1,
- TRADE_INPUT_COLS - 4, &width, 1, getmaxx(curwin) - TRADE_INPUT_COLS - 4, &width, 1,
"How many shares do you wish to sell? "); _("How many shares do you wish to sell? "));
x = (getmaxx(curwin) + width - TRADE_INPUT_COLS) / 2; x = (getmaxx(curwin) + width - TRADE_INPUT_COLS) / 2;
rightch(curwin, 4, x, chbuf, 1, &width); rightch(curwin, 4, x, chbuf, 1, &width);
@ -663,14 +664,14 @@ void trade_shares (int num, bool *bid_used)
if (maxshares == 0) { if (maxshares == 0) {
txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, 0, 0, attr_error_title, attr_error_highlight, 0, 0,
attr_error_waitforkey, " No Shares Issued ", attr_error_waitforkey, _(" No Shares Issued "),
"%s has refused\nto issue more shares.", _("%s has refused\nto issue more shares."),
company[num].name); company[num].name);
} else { } else {
txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_normal_window, txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_normal_window,
attr_title, attr_normal, attr_highlight, 0, attr_title, attr_normal, attr_highlight, 0,
attr_waitforkey, " Shares Issued ", attr_waitforkey, _(" Shares Issued "),
"%s has issued\n^{%'ld^} more shares.", _("%s has issued\n^{%'ld^} more shares."),
company[num].name, maxshares); company[num].name, maxshares);
} }
break; break;

View File

@ -231,17 +231,18 @@ bool load_game (int num)
// File not found // File not found
txdlgbox(MAX_DLG_LINES, 50, 9, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 50, 9, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, 0, 0, attr_error_title, attr_error_highlight, 0, 0,
attr_error_waitforkey, " Game Not Found ", attr_error_waitforkey, _(" Game Not Found "),
"Game %d has not been saved to disk.", num); _("Game %d has not been saved to disk."), num);
} else { } else {
// Some other file error // Some other file error
saved_errno = errno; saved_errno = errno;
txdlgbox(MAX_DLG_LINES, 60, 9, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 60, 9, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, attr_error_title, attr_error_highlight,
attr_error_normal, 0, attr_error_waitforkey, attr_error_normal, 0, attr_error_waitforkey,
" Game Not Loaded ", _(" Game Not Loaded "),
"Game %d could not be loaded from disk.\n\n" _("Game %d could not be loaded from disk.\n\n"
"^{File %s: %s^}", num, filename, strerror(saved_errno)); "^{File %s: %s^}"), num, filename,
strerror(saved_errno));
} }
free(buf); free(buf);
@ -430,9 +431,9 @@ bool save_game (int num)
txdlgbox(MAX_DLG_LINES, 60, 7, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 60, 7, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, attr_error_title, attr_error_highlight,
attr_error_normal, 0, attr_error_waitforkey, attr_error_normal, 0, attr_error_waitforkey,
" Game Not Saved ", _(" Game Not Saved "),
"Game %d could not be saved to disk.\n\n" _("Game %d could not be saved to disk.\n\n"
"^{Directory %s: %s^}", num, data_dir, "^{Directory %s: %s^}"), num, data_dir,
strerror(saved_errno)); strerror(saved_errno));
free(buf); free(buf);
@ -451,9 +452,9 @@ bool save_game (int num)
txdlgbox(MAX_DLG_LINES, 60, 7, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 60, 7, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, attr_error_title, attr_error_highlight,
attr_error_normal, 0, attr_error_waitforkey, attr_error_normal, 0, attr_error_waitforkey,
" Game Not Saved ", _(" Game Not Saved "),
"Game %d could not be saved to disk.\n\n" _("Game %d could not be saved to disk.\n\n"
"^{File %s: %s^}", num, filename, strerror(saved_errno)); "^{File %s: %s^}"), num, filename, strerror(saved_errno));
free(buf); free(buf);
free(filename); free(filename);

View File

@ -114,7 +114,7 @@ void init_game (void)
int width; int width;
mkchstr(chbuf, BUFSIZE, attr_status_window, 0, 0, 1, WIN_COLS - 7, mkchstr(chbuf, BUFSIZE, attr_status_window, 0, 0, 1, WIN_COLS - 7,
&width, 1, "Loading game %d... ", game_num); &width, 1, _("Loading game %d... "), game_num);
newtxwin(5, width + 5, 6, WCENTER, true, attr_status_window); newtxwin(5, width + 5, 6, WCENTER, true, attr_status_window);
centerch(curwin, 2, 0, chbuf, 1, &width); centerch(curwin, 2, 0, chbuf, 1, &width);
wrefresh(curwin); wrefresh(curwin);
@ -149,7 +149,7 @@ void init_game (void)
mkchstr(chbuf, BUFSIZE, attr_status_window, 0, 0, 1, mkchstr(chbuf, BUFSIZE, attr_status_window, 0, 0, 1,
WIN_COLS - 7, &width, 1, WIN_COLS - 7, &width, 1,
"Loading game %d... ", game_num); _("Loading game %d... "), game_num);
newtxwin(5, width + 5, 9, WCENTER, true, attr_status_window); newtxwin(5, width + 5, 9, WCENTER, true, attr_status_window);
centerch(curwin, 2, 0, chbuf, 1, &width); centerch(curwin, 2, 0, chbuf, 1, &width);
wrefresh(curwin); wrefresh(curwin);
@ -171,26 +171,24 @@ void init_game (void)
} }
if (! game_loaded) { if (! game_loaded) {
int i, j, x, y;
ask_player_names(); ask_player_names();
deltxwin(); // "Number of players" window deltxwin(); // "Number of players" window
txrefresh(); txrefresh();
// Initialise player data (other than names) // Initialise player data (other than names)
for (i = 0; i < number_players; i++) { for (int i = 0; i < number_players; i++) {
player[i].cash = INITIAL_CASH; player[i].cash = INITIAL_CASH;
player[i].debt = 0.0; player[i].debt = 0.0;
player[i].in_game = true; player[i].in_game = true;
for (j = 0; j < MAX_COMPANIES; j++) { for (int j = 0; j < MAX_COMPANIES; j++) {
player[i].stock_owned[j] = 0; player[i].stock_owned[j] = 0;
} }
} }
// Initialise company data // Initialise company data
for (i = 0; i < MAX_COMPANIES; i++) { for (int i = 0; i < MAX_COMPANIES; i++) {
company[i].name = xstrdup(gettext(company_name[i])); company[i].name = xstrdup(gettext(company_name[i]));
company[i].share_price = 0.0; company[i].share_price = 0.0;
company[i].share_return = INITIAL_RETURN; company[i].share_return = INITIAL_RETURN;
@ -200,8 +198,8 @@ void init_game (void)
} }
// Initialise galaxy map // Initialise galaxy map
for (x = 0; x < MAX_X; x++) { for (int x = 0; x < MAX_X; x++) {
for (y = 0; y < MAX_Y; y++) { for (int y = 0; y < MAX_Y; y++) {
galaxy_map[x][y] = (randf() < STAR_RATIO) ? galaxy_map[x][y] = (randf() < STAR_RATIO) ?
MAP_STAR : MAP_EMPTY; MAP_STAR : MAP_EMPTY;
} }
@ -222,8 +220,8 @@ void init_game (void)
txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_normal_window, txdlgbox(MAX_DLG_LINES, 50, 8, WCENTER, attr_normal_window,
attr_title, attr_normal, attr_highlight, 0, attr_title, attr_normal, attr_highlight, 0,
attr_waitforkey, " First Player ", attr_waitforkey, _(" First Player "),
"The first player to go is ^{%s^}.", _("The first player to go is ^{%s^}."),
player[first_player].name); player[first_player].name);
txrefresh(); txrefresh();
} }
@ -248,11 +246,12 @@ static int ask_number_players (void)
chbuf = xmalloc(BUFSIZE * sizeof(chtype)); chbuf = xmalloc(BUFSIZE * sizeof(chtype));
lines = mkchstr(chbuf, BUFSIZE, attr_normal, attr_keycode, 0, 2, WIN_COLS lines = mkchstr(chbuf, BUFSIZE, attr_normal, attr_keycode, 0, 2,
- 7, widthbuf, 2, "Enter number of players [^{1^}-^{%d^}] " WIN_COLS - 7, widthbuf, 2,
"or ^{<C>^} to continue a game: ", MAX_PLAYERS); _("Enter number of players [^{1^}-^{%d^}] "
"or ^{<C>^} to continue a game: "), MAX_PLAYERS);
assert(lines == 1 || lines == 2); assert(lines == 1 || lines == 2);
maxwidth = ((lines == 1) ? widthbuf[0] : MAX(widthbuf[0], widthbuf[1])) + 5; maxwidth = (lines == 1 ? widthbuf[0] : MAX(widthbuf[0], widthbuf[1])) + 5;
newtxwin(lines + 4, maxwidth, 3, WCENTER, true, attr_normal_window); newtxwin(lines + 4, maxwidth, 3, WCENTER, true, attr_normal_window);
leftch(curwin, 2, 2, chbuf, lines, widthbuf); leftch(curwin, 2, 2, chbuf, lines, widthbuf);
@ -311,11 +310,12 @@ int ask_game_number (void)
chbuf = xmalloc(BUFSIZE * sizeof(chtype)); chbuf = xmalloc(BUFSIZE * sizeof(chtype));
lines = mkchstr(chbuf, BUFSIZE, attr_normal, attr_keycode, 0, 2, WIN_COLS lines = mkchstr(chbuf, BUFSIZE, attr_normal, attr_keycode, 0, 2,
- 7, widthbuf, 2, "Enter game number [^{1^}-^{9^}] " WIN_COLS - 7, widthbuf, 2,
"or ^{<CTRL><C>^} to cancel: "); _("Enter game number [^{1^}-^{9^}] "
"or ^{<CTRL><C>^} to cancel: "));
assert(lines == 1 || lines == 2); assert(lines == 1 || lines == 2);
maxwidth = ((lines == 1) ? widthbuf[0] : MAX(widthbuf[0], widthbuf[1])) + 5; maxwidth = (lines == 1 ? widthbuf[0] : MAX(widthbuf[0], widthbuf[1])) + 5;
newtxwin(lines + 4, maxwidth, 6, WCENTER, true, attr_normal_window); newtxwin(lines + 4, maxwidth, 6, WCENTER, true, attr_normal_window);
leftch(curwin, 2, 2, chbuf, lines, widthbuf); leftch(curwin, 2, 2, chbuf, lines, widthbuf);
@ -368,7 +368,7 @@ void ask_player_names (void)
// Ask for the player's name // Ask for the player's name
newtxwin(5, WIN_COLS - 4, 9, WCENTER, true, attr_normal_window); newtxwin(5, WIN_COLS - 4, 9, WCENTER, true, attr_normal_window);
left(curwin, 2, 2, attr_normal, 0, 0, 1, "Please enter your name: "); left(curwin, 2, 2, attr_normal, 0, 0, 1, _("Please enter your name: "));
int x = getcurx(curwin); int x = getcurx(curwin);
int w = getmaxx(curwin) - x - 2; int w = getmaxx(curwin) - x - 2;
@ -386,7 +386,7 @@ void ask_player_names (void)
mkchstr(chbuf, BUFSIZE, attr_normal, attr_keycode, 0, 1, mkchstr(chbuf, BUFSIZE, attr_normal, attr_keycode, 0, 1,
WIN_COLS - YESNO_COLS - 6, &width, 1, WIN_COLS - YESNO_COLS - 6, &width, 1,
"Do you need any instructions? [^{Y^}/^{N^}] "); _("Do you need any instructions? [^{Y^}/^{N^}] "));
newtxwin(5, width + YESNO_COLS + 4, 6, WCENTER, true, newtxwin(5, width + YESNO_COLS + 4, 6, WCENTER, true,
attr_normal_window); attr_normal_window);
leftch(curwin, 2, 2, chbuf, 1, &width); leftch(curwin, 2, 2, chbuf, 1, &width);
@ -404,12 +404,13 @@ void ask_player_names (void)
newtxwin(number_players + 5, WIN_COLS - 4, 9, WCENTER, newtxwin(number_players + 5, WIN_COLS - 4, 9, WCENTER,
true, attr_normal_window); true, attr_normal_window);
center(curwin, 1, 0, attr_title, 0, 0, 1, " Enter Player Names "); center(curwin, 1, 0, attr_title, 0, 0, 1, _(" Enter Player Names "));
for (i = 0; i < number_players; i++) { for (i = 0; i < number_players; i++) {
player[i].name = NULL; player[i].name = NULL;
entered[i] = false; entered[i] = false;
left(curwin, i + 3, 2, attr_normal, 0, 0, 1, "Player %d:", i + 1); left(curwin, i + 3, 2, attr_normal, 0, 0, 1,
_("Player %d:"), i + 1);
} }
int x = getcurx(curwin) + 1; int x = getcurx(curwin) + 1;
@ -487,7 +488,7 @@ void ask_player_names (void)
mkchstr(chbuf, BUFSIZE, attr_normal, attr_keycode, 0, 1, mkchstr(chbuf, BUFSIZE, attr_normal, attr_keycode, 0, 1,
WIN_COLS - YESNO_COLS - 6, &width, 1, WIN_COLS - YESNO_COLS - 6, &width, 1,
"Does any player need instructions? [^{Y^}/^{N^}] "); _("Does any player need instructions? [^{Y^}/^{N^}] "));
newtxwin(5, width + YESNO_COLS + 4, 6, WCENTER, true, newtxwin(5, width + YESNO_COLS + 4, 6, WCENTER, true,
attr_normal_window); attr_normal_window);
leftch(curwin, 2, 2, chbuf, 1, &width); leftch(curwin, 2, 2, chbuf, 1, &width);
@ -509,8 +510,7 @@ void ask_player_names (void)
void end_game (void) void end_game (void)
{ {
chtype *chbuf; chtype *chbuf;
int lines; int lines, widthbuf[5];
int widthbuf[5];
if (abort_game) { if (abort_game) {
@ -522,8 +522,8 @@ void end_game (void)
txdlgbox(MAX_DLG_LINES, 50, 9, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 50, 9, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, 0, 0, attr_error_title, attr_error_highlight, 0, 0,
attr_error_waitforkey, " Game Over ", attr_error_waitforkey, _(" Game Over "),
"The game is over after %d turns.", turn_number - 1); _("The game is over after %d turns."), turn_number - 1);
for (int i = 0; i < number_players; i++) { for (int i = 0; i < number_players; i++) {
show_status(i); show_status(i);
@ -532,7 +532,7 @@ void end_game (void)
if (number_players == 1) { if (number_players == 1) {
txdlgbox(MAX_DLG_LINES, 60, 8, WCENTER, attr_normal_window, txdlgbox(MAX_DLG_LINES, 60, 8, WCENTER, attr_normal_window,
attr_title, attr_normal, attr_highlight, 0, attr_waitforkey, attr_title, attr_normal, attr_highlight, 0, attr_waitforkey,
" Total Value ", "Your total value was ^{%N^}.", _(" Total Value "), _("Your total value was ^{%N^}."),
total_value(0)); total_value(0));
} else { } else {
// Sort players on the basis of total value // Sort players on the basis of total value
@ -541,33 +541,35 @@ void end_game (void)
} }
qsort(player, number_players, sizeof(player_info_t), cmp_player); qsort(player, number_players, sizeof(player_info_t), cmp_player);
lines = mkchstr(chbuf, BUFSIZE, attr_normal, attr_highlight, attr_blink, lines = mkchstr(chbuf, BUFSIZE, attr_normal, attr_highlight,
5, WIN_COLS - 8, widthbuf, 5, (player[0].sort_value == 0) ? attr_blink, 5, WIN_COLS - 8, widthbuf, 5,
"The winner is ^{%s^}\n" (player[0].sort_value == 0) ?
"who is ^[*** BANKRUPT ***^]" : _("The winner is ^{%s^}\n"
"The winner is ^{%s^}\n" "who is ^[*** BANKRUPT ***^]") :
"with a value of ^{%N^}.", player[0].name, _("The winner is ^{%s^}\n"
player[0].sort_value); "with a value of ^{%N^}."),
player[0].name, player[0].sort_value);
newtxwin(number_players + lines + 8, WIN_COLS - 4, 3, WCENTER, newtxwin(number_players + lines + 8, WIN_COLS - 4, 3, WCENTER,
true, attr_normal_window); true, attr_normal_window);
center(curwin, 1, 0, attr_title, 0, 0, 1, " Game Winner "); center(curwin, 1, 0, attr_title, 0, 0, 1, _(" Game Winner "));
centerch(curwin, 3, 0, chbuf, lines, widthbuf); centerch(curwin, 3, 0, chbuf, lines, widthbuf);
mvwhline(curwin, lines + 4, 2, ' ' | attr_subtitle, int w = getmaxx(curwin);
getmaxx(curwin) - 4);
mvwhline(curwin, lines + 4, 2, ' ' | attr_subtitle, w - 4);
left(curwin, lines + 4, ORDINAL_COLS + 4, attr_subtitle, 0, 0, 1, left(curwin, lines + 4, ORDINAL_COLS + 4, attr_subtitle, 0, 0, 1,
"Player"); _("Player"));
right(curwin, lines + 4, getmaxx(curwin) - 4, attr_subtitle, 0, 0, 1, right(curwin, lines + 4, w - 4, attr_subtitle, 0, 0, 1,
"Total Value (%s)", lconvinfo.currency_symbol); _("Total Value (%s)"), lconvinfo.currency_symbol);
for (int i = 0; i < number_players; i++) { for (int i = 0; i < number_players; i++) {
right(curwin, i + lines + 5, ORDINAL_COLS + 2, attr_normal, 0, 0, right(curwin, i + lines + 5, ORDINAL_COLS + 2, attr_normal, 0, 0,
1, gettext(ordinal[i + 1])); 1, gettext(ordinal[i + 1]));
left(curwin, i + lines + 5, ORDINAL_COLS + 4, attr_normal, 0, 0, left(curwin, i + lines + 5, ORDINAL_COLS + 4, attr_normal, 0, 0,
1, "%s", player[i].name); 1, "%s", player[i].name);
right(curwin, i + lines + 5, getmaxx(curwin) - 2, attr_normal, 0, right(curwin, i + lines + 5, w - 2, attr_normal, 0, 0,
0, 1, " %!N ", player[i].sort_value); 1, " %!N ", player[i].sort_value);
} }
wait_for_key(curwin, getmaxy(curwin) - 2, attr_waitforkey); wait_for_key(curwin, getmaxy(curwin) - 2, attr_waitforkey);
@ -583,9 +585,6 @@ void end_game (void)
void show_map (bool closewin) void show_map (bool closewin)
{ {
int x, y;
newtxwin(MAX_Y + 4, WIN_COLS, 1, WCENTER, true, attr_map_window); newtxwin(MAX_Y + 4, WIN_COLS, 1, WCENTER, true, attr_map_window);
// Draw various borders and highlights // Draw various borders and highlights
@ -596,16 +595,16 @@ void show_map (bool closewin)
// Display current player and turn number // Display current player and turn number
left(curwin, 1, 2, attr_mapwin_title, attr_mapwin_highlight, 0, 1, left(curwin, 1, 2, attr_mapwin_title, attr_mapwin_highlight, 0, 1,
" Player: ^{%s^} ", player[current_player].name); _(" Player: ^{%s^} "), player[current_player].name);
right(curwin, 1, getmaxx(curwin) - 2, attr_mapwin_title, right(curwin, 1, getmaxx(curwin) - 2, attr_mapwin_title,
attr_mapwin_highlight, attr_mapwin_blink, 1, attr_mapwin_highlight, attr_mapwin_blink, 1,
(turn_number != max_turn) ? " Turn: ^{%d^} " : (turn_number != max_turn) ? _(" Turn: ^{%d^} ") :
" ^[*** Last Turn ***^] ", turn_number); _(" ^[*** Last Turn ***^] "), turn_number);
// Display the actual map // Display the actual map
for (y = 0; y < MAX_Y; y++) { for (int y = 0; y < MAX_Y; y++) {
wmove(curwin, y + 3, 2); wmove(curwin, y + 3, 2);
for (x = 0; x < MAX_X; x++) { for (int x = 0; x < MAX_X; x++) {
map_val_t m = galaxy_map[x][y]; map_val_t m = galaxy_map[x][y];
switch (m) { switch (m) {
@ -659,14 +658,14 @@ void show_status (int num)
newtxwin(MAX_COMPANIES + 15, WIN_COLS, 1, WCENTER, true, newtxwin(MAX_COMPANIES + 15, WIN_COLS, 1, WCENTER, true,
attr_normal_window); attr_normal_window);
center(curwin, 1, 0, attr_title, 0, 0, 1, " Stock Portfolio "); center(curwin, 1, 0, attr_title, 0, 0, 1, _(" Stock Portfolio "));
center(curwin, 2, 0, attr_normal, attr_highlight, 0, 1, "Player: ^{%s^}", center(curwin, 2, 0, attr_normal, attr_highlight, 0, 1,
player[num].name); _("Player: ^{%s^}"), player[num].name);
val = total_value(num); val = total_value(num);
if (val == 0.0) { if (val == 0.0) {
center(curwin, 11, 0, attr_normal, attr_highlight, attr_blink, 1, center(curwin, 11, 0, attr_normal, attr_highlight, attr_blink, 1,
"^[* * * B A N K R U P T * * *^]"); _("^[* * * B A N K R U P T * * *^]"));
} else { } else {
w = getmaxx(curwin); w = getmaxx(curwin);
@ -681,20 +680,22 @@ void show_status (int num)
if (none) { if (none) {
center(curwin, 8, 0, attr_normal, attr_highlight, 0, 1, center(curwin, 8, 0, attr_normal, attr_highlight, 0, 1,
"No companies on the map"); _("No companies on the map"));
} else { } else {
mvwhline(curwin, 4, 2, ' ' | attr_subtitle, w - 4); mvwhline(curwin, 4, 2, ' ' | attr_subtitle, w - 4);
mvwhline(curwin, 5, 2, ' ' | attr_subtitle, w - 4); mvwhline(curwin, 5, 2, ' ' | attr_subtitle, w - 4);
left(curwin, 4, 4, attr_subtitle, 0, 0, 2, "\nCompany"); left(curwin, 4, 4, attr_subtitle, 0, 0, 2,
right(curwin, 4, w - 4, attr_subtitle, 0, 0, 2, "Ownership\n(%%)"); _("\nCompany"));
right(curwin, 4, w - 6 - OWNERSHIP_COLS, attr_subtitle, 0, 0, right(curwin, 4, w - 4, attr_subtitle, 0, 0, 2,
2, "Holdings\n(shares)"); _("Ownership\n(%%)"));
right(curwin, 4, w - 6 - OWNERSHIP_COLS, attr_subtitle, 0, 0, 2,
_("Holdings\n(shares)"));
right(curwin, 4, w - 8 - OWNERSHIP_COLS - STOCK_OWNED_COLS, right(curwin, 4, w - 8 - OWNERSHIP_COLS - STOCK_OWNED_COLS,
attr_subtitle, 0, 0, 2, "Return\n(%%)"); attr_subtitle, 0, 0, 2, _("Return\n(%%)"));
right(curwin, 4, w - 10 - OWNERSHIP_COLS - STOCK_OWNED_COLS right(curwin, 4, w - 10 - OWNERSHIP_COLS - STOCK_OWNED_COLS
- SHARE_RETURN_COLS, attr_subtitle, 0, 0, 2, - SHARE_RETURN_COLS, attr_subtitle, 0, 0, 2,
"Price per\nshare (%s)", lconvinfo.currency_symbol); _("Price per\nshare (%s)"), lconvinfo.currency_symbol);
for (line = 6, i = 0; i < MAX_COMPANIES; i++) { for (line = 6, i = 0; i < MAX_COMPANIES; i++) {
if (company[i].on_map) { if (company[i].on_map) {
@ -725,24 +726,24 @@ void show_status (int num)
int width, x; int width, x;
mkchstr(chbuf, BUFSIZE, attr_highlight, 0, 0, 1, w / 2, &width, 1, mkchstr(chbuf, BUFSIZE, attr_highlight, 0, 0, 1, w / 2, &width, 1,
"Total value: "); _("Total value: "));
x = (w + width - (TOTAL_VALUE_COLS + 2)) / 2; x = (w + width - (TOTAL_VALUE_COLS + 2)) / 2;
right(curwin, line, x, attr_normal, attr_highlight, 0, 1, right(curwin, line, x, attr_normal, attr_highlight, 0, 1,
"Current cash: "); _("Current cash: "));
right(curwin, line, x + TOTAL_VALUE_COLS + 2, attr_normal, right(curwin, line, x + TOTAL_VALUE_COLS + 2, attr_normal,
attr_highlight, 0, 1, " ^{%N^} ", player[num].cash); attr_highlight, 0, 1, " ^{%N^} ", player[num].cash);
line++; line++;
if (player[num].debt != 0.0) { if (player[num].debt != 0.0) {
right(curwin, line, x, attr_normal, attr_highlight, 0, 1, right(curwin, line, x, attr_normal, attr_highlight, 0, 1,
"Current debt: "); _("Current debt: "));
right(curwin, line, x + TOTAL_VALUE_COLS + 2, attr_normal, right(curwin, line, x + TOTAL_VALUE_COLS + 2, attr_normal,
attr_highlight, 0, 1, " ^{%N^} ", player[num].debt); attr_highlight, 0, 1, " ^{%N^} ", player[num].debt);
line++; line++;
right(curwin, line, x, attr_normal, attr_highlight, 0, 1, right(curwin, line, x, attr_normal, attr_highlight, 0, 1,
"Interest rate: "); _("Interest rate: "));
right(curwin, line, x + TOTAL_VALUE_COLS + 2, attr_normal, right(curwin, line, x + TOTAL_VALUE_COLS + 2, attr_normal,
attr_highlight, 0, 1, " ^{%.2f%%^} ", interest_rate * 100.0); attr_highlight, 0, 1, " ^{%.2f%%^} ", interest_rate * 100.0);
line++; line++;
@ -768,13 +769,12 @@ void show_status (int num)
double total_value (int num) double total_value (int num)
{ {
double val; double val;
int i;
assert(num >= 0 && num < number_players); assert(num >= 0 && num < number_players);
val = player[num].cash - player[num].debt; val = player[num].cash - player[num].debt;
for (i = 0; i < MAX_COMPANIES; i++) { for (int i = 0; i < MAX_COMPANIES; i++) {
if (company[i].on_map) { if (company[i].on_map) {
val += player[num].stock_owned[i] * company[i].share_price; val += player[num].stock_owned[i] * company[i].share_price;
} }

View File

@ -36,110 +36,116 @@
************************************************************************/ ************************************************************************/
static const char *help_text[] = { static const char *help_text[] = {
"^BStar Traders^N is a simple game of interstellar trading. The object of the\n" N_(""
"game is to amass the greatest amount of wealth possible. This is done by\n" "^BStar Traders^N is a simple game of interstellar trading. The object of the\n"
"creating interstellar shipping lanes, expanding them and buying shares in\n" "game is to amass the greatest amount of wealth possible. This is done by\n"
"the companies controlling them. Shares appreciate in value as company\n" "creating interstellar shipping lanes, expanding them and buying shares in\n"
"operations expand. In addition, the return on each share (as a percentage)\n" "the companies controlling them. Shares appreciate in value as company\n"
"also changes. Players may also borrow from the Interstellar Trading Bank to\n" "operations expand. In addition, the return on each share (as a percentage)\n"
"finance additional purchases on the Stock Exchange.\n" "also changes. Players may also borrow from the Interstellar Trading Bank to\n"
"\n" "finance additional purchases on the Stock Exchange.\n"
"The map of the galaxy is represented by a ^B~x^N x ^B~y^N grid. A typical section\n" "\n"
"of it may be:\n" "The map of the galaxy is represented by a ^B~x^N x ^B~y^N grid. A typical section\n"
"\n" "of it may be:\n"
" ^e . . ^s*^e . . . ^s*^e ^s*^e . ^N\n" "\n"
" ^e . . . . . . . . . ^N ^e . ^N represents ^Bempty space^N,\n" " ^e . . ^s*^e . . . ^s*^e ^s*^e . ^N\n"
" ^e . ^s*^e . . . . . . . ^N ^s * ^N represents a ^Bstar^N.\n" " ^e . . . . . . . . . ^N ^e . ^N represents ^Bempty space^N,\n"
" ^e . . . . . . . ^s*^e . ^N\n" " ^e . ^s*^e . . . . . . . ^N ^s * ^N represents a ^Bstar^N.\n"
" ^e . . . . ^s*^e . . . . ^N\n" " ^e . . . . . . . ^s*^e . ^N\n"
, " ^e . . . . ^s*^e . . . . ^N\n"
""),
"The computer selects ^B~m^N moves (labeled ^k~1^N to ^k~M^N) at random, and places these\n" N_(""
"on the map. To select any of the highlighted positions, press that letter.\n" "The computer selects ^B~m^N moves (labeled ^k~1^N to ^k~M^N) at random, and places these\n"
"As an example, some of the moves on the map may be:\n" "on the map. To select any of the highlighted positions, press that letter.\n"
"\n" "As an example, some of the moves on the map may be:\n"
"\n" "\n"
" ^e ^k~1^e . ^s*^e . . . ^s*^e ^s*^e . ^N\n" "\n"
" ^e . . . ^k~3^e . . . . . ^N\n" " ^e ^k~1^e . ^s*^e . . . ^s*^e ^s*^e . ^N\n"
" ^e . ^s*^e . . . . ^k~5^e . . ^N Moves ^k~1^N to ^k~5^N shown.\n" " ^e . . . ^k~3^e . . . . . ^N\n"
" ^e . ^k~2^e . . ^k~4^e . . ^s*^e . ^N\n" " ^e . ^s*^e . . . . ^k~5^e . . ^N Moves ^k~1^N to ^k~5^N shown.\n"
" ^e . . . . ^s*^e . . . . ^N\n" " ^e . ^k~2^e . . ^k~4^e . . ^s*^e . ^N\n"
"\n" " ^e . . . . ^s*^e . . . . ^N\n"
"\n" "\n"
"Selecting a position that is ^Bnot^N next to a star (such as moves ^k~1^N, ^k~3^N or ^k~5^N)\n" "\n"
"will set up an ^Boutpost^N, not belonging to any company. Thus, if move ^k~3^N was\n" "Selecting a position that is ^Bnot^N next to a star (such as moves ^k~1^N, ^k~3^N or ^k~5^N)\n"
"selected on the above map, a ^o + ^N would be placed at that position.\n" "will set up an ^Boutpost^N, not belonging to any company. Thus, if move ^k~3^N was\n"
, "selected on the above map, a ^o + ^N would be placed at that position.\n"
""),
"If, on the other hand, a position next to a star (or another outpost) is\n" N_(""
"selected, a ^Bcompany^N would be formed and its first letter would appear on the\n" "If, on the other hand, a position next to a star (or another outpost) is\n"
"map. As a reward for creating the company, you are granted the first five\n" "selected, a ^Bcompany^N would be formed and its first letter would appear on the\n"
"shares. Up to ^B~c^N companies can be created in this way.\n" "map. As a reward for creating the company, you are granted the first five\n"
"\n" "shares. Up to ^B~c^N companies can be created in this way.\n"
"If a position next to an existing company is selected, the company would\n" "\n"
"expand its operations by one square. This increases the cost of its shares\n" "If a position next to an existing company is selected, the company would\n"
"and hence your return. Thus, if the map was as shown below, selecting ^k~6^N\n" "expand its operations by one square. This increases the cost of its shares\n"
"or ^k~8^N increases Company ^B~B^N's shipping lane:\n" "and hence your return. Thus, if the map was as shown below, selecting ^k~6^N\n"
"\n" "or ^k~8^N increases Company ^B~B^N's shipping lane:\n"
" ^e ^k~1^e . ^s*^e . . . ^s*^e ^s*^e . ^N\n" "\n"
" ^e . . . ^o+^e . . ^k~6^e . . ^N\n" " ^e ^k~1^e . ^s*^e . . . ^s*^e ^s*^e . ^N\n"
" ^e . ^s*^e . . . . ^c~B^e ^c~B^e ^c~B^e ^N Move ^k~6^N or ^k~8^N increases Company ^B~B^N.\n" " ^e . . . ^o+^e . . ^k~6^e . . ^N\n"
" ^e . ^k~2^e . . ^k~4^e . . ^s*^e ^c~B^e ^N\n" " ^e . ^s*^e . . . . ^c~B^e ^c~B^e ^c~B^e ^N Move ^k~6^N or ^k~8^N increases Company ^B~B^N.\n"
" ^e . . . . ^s*^e . . . ^k~8^e ^N\n" " ^e . ^k~2^e . . ^k~4^e . . ^s*^e ^c~B^e ^N\n"
, " ^e . . . . ^s*^e . . . ^k~8^e ^N\n"
""),
"Selecting positions next to stars increases the value of your stock by about\n" N_(""
"five times as much as an extension not next to a star. Thus move ^k~6^N should\n" "Selecting positions next to stars increases the value of your stock by about\n"
"be preferred to move ^k~8^N.\n" "five times as much as an extension not next to a star. Thus move ^k~6^N should\n"
"\n" "be preferred to move ^k~8^N.\n"
" ^e ^c~C^e . ^s*^e . . . ^s*^e ^s*^e . ^N\n" "\n"
" ^e ^k~1^e ^o+^e . ^o+^e . . ^k~6^e . . ^N\n" " ^e ^c~C^e . ^s*^e . . . ^s*^e ^s*^e . ^N\n"
" ^e . ^s*^e . . . . ^c~B^e ^c~B^e ^c~B^e ^N Move ^k~6^N is preferred to ^k~8^N.\n" " ^e ^k~1^e ^o+^e . ^o+^e . . ^k~6^e . . ^N\n"
" ^e . ^k~2^e . . ^k~4^e . . ^s*^e ^c~B^e ^N\n" " ^e . ^s*^e . . . . ^c~B^e ^c~B^e ^c~B^e ^N Move ^k~6^N is preferred to ^k~8^N.\n"
" ^e . . . . ^s*^e . . . ^k~8^e ^N\n" " ^e . ^k~2^e . . ^k~4^e . . ^s*^e ^c~B^e ^N\n"
"\n" " ^e . . . . ^s*^e . . . ^k~8^e ^N\n"
"You can also expand any company by selecting positions next to outposts.\n" "\n"
"Such outposts will be swallowed up by that company. Thus, move ^k~1^N will\n" "You can also expand any company by selecting positions next to outposts.\n"
"extend Company ^BC^N by ^Btwo^N squares. As a bonus, outposts next to stars are\n" "Such outposts will be swallowed up by that company. Thus, move ^k~1^N will\n"
"more valuable: the company's share price will increase by a greater amount\n" "extend Company ^BC^N by ^Btwo^N squares. As a bonus, outposts next to stars are\n"
"than it would for outposts not next to stars.\n" "more valuable: the company's share price will increase by a greater amount\n"
, "than it would for outposts not next to stars.\n"
""),
"If two companies are separated on the map by only one square, then they can\n" N_(""
"be ^Bmerged^N into one company by selecting that position (if available). For\n" "If two companies are separated on the map by only one square, then they can\n"
"example, on the map below, companies ^B~A^N and ^B~B^N can be merged by selecting ^k~5^N.\n" "be ^Bmerged^N into one company by selecting that position (if available). For\n"
"When this occurs, the company with the greater assets value takes over the\n" "example, on the map below, companies ^B~A^N and ^B~B^N can be merged by selecting ^k~5^N.\n"
"other one. Here, Company ^B~B^N might take over Company ^B~A^N. Company ^B~A^N ceases to\n" "When this occurs, the company with the greater assets value takes over the\n"
"exist, although it may reappear as an entirely new company at a later stage.\n" "other one. Here, Company ^B~B^N might take over Company ^B~A^N. Company ^B~A^N ceases to\n"
"\n" "exist, although it may reappear as an entirely new company at a later stage.\n"
" ^e ^k~1^e . ^s*^e . . . ^s*^e ^s*^e . ^N\n" "\n"
" ^e . . . ^c~A^e ^c~A^e ^k~5^e ^c~B^e . . ^N\n" " ^e ^k~1^e . ^s*^e . . . ^s*^e ^s*^e . ^N\n"
" ^e . ^s*^e . . ^c~A^e . ^c~B^e ^c~B^e ^c~B^e ^N Move ^k~5^N merges companies ^B~A^N and ^B~B^N.\n" " ^e . . . ^c~A^e ^c~A^e ^k~5^e ^c~B^e . . ^N\n"
" ^e . ^k~2^e . . . . . ^s*^e ^c~B^e ^N\n" " ^e . ^s*^e . . ^c~A^e . ^c~B^e ^c~B^e ^c~B^e ^N Move ^k~5^N merges companies ^B~A^N and ^B~B^N.\n"
" ^e . . . . ^s*^e . ^o+^e . . ^N\n" " ^e . ^k~2^e . . . . . ^s*^e ^c~B^e ^N\n"
"\n" " ^e . . . . ^s*^e . ^o+^e . . ^N\n"
"When companies merge, players are granted shares in the dominant company\n" "\n"
"proportional to the amount owned in the old company. As well, a cash bonus\n" "When companies merge, players are granted shares in the dominant company\n"
"is also paid, proportional to the percentage of the old company owned.\n" "proportional to the amount owned in the old company. As well, a cash bonus\n"
, "is also paid, proportional to the percentage of the old company owned.\n"
""),
"Once you select your move, you enter the ^BInterstellar Stock Exchange^N. Here\n" N_(""
"you can purchase shares, sell them, borrow from the Trading Bank or repay\n" "Once you select your move, you enter the ^BInterstellar Stock Exchange^N. Here\n"
"some of your debt (if applicable). Note that each company issues a limited\n" "you can purchase shares, sell them, borrow from the Trading Bank or repay\n"
"number of shares --- you cannot go on buying for ever! You can, however,\n" "some of your debt (if applicable). Note that each company issues a limited\n"
"bid for more shares to be issued. You have a better chance of succeeding if\n" "number of shares --- you cannot go on buying for ever! You can, however,\n"
"you own a larger proportion of the company.\n" "bid for more shares to be issued. You have a better chance of succeeding if\n"
"\n" "you own a larger proportion of the company.\n"
"The game usually ends after ^B~t^N turns. However, you can end the game sooner\n" "\n"
"by pressing ^K<CTRL><C>^N when asked to select a move. As well, individual\n" "The game usually ends after ^B~t^N turns. However, you can end the game sooner\n"
"players can declare themselves bankrupt at any time. If your debt is large\n" "by pressing ^K<CTRL><C>^N when asked to select a move. As well, individual\n"
"enough, the Bank may do this for you! If you do not complete your game in\n" "players can declare themselves bankrupt at any time. If your debt is large\n"
"the time you have available, you may save the game and continue it later.\n" "enough, the Bank may do this for you! If you do not complete your game in\n"
"\n" "the time you have available, you may save the game and continue it later.\n"
"\n" "\n"
"The ^Bwinner of the game^N is the person with the greatest net worth (total\n" "\n"
"value of cash, stock and debt). ^HGood luck^N and may the best person win!\n" "The ^Bwinner of the game^N is the person with the greatest net worth (total\n"
, "value of cash, stock and debt). ^HGood luck^N and may the best person win!\n"
""),
NULL NULL
}; };
@ -178,14 +184,14 @@ void show_help (void)
werase(curwin); werase(curwin);
box(curwin, 0, 0); box(curwin, 0, 0);
center(curwin, 1, 0, attr_title, 0, 0, 1, " How to Play "); center(curwin, 1, 0, attr_title, 0, 0, 1, _(" How to Play "));
center(curwin, 2, 0, attr_normal, attr_highlight, 0, 1, center(curwin, 2, 0, attr_normal, attr_highlight, 0, 1,
"Page %d of %d", curpage + 1, numpages); _("Page %d of %d"), curpage + 1, numpages);
wmove(curwin, 4, 2); wmove(curwin, 4, 2);
// Process the help text string // Process the help text string
const char *s = help_text[curpage]; const char *s = gettext(help_text[curpage]);
int curattr = attr_normal; int curattr = attr_normal;
while (*s != '\0') { while (*s != '\0') {
@ -326,9 +332,9 @@ void show_help (void)
} }
center(curwin, getmaxy(curwin) - 2, 0, attr_waitforkey, 0, 0, 1, center(curwin, getmaxy(curwin) - 2, 0, attr_waitforkey, 0, 0, 1,
(curpage == 0) ? "[ Press <SPACE> to continue ] " : (curpage == 0) ? _("[ Press <SPACE> to continue ] ") :
"[ Press <SPACE> to continue or <BACKSPACE> " _("[ Press <SPACE> to continue or <BACKSPACE> "
"for the previous page ] "); "for the previous page ] "));
wrefresh(curwin); wrefresh(curwin);
int key = gettxchar(curwin); int key = gettxchar(curwin);

View File

@ -2368,9 +2368,9 @@ bool answer_yesno (WINDOW *win)
wattron(win, A_BOLD); wattron(win, A_BOLD);
if (key == 'Y') { if (key == 'Y') {
waddstr(win, "Yes"); waddstr(win, _("Yes"));
} else { } else {
waddstr(win, "No"); waddstr(win, _("No"));
} }
wbkgdset(win, oldbkgd); wbkgdset(win, oldbkgd);

View File

@ -232,17 +232,17 @@ selection_t get_move (void)
box(curwin, 0, 0); box(curwin, 0, 0);
left(curwin, 2, 2, attr_normal, attr_keycode, 0, 1, left(curwin, 2, 2, attr_normal, attr_keycode, 0, 1,
"^{<1>^} Display stock portfolio"); _("^{<1>^} Display stock portfolio"));
left(curwin, 3, 2, attr_normal, attr_keycode, 0, 1, left(curwin, 3, 2, attr_normal, attr_keycode, 0, 1,
"^{<2>^} Declare bankruptcy"); _("^{<2>^} Declare bankruptcy"));
left(curwin, 2, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1, left(curwin, 2, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1,
"^{<3>^} Save and end the game"); _("^{<3>^} Save and end the game"));
left(curwin, 3, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1, left(curwin, 3, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1,
"^{<CTRL><C>^} Quit the game"); _("^{<CTRL><C>^} Quit the game"));
right(curwin, 1, getmaxx(curwin) / 2, attr_normal, attr_keycode, right(curwin, 1, getmaxx(curwin) / 2, attr_normal, attr_keycode,
attr_choice, 1, "Select move " attr_choice, 1,
"[^[%c^]-^[%c^]/^{1^}-^{3^}/^{<CTRL><C>^}]: ", _("Select move [^[%c^]-^[%c^]/^{1^}-^{3^}/^{<CTRL><C>^}]: "),
MOVE_TO_KEY(0), MOVE_TO_KEY(NUMBER_MOVES - 1)); MOVE_TO_KEY(0), MOVE_TO_KEY(NUMBER_MOVES - 1));
curs_set(CURS_ON); curs_set(CURS_ON);
@ -257,7 +257,7 @@ selection_t get_move (void)
curs_set(CURS_OFF); curs_set(CURS_OFF);
left(curwin, 1, getmaxx(curwin) / 2, attr_normal, attr_choice, left(curwin, 1, getmaxx(curwin) / 2, attr_normal, attr_choice,
0, 1, "Move ^{%c^}", key); 0, 1, _("Move ^{%c^}"), key);
} else { } else {
switch (key) { switch (key) {
case '1': case '1':
@ -272,7 +272,7 @@ selection_t get_move (void)
curs_set(CURS_OFF); curs_set(CURS_OFF);
left(curwin, 1, getmaxx(curwin) / 2, attr_normal, left(curwin, 1, getmaxx(curwin) / 2, attr_normal,
attr_normal | A_BOLD, 0, 1, attr_normal | A_BOLD, 0, 1,
"^{<2>^} (Declare bankruptcy)"); _("^{<2>^} (Declare bankruptcy)"));
break; break;
case '3': case '3':
@ -281,7 +281,7 @@ selection_t get_move (void)
curs_set(CURS_OFF); curs_set(CURS_OFF);
left(curwin, 1, getmaxx(curwin) / 2, attr_normal, left(curwin, 1, getmaxx(curwin) / 2, attr_normal,
attr_normal | A_BOLD, 0, 1, attr_normal | A_BOLD, 0, 1,
"^{<3>^} (Save and end the game)"); _("^{<3>^} (Save and end the game)"));
break; break;
case KEY_ESC: case KEY_ESC:
@ -295,7 +295,7 @@ selection_t get_move (void)
curs_set(CURS_OFF); curs_set(CURS_OFF);
left(curwin, 1, getmaxx(curwin) / 2, attr_normal, left(curwin, 1, getmaxx(curwin) / 2, attr_normal,
attr_normal | A_BOLD, 0, 1, attr_normal | A_BOLD, 0, 1,
"^{<CTRL><C>^} (Quit the game)"); _("^{<CTRL><C>^} (Quit the game)"));
break; break;
default: default:
@ -310,7 +310,7 @@ selection_t get_move (void)
// Ask the player to confirm their choice // Ask the player to confirm their choice
right(curwin, 2, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1, right(curwin, 2, getmaxx(curwin) / 2, attr_normal, attr_keycode, 0, 1,
"Are you sure? [^{Y^}/^{N^}] "); _("Are you sure? [^{Y^}/^{N^}] "));
wrefresh(curwin); wrefresh(curwin);
if (! answer_yesno(curwin)) { if (! answer_yesno(curwin)) {
@ -327,7 +327,7 @@ selection_t get_move (void)
if (game_loaded) { if (game_loaded) {
// Save the game to the same game number // Save the game to the same game number
mkchstr(chbuf, BUFSIZE, attr_status_window, 0, 0, 1, WIN_COLS mkchstr(chbuf, BUFSIZE, attr_status_window, 0, 0, 1, WIN_COLS
- 7, &width, 1, "Saving game %d... ", game_num); - 7, &width, 1, _("Saving game %d... "), game_num);
newtxwin(5, width + 5, 7, WCENTER, true, attr_status_window); newtxwin(5, width + 5, 7, WCENTER, true, attr_status_window);
centerch(curwin, 2, 0, chbuf, 1, &width); centerch(curwin, 2, 0, chbuf, 1, &width);
wrefresh(curwin); wrefresh(curwin);
@ -348,8 +348,8 @@ selection_t get_move (void)
lines = mkchstr(chbuf, BUFSIZE, attr_normal, attr_keycode, 0, lines = mkchstr(chbuf, BUFSIZE, attr_normal, attr_keycode, 0,
2, WIN_COLS - 7, widthbuf, 2, 2, WIN_COLS - 7, widthbuf, 2,
"Enter game number [^{1^}-^{9^}] " _("Enter game number [^{1^}-^{9^}] "
"or ^{<CTRL><C>^} to cancel: "); "or ^{<CTRL><C>^} to cancel: "));
assert(lines == 1 || lines == 2); assert(lines == 1 || lines == 2);
maxwidth = ((lines == 1) ? widthbuf[0] : maxwidth = ((lines == 1) ? widthbuf[0] :
MAX(widthbuf[0], widthbuf[1])) + 5; MAX(widthbuf[0], widthbuf[1])) + 5;
@ -394,8 +394,9 @@ selection_t get_move (void)
mkchstr(chbuf, BUFSIZE, attr_status_window, 0, 0, 1, mkchstr(chbuf, BUFSIZE, attr_status_window, 0, 0, 1,
WIN_COLS - 7, &width, 1, WIN_COLS - 7, &width, 1,
"Saving game %d... ", game_num); _("Saving game %d... "), game_num);
newtxwin(5, width + 5, 7, WCENTER, true, attr_status_window); newtxwin(5, width + 5, 7, WCENTER, true,
attr_status_window);
centerch(curwin, 2, 0, chbuf, 1, &width); centerch(curwin, 2, 0, chbuf, 1, &width);
wrefresh(curwin); wrefresh(curwin);
@ -623,14 +624,16 @@ void bankrupt_player (bool forced)
if (forced) { if (forced) {
txdlgbox(MAX_DLG_LINES, 50, 7, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 50, 7, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, 0, 0, attr_error_title, attr_error_highlight, 0, 0,
attr_error_waitforkey, " Bankruptcy Court ", attr_error_waitforkey, _(" Bankruptcy Court "),
"%s has been declared bankrupt by the Interstellar Trading Bank.", _("%s has been declared bankrupt "
"by the Interstellar Trading Bank."),
player[current_player].name); player[current_player].name);
} else { } else {
txdlgbox(MAX_DLG_LINES, 50, 7, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 50, 7, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, 0, 0, attr_error_title, attr_error_highlight, 0, 0,
attr_error_waitforkey, " Bankruptcy Court ", attr_error_waitforkey, _(" Bankruptcy Court "),
"%s has declared bankruptcy.", player[current_player].name); _("%s has declared bankruptcy."),
player[current_player].name);
} }
txrefresh(); txrefresh();
@ -697,8 +700,9 @@ void try_start_new_company (int x, int y)
txdlgbox(MAX_DLG_LINES, 50, 7, WCENTER, attr_normal_window, txdlgbox(MAX_DLG_LINES, 50, 7, WCENTER, attr_normal_window,
attr_title, attr_normal, attr_highlight, 0, attr_waitforkey, attr_title, attr_normal, attr_highlight, 0, attr_waitforkey,
" New Company ", "A new company has been formed!\n" _(" New Company "),
"Its name is ^{%s^}.", company[i].name); _("A new company has been formed!\nIts name is ^{%s^}."),
company[i].name);
txrefresh(); txrefresh();
galaxy_map[x][y] = COMPANY_TO_MAP(i); galaxy_map[x][y] = COMPANY_TO_MAP(i);
@ -751,14 +755,15 @@ void merge_companies (map_val_t a, map_val_t b)
// Display information about the merger // Display information about the merger
lines = mkchstr(chbuf, BUFSIZE, attr_normal, attr_highlight, 0, 4, WIN_COLS lines = mkchstr(chbuf, BUFSIZE, attr_normal, attr_highlight, 0, 4,
- 8, widthbuf, 4, "^{%s^} has just merged into ^{%s^}.\n" WIN_COLS - 8, widthbuf, 4,
"Please note the following transactions:\n", _("^{%s^} has just merged into ^{%s^}.\n"
"Please note the following transactions:\n"),
company[bb].name, company[aa].name); company[bb].name, company[aa].name);
newtxwin(number_players + lines + 10, WIN_COLS - 4, lines + 6 newtxwin(number_players + lines + 10, WIN_COLS - 4, lines + 6
- number_players, WCENTER, true, attr_normal_window); - number_players, WCENTER, true, attr_normal_window);
center(curwin, 1, 0, attr_title, 0, 0, 1, " Company Merger "); center(curwin, 1, 0, attr_title, 0, 0, 1, _(" Company Merger "));
centerch(curwin, 3, 0, chbuf, lines, widthbuf); centerch(curwin, 3, 0, chbuf, lines, widthbuf);
mkchstr(chbuf, BUFSIZE, attr_highlight, 0, 0, 1, getmaxx(curwin) / 2, mkchstr(chbuf, BUFSIZE, attr_highlight, 0, 0, 1, getmaxx(curwin) / 2,
@ -770,7 +775,7 @@ void merge_companies (map_val_t a, map_val_t b)
chbuf_bb = chstrdup(chbuf, BUFSIZE); chbuf_bb = chstrdup(chbuf, BUFSIZE);
mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin) / 2, &width, mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin) / 2, &width,
1, "Old stock: "); 1, _("Old stock: "));
w = getmaxx(curwin); w = getmaxx(curwin);
x = (w + width - MAX(width_aa, width_bb)) / 2; x = (w + width - MAX(width_aa, width_bb)) / 2;
@ -778,19 +783,19 @@ void merge_companies (map_val_t a, map_val_t b)
rightch(curwin, lines + 3, x, chbuf, 1, &width); rightch(curwin, lines + 3, x, chbuf, 1, &width);
leftch(curwin, lines + 3, x, chbuf_bb, 1, &width_bb); leftch(curwin, lines + 3, x, chbuf_bb, 1, &width_bb);
right(curwin, lines + 4, x, attr_normal, 0, 0, 1, "New Stock: "); right(curwin, lines + 4, x, attr_normal, 0, 0, 1, _("New Stock: "));
leftch(curwin, lines + 4, x, chbuf_aa, 1, &width_aa); leftch(curwin, lines + 4, x, chbuf_aa, 1, &width_aa);
mvwhline(curwin, lines + 6, 2, ' ' | attr_subtitle, w - 4); mvwhline(curwin, lines + 6, 2, ' ' | attr_subtitle, w - 4);
left(curwin, lines + 6, 4, attr_subtitle, 0, 0, 1, "Player"); left(curwin, lines + 6, 4, attr_subtitle, 0, 0, 1, _("Player"));
right(curwin, lines + 6, w - 4, attr_subtitle, 0, 0, 1, right(curwin, lines + 6, w - 4, attr_subtitle, 0, 0, 1,
"Bonus (%s)", lconvinfo.currency_symbol); _("Bonus (%s)"), lconvinfo.currency_symbol);
right(curwin, lines + 6, w - 6 - MERGE_BONUS_COLS, attr_subtitle, 0, 0, right(curwin, lines + 6, w - 6 - MERGE_BONUS_COLS, attr_subtitle, 0, 0,
1, "Total"); 1, _("Total"));
right(curwin, lines + 6, w - 8 - MERGE_BONUS_COLS - MERGE_TOTAL_STOCK_COLS, right(curwin, lines + 6, w - 8 - MERGE_BONUS_COLS - MERGE_TOTAL_STOCK_COLS,
attr_subtitle, 0, 0, 1, "New"); attr_subtitle, 0, 0, 1, _("New"));
right(curwin, lines + 6, w - 10 - MERGE_BONUS_COLS - MERGE_TOTAL_STOCK_COLS right(curwin, lines + 6, w - 10 - MERGE_BONUS_COLS - MERGE_TOTAL_STOCK_COLS
- MERGE_NEW_STOCK_COLS, attr_subtitle, 0, 0, 1, "Old"); - MERGE_NEW_STOCK_COLS, attr_subtitle, 0, 0, 1, _("Old"));
total_new = 0; total_new = 0;
for (ln = lines + 7, i = 0; i < number_players; i++) { for (ln = lines + 7, i = 0; i < number_players; i++) {
@ -936,11 +941,11 @@ void adjust_values (void)
txdlgbox(MAX_DLG_LINES, 60, 6, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 60, 6, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, attr_error_title, attr_error_highlight,
attr_error_normal, 0, attr_error_waitforkey, attr_error_normal, 0, attr_error_waitforkey,
" Bankruptcy Court ", _(" Bankruptcy Court "),
"%s has been declared bankrupt " _("%s has been declared bankrupt "
"by the Interstellar Trading Bank.\n\n" "by the Interstellar Trading Bank.\n\n"
"^{All assets have been taken " "^{All assets have been taken "
"to repay outstanding loans.^}", "to repay outstanding loans.^}"),
company[which].name); company[which].name);
txrefresh(); txrefresh();
@ -959,17 +964,18 @@ void adjust_values (void)
lines = mkchstr(chbuf, BUFSIZE, attr_error_highlight, lines = mkchstr(chbuf, BUFSIZE, attr_error_highlight,
attr_error_normal, 0, 6, 60 - 4, widthbuf, 6, attr_error_normal, 0, 6, 60 - 4, widthbuf, 6,
"%s has been declared bankrupt by the " _("%s has been declared bankrupt by the "
"Interstellar Trading Bank.\n\n" "Interstellar Trading Bank.\n\n"
"^{The Bank has agreed to pay stock holders ^}" "^{The Bank has agreed to pay stock holders ^}"
"%.2f%%^{ of the share value on each share " "%.2f%%^{ of the share value on each share "
"owned.^}", company[which].name, rate * 100.0); "owned.^}"),
company[which].name, rate * 100.0);
newtxwin(9 + lines, 60, 4, WCENTER, true, attr_error_window); newtxwin(9 + lines, 60, 4, WCENTER, true, attr_error_window);
w = getmaxx(curwin); w = getmaxx(curwin);
center(curwin, 1, 0, attr_error_title, 0, 0, 1, center(curwin, 1, 0, attr_error_title, 0, 0, 1,
" Bankruptcy Court "); _(" Bankruptcy Court "));
centerch(curwin, 3, 0, chbuf, lines, widthbuf); centerch(curwin, 3, 0, chbuf, lines, widthbuf);
mkchstr(chbuf, BUFSIZE, attr_error_highlight, 0, 0, 1, w / 2, mkchstr(chbuf, BUFSIZE, attr_error_highlight, 0, 0, 1, w / 2,
@ -977,11 +983,11 @@ void adjust_values (void)
chbuf_amt = chstrdup(chbuf, BUFSIZE); chbuf_amt = chstrdup(chbuf, BUFSIZE);
mkchstr(chbuf, BUFSIZE, attr_error_normal, 0, 0, 1, w / 2, mkchstr(chbuf, BUFSIZE, attr_error_normal, 0, 0, 1, w / 2,
&width, 1, "Amount paid per share: "); &width, 1, _("Amount paid per share: "));
x = (w + width - width_amt) / 2; x = (w + width - width_amt) / 2;
right(curwin, lines + 4, x, attr_error_normal, 0, 0, 1, right(curwin, lines + 4, x, attr_error_normal, 0, 0, 1,
"Old share value: "); _("Old share value: "));
leftch(curwin, lines + 4, x, chbuf_amt, 1, &width_amt); leftch(curwin, lines + 4, x, chbuf_amt, 1, &width_amt);
rightch(curwin, lines + 5, x, chbuf, 1, &width); rightch(curwin, lines + 5, x, chbuf, 1, &width);
@ -1073,9 +1079,9 @@ void adjust_values (void)
txdlgbox(MAX_DLG_LINES, 60, 7, WCENTER, attr_error_window, txdlgbox(MAX_DLG_LINES, 60, 7, WCENTER, attr_error_window,
attr_error_title, attr_error_highlight, attr_error_normal, attr_error_title, attr_error_highlight, attr_error_normal,
0, attr_error_waitforkey, " Interstellar Trading Bank ", 0, attr_error_waitforkey, _(" Interstellar Trading Bank "),
"Your debt has amounted to %N!\n" _("Your debt has amounted to %N!\n"
"^{The Bank has impounded ^}%N^{ from your cash.^}", "^{The Bank has impounded ^}%N^{ from your cash.^}"),
player[current_player].debt, impounded); player[current_player].debt, impounded);
txrefresh(); txrefresh();