Even more game strings moved to descriptions.plist for the purposes of making Oolite multi-language capable.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1310 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Nikos Barkas 2008-01-14 18:35:12 +00:00
parent 0bce1be2ed
commit 295fa03c8e
4 changed files with 68 additions and 19 deletions

View File

@ -1082,6 +1082,8 @@
<string>Cash: %.1f Cr.</string> <string>Cash: %.1f Cr.</string>
<key>equip-no-equipment-available-for-purchase</key> <key>equip-no-equipment-available-for-purchase</key>
<string>No equipment available for purchase.</string> <string>No equipment available for purchase.</string>
<key>equip-repair-@</key>
<string> Repair:%@</string>
<key>upgradeinfo-@-price-is-for-repairing</key> <key>upgradeinfo-@-price-is-for-repairing</key>
<string>%@ (Price is for repairing the existing system).</string> <string>%@ (Price is for repairing the existing system).</string>
@ -1107,6 +1109,40 @@
<string>Pays:</string> <string>Pays:</string>
<key>contracts-cash-f-load-d-of-d-passengers-d-of-d-berths</key> <key>contracts-cash-f-load-d-of-d-passengers-d-of-d-berths</key>
<string>Cash: %.1f Cr. Load %d of %d t. Passengers %d of %d berths.</string> <string>Cash: %.1f Cr. Load %d of %d t. Passengers %d of %d berths.</string>
<key>contracts-@-a-@-wishes-to-go-to-@</key>
<string>%@, a %@, wishes to go to %@.</string>
<key>contracts-@-the-route-is-f-light-years-long-a-minimum-of-d-jumps</key>
<string>%@ The route is %.1f light years long, a minimum of %d jumps.</string>
<key>contracts-@-you-will-need-to-depart-within-@-in-order-to-arrive-within-@-time</key>
<string>%@ You will need to depart within %@, in order to arrive within %@ time.</string>
<key>contracts-@-will-pay-d-credits-d-in-advance-and-d-credits-on-arrival</key>
<string>%@ Will pay %d Cr: %d Cr in advance, and %d Cr on arrival.</string>
<key>contracts-deliver-a-cargo-of-@-to-@</key>
<string>Deliver a cargo of %@ to %@.</string>
<key>contracts-@-the-route-is-f-light-years-long-a-minimum-of-d-jumps</key>
<string>%@ The route is %.1f light years long, a minimum of %d jumps.</string>
<key>contracts-@-you-will-need-to-depart-within-@-in-order-to-arrive-within-@-time</key>
<string>%@ You will need to depart within %@, in order to arrive within %@ time.</string>
<key>contracts-@-the-contract-will-cost-you-f-credits-and-pay-a-total-of-f-credits</key>
<string>%@ The contract will cost you %.1f Cr, and pay a total of %.1f Cr.</string>
<key>contracts-no-time</key>
<string>no time</string>
<key>contracts-day-word</key>
<string>day</string>
<key>contracts-day-word-plural</key>
<string>days</string>
<key>contracts-hour-word</key>
<string>hr</string>
<key>contracts-hour-word-plural</key>
<string>hrs</string>
<key>contracts-minute-word</key>
<string>min</string>
<key>contracts-minute-word-plural</key>
<string>mins</string>
<key>contracts-second-word</key>
<string>sec</string>
<key>contracts-second-word-plural</key>
<string>secs</string>
<!-- Ship's manifest screen --> <!-- Ship's manifest screen -->
<key>manifest-title</key> <key>manifest-title</key>
@ -1191,6 +1227,10 @@
<string>Missile</string> <string>Missile</string>
<key>communications-log-string</key> <key>communications-log-string</key>
<string>Communications Log</string> <string>Communications Log</string>
<key>adjusting-word</key>
<string> (adjusting)</string>
<key>human-word</key>
<string>human</string> <!-- Important - only lower case characters here! -->
<key>human-colonial-description</key> <key>human-colonial-description</key>
<string>Human Colonial</string> <string>Human Colonial</string>
<key>human-colonial-description-plural</key> <key>human-colonial-description-plural</key>

View File

@ -4898,7 +4898,7 @@ static int last_outfitting_index;
if (itemForSelectFacing >= 0) if (itemForSelectFacing >= 0)
previous = -1; // ie. last index! previous = -1; // ie. last index!
[gui setColor:[OOColor greenColor] forRow:row]; [gui setColor:[OOColor greenColor] forRow:row];
[gui setArray:[NSArray arrayWithObjects:@" Back ", @" <-- ", nil] forRow:row]; [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-back"), @" <-- ", nil] forRow:row];
[gui setKey:[NSString stringWithFormat:@"More:%d", previous] forRow:row]; [gui setKey:[NSString stringWithFormat:@"More:%d", previous] forRow:row];
row++; row++;
} }
@ -4927,7 +4927,7 @@ static int last_outfitting_index;
// color repairs and renovation items orange // color repairs and renovation items orange
if ([self hasExtraEquipment:eq_key_damaged]) if ([self hasExtraEquipment:eq_key_damaged])
{ {
desc = [NSString stringWithFormat:@" Repair:%@", desc]; desc = [NSString stringWithFormat:DESC(@"equip-repair-@"), desc];
price /= 2.0; price /= 2.0;
[gui setColor:[OOColor orangeColor] forRow:row]; [gui setColor:[OOColor orangeColor] forRow:row];
} }
@ -4973,7 +4973,7 @@ static int last_outfitting_index;
if (i < [equipment_allowed count]) if (i < [equipment_allowed count])
{ {
[gui setColor:[OOColor greenColor] forRow:row]; [gui setColor:[OOColor greenColor] forRow:row];
[gui setArray:[NSArray arrayWithObjects:@" More ", @" --> ", nil] forRow:row]; [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-more"), @" --> ", nil] forRow:row];
[gui setKey:[NSString stringWithFormat:@"More:%d", i] forRow:row]; [gui setKey:[NSString stringWithFormat:@"More:%d", i] forRow:row];
row++; row++;
} }

View File

@ -598,7 +598,7 @@ NSString *ClockToString(double clock, BOOL adjusting)
secs %= 60; secs %= 60;
result = [NSString stringWithFormat:@"%07d:%02d:%02d:%02d", days, hrs, mins, secs]; result = [NSString stringWithFormat:@"%07d:%02d:%02d:%02d", days, hrs, mins, secs];
if (adjusting) result = [result stringByAppendingString:@" (adjusting)"]; if (adjusting) result = [result stringByAppendingString:DESC(@"adjusting-word")];
return result; return result;
} }

View File

@ -6422,7 +6422,7 @@ double estimatedTimeForJourney(double distance, int hops)
int passenger_species = passenger_seed.f & 3; // 0-1 native, 2 human colonial, 3 other int passenger_species = passenger_seed.f & 3; // 0-1 native, 2 human colonial, 3 other
NSString* passenger_species_string = [NSString stringWithString:native_species]; NSString* passenger_species_string = [NSString stringWithString:native_species];
if (passenger_species == 2) if (passenger_species == 2)
passenger_species_string = @"Human Colonial"; passenger_species_string = DESC(@"human-colonial-description");
if (passenger_species == 3) if (passenger_species == 3)
{ {
passenger_species_string = [self generateSystemInhabitants:passenger_seed plural:NO]; passenger_species_string = [self generateSystemInhabitants:passenger_seed plural:NO];
@ -6432,7 +6432,8 @@ double estimatedTimeForJourney(double distance, int hops)
// determine the passenger's name // determine the passenger's name
seed_RNG_only_for_planet_description(passenger_seed); seed_RNG_only_for_planet_description(passenger_seed);
NSString* passenger_name = [NSString stringWithFormat:@"%@ %@", ExpandDescriptionForSeed(@"%R", passenger_seed), ExpandDescriptionForSeed(@"%R", passenger_seed)]; NSString* passenger_name = [NSString stringWithFormat:@"%@ %@", ExpandDescriptionForSeed(@"%R", passenger_seed), ExpandDescriptionForSeed(@"%R", passenger_seed)];
if ([passenger_species_string hasPrefix:@"human"]) // If passenger is a human, make his name more... human like.
if ([[passenger_species_string componentsSeparatedByString:@" "] containsObject:DESC(@"human-word")])
passenger_name = [NSString stringWithFormat:@"%@ %@", ExpandDescriptionForSeed(@"%R", passenger_seed), ExpandDescriptionForSeed(@"[nom]", passenger_seed)]; passenger_name = [NSString stringWithFormat:@"%@ %@", ExpandDescriptionForSeed(@"%R", passenger_seed), ExpandDescriptionForSeed(@"[nom]", passenger_seed)];
// determine information about the route... // determine information about the route...
@ -6460,19 +6461,19 @@ double estimatedTimeForJourney(double distance, int hops)
NSString* long_description = [NSString stringWithFormat: NSString* long_description = [NSString stringWithFormat:
@"%@, a %@, wishes to go to %@.", DESC(@"contracts-@-a-@-wishes-to-go-to-@"),
passenger_name, passenger_species_string, destination_name]; passenger_name, passenger_species_string, destination_name];
long_description = [NSString stringWithFormat: long_description = [NSString stringWithFormat:
@"%@ The route is %.1f light years long, a minimum of %d jumps.", long_description, DESC(@"contracts-@-the-route-is-f-light-years-long-a-minimum-of-d-jumps"), long_description,
route_length, route_hops]; route_length, route_hops];
long_description = [NSString stringWithFormat: long_description = [NSString stringWithFormat:
@"%@ You will need to depart within %@, in order to arrive within %@ time.", long_description, DESC(@"contracts-@-you-will-need-to-depart-within-@-in-order-to-arrive-within-@-time"), long_description,
[self shortTimeDescription:(passenger_departure_time - current_time)], [self shortTimeDescription:(passenger_arrival_time - current_time)]]; [self shortTimeDescription:(passenger_departure_time - current_time)], [self shortTimeDescription:(passenger_arrival_time - current_time)]];
long_description = [NSString stringWithFormat: long_description = [NSString stringWithFormat:
@"%@ Will pay %d Cr: %d Cr in advance, and %d Cr on arrival.", long_description, DESC(@"contracts-@-will-pay-d-credits-d-in-advance-and-d-credits-on-arrival"), long_description,
premium + fee, premium, fee]; premium + fee, premium, fee];
NSDictionary* passenger_info_dictionary = [NSDictionary dictionaryWithObjectsAndKeys: NSDictionary* passenger_info_dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
@ -6542,33 +6543,41 @@ double estimatedTimeForJourney(double distance, int hops)
int parts = 0; int parts = 0;
if (interval <= 0.0) if (interval <= 0.0)
return @"no time"; return DESC(@"contracts-no-time");
if ((parts < 2)&&(r_time > 86400)) if ((parts < 2)&&(r_time > 86400))
{ {
int days = floor(r_time / 86400); int days = floor(r_time / 86400);
r_time -= 86400 * days; r_time -= 86400 * days;
result = [NSString stringWithFormat:@"%@ %d day%@", result, days, (days > 1) ? @"s" : @""]; result = [NSString stringWithFormat:@"%@ %d %@", result, days, (days > 1) ?
DESC(@"contracts-day-word-plural") :
DESC(@"contracts-day-word")];
parts++; parts++;
} }
if ((parts < 2)&&(r_time > 3600)) if ((parts < 2)&&(r_time > 3600))
{ {
int hours = floor(r_time / 3600); int hours = floor(r_time / 3600);
r_time -= 3600 * hours; r_time -= 3600 * hours;
result = [NSString stringWithFormat:@"%@ %d hr%@", result, hours, (hours > 1) ? @"s" : @""]; result = [NSString stringWithFormat:@"%@ %d %@", result, hours, (hours > 1) ?
DESC(@"contracts-hour-word-plural") :
DESC(@"contracts-hour-word")];
parts++; parts++;
} }
if ((parts < 2)&&(r_time > 60)) if ((parts < 2)&&(r_time > 60))
{ {
int mins = floor(r_time / 60); int mins = floor(r_time / 60);
r_time -= 60 * mins; r_time -= 60 * mins;
result = [NSString stringWithFormat:@"%@ %d min%@", result, mins, (mins > 1) ? @"s" : @""]; result = [NSString stringWithFormat:@"%@ %d %@", result, mins, (mins > 1) ?
DESC(@"contracts-minute-word-plural") :
DESC(@"contracts-minute-word")];
parts++; parts++;
} }
if ((parts < 2)&&(r_time > 0)) if ((parts < 2)&&(r_time > 0))
{ {
int secs = floor(r_time); int secs = floor(r_time);
result = [NSString stringWithFormat:@"%@ %d sec%@", result, secs, (secs > 1) ? @"s" : @""]; result = [NSString stringWithFormat:@"%@ %d %@", result, secs, (secs > 1) ?
DESC(@"contracts-second-word-plural") :
DESC(@"contracts-second-word")];
parts++; parts++;
} }
return [result stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; return [result stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
@ -6730,19 +6739,19 @@ double estimatedTimeForJourney(double distance, int hops)
double contract_arrival_time = contract_departure_time + estimatedTimeForJourney(route_length, route_hops); double contract_arrival_time = contract_departure_time + estimatedTimeForJourney(route_length, route_hops);
NSString* long_description = [NSString stringWithFormat: NSString* long_description = [NSString stringWithFormat:
@"Deliver a cargo of %@ to %@.", DESC(@"contracts-deliver-a-cargo-of-@-to-@"),
[self describeCommodity:co_type amount:co_amount], destination_name]; [self describeCommodity:co_type amount:co_amount], destination_name];
long_description = [NSString stringWithFormat: long_description = [NSString stringWithFormat:
@"%@ The route is %.1f light years long, a minimum of %d jumps.", long_description, DESC(@"contracts-@-the-route-is-f-light-years-long-a-minimum-of-d-jumps"), long_description,
route_length, route_hops]; route_length, route_hops];
long_description = [NSString stringWithFormat: long_description = [NSString stringWithFormat:
@"%@ You will need to depart within %@, in order to arrive within %@ time.", long_description, DESC(@"contracts-@-you-will-need-to-depart-within-@-in-order-to-arrive-within-@-time"), long_description,
[self shortTimeDescription:(contract_departure_time - current_time)], [self shortTimeDescription:(contract_arrival_time - current_time)]]; [self shortTimeDescription:(contract_departure_time - current_time)], [self shortTimeDescription:(contract_arrival_time - current_time)]];
long_description = [NSString stringWithFormat: long_description = [NSString stringWithFormat:
@"%@ The contract will cost you %.1f Cr, and pay a total of %.1f Cr.", long_description, DESC(@"contracts-@-the-contract-will-cost-you-f-credits-and-pay-a-total-of-f-credits"), long_description,
premium, premium + fee]; premium, premium + fee];
NSDictionary* contract_info_dictionary = [NSDictionary dictionaryWithObjectsAndKeys: NSDictionary* contract_info_dictionary = [NSDictionary dictionaryWithObjectsAndKeys: