DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • June 27, 2017, 06:53:30 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: 1 [2]   Go Down
  Print  
Author Topic: Translation Question  (Read 14169 times)
0 Members and 1 Guest are viewing this topic.
Kendaer
Guest
« Reply #15 on: October 13, 2004, 07:30:47 PM »

Well... answered my own questions....

output("%s",$row['level']);
and
$linkcode = "<tr class='".($i%2?"trlight":"trdark")."'><td><a href='runmodule.php?module=thecell&op=send3&user=".$row['acctid']."'>";
output("%s",$linkcode,true);

appear to be the correct answers...

Better still would be
Code:
rawoutput( "<tr class='".($i%2?"trlight":"trdark")."'><td><a href='runmodule.php?module=thecell&op=send3&user=".$row['acctid']."'>");

Since that neither needs translation NOR to be run through the internal color/newline/bold filters.
Logged
Kendaer
Guest
« Reply #16 on: October 13, 2004, 07:44:48 PM »

Obviously I should have read through Anpera's replies before posting my own as he said pretty much the same things as I did Smiley

As to the
output("%s is a %s", $session['user']['name'], $session['user']['sex']?translate_inline("female"):translate_inline("male"));

There are two ways to do that.  One is as you saw above.  This works well for languages which don't carry the gender throughout the entire sentance.  However, it's possible that there are languages which do, or languages which have similar problems for prepositions.

For those, you will often have to run through the scripts twice because we haven't been perfectly consistant.  The way to do it so that ALL of it would be able to be translated at one go would be.
(I'm going to use an example with a pronoun below because those often do cause endings to change to be gender specific)

Code:
$male = translate_inline("%s is a male and his class is %s");
$female = translate_inline("%s is a female and her class is %s");
if ($session['user']['sex']) {
     output_notl($female, $session['user']['name'], $session['user']['race']);
} else {
     output_notl($male, $session['user']['name'], $session['user']['race']);
}

Doing it this way would result in two translator icons when you hit the page as either gender character.  Unfortunately that's not possible to do throughout the code, specifically in dealing with taunts and the substitute function, so a lot of the code actually looks more like
Code:
if ($session['user']['sex']) {
     output("%s is a female and her class is %s", $session['user']['name'], $session['user']['race']);
} else {
     output("%s is a male and his class is %s", $session['user']['name'], $session['user']['race']);
}
which will only output either the male or female translation.

Yes, this is a pain in the ass.

However! there is light at the end of the tunnel.

We intend at some point to have any non-translated string added to a table of 'to be translated' strings the first time it's encountered.  That means that you can have a bunch of players just go through and hit various pages during a 'beta' phase and you can then go through and translate anything they happen to hit which wasn't translated EVEN if the person who hit it wasn't a translator.

Basically, the translate function will just add the string to a table if it finds a string that it doesn't have a mapping for.  Very simple and clean.

However, this hasn't been written yet, so while it's coming, it's not there yet, and I don't know when it will be.
Logged
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #17 on: October 14, 2004, 12:51:39 AM »

Thank you all for the enlightning you made upon the translation  Smiley
« Last Edit: October 14, 2004, 12:52:01 AM by Excalibur » Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #18 on: October 14, 2004, 04:30:31 AM »

good stuff in this thread.
Logged

lonnyl
Guest
« Reply #19 on: October 14, 2004, 05:45:27 AM »

Very  good stuff... however means that I still have to work to do on translation readiness....
Logged
lonnyl
Guest
« Reply #20 on: October 14, 2004, 09:12:39 AM »

Ok and a summary of what we have learned here... excluding the mail parts as they are not released yet (pre-9)

output for simple variables
Code:
output("This is a test of the value of %s for output.",$variable);

output for multiple simple variables
Code:
output("This is a test of the value of %s and %s and %s for output.",$variable,$variable2,$variable3);

output of only a variable
Code:
output_notl($variable);

outputing he/she variable switches
Code:
output("%s is a %s character.",$session['user']['name'],translate_inline($session['user']['sex']?"female":"male"));
or
Code:
$male = translate_inline("male");
$female = translate_inline("female");
output("%s is a %s character.",$session['user']['name'],($session['user']['sex']?$female:$male));
or
Code:
if ($session['user']['sex']) {
    output("%s is a female and her class is %s", $session['user']['name'], $session['user']['race']);
} else {
    output("%s is a male and his class is %s", $session['user']['name'], $session['user']['race']);
}

output of pure html
Code:
rawoutput("<tr class='".($i%2?"trlight":"trdark")."'><td><a href='runmodule.php?module=thecell&op=send3&user=".$row['acctid']."'>");

output of mixed html and color codes etc....
Code:
$linkcode="<a href=\"runmodule.php?module=pqgiftshop&op=send&op2=".get_module_setting($currentgift)."&price=". get_module_setting($currentprice)."\"><span style=\"color: rgb(0, 204, 204);\">`3".get_module_setting($currentgift)." - ".get_module_setting($currentprice)." gold</span></a><br>";
output("%s",$linkcode,true);

addnav with variable
Code:
addnav(array("%s's Gift Shop",get_module_setting('gsowner')), "runmodule.php?module=pqgiftshop");

The link part of addnav is not translated hence can be done as in the past...

addnews works same as output with the exception that HTML will now work....

Hopefully I have hit on everything.....
Logged
lonnyl
Guest
« Reply #21 on: October 16, 2004, 05:21:03 AM »

Ok... Page Header???  Translation?Huh I am assuming yes.. and if so then I suppose I have some further translation work to do....
Logged
Kendaer
Guest
« Reply #22 on: October 16, 2004, 12:14:39 PM »

The page_header() function works just like the output function

Example from bio.php
Code:
page_header("Character Biography: %s", full_sanitize($row['name']));
Logged
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #23 on: October 31, 2004, 04:17:32 PM »

Another question  Grin
How could I make this translation ready, avoiding all the js text ?
The lone of code is:
Code:
output("<form action='forest.php?op=number6bis' method='POST'><input name='number' value='0'><input type='submit' class='button' value='Choose Number'>",true);
I've tried this:
Code:
rawoutput("<form action='forest.php?op=number6bis' method='POST'><input name='number' value='0'><input type='submit' class='button' value='"):

output("Choose Number");

rawoutput("'>");
but it doesn't work properly (it messes up all the box/text)
I've tried also with output_notl in place of rawoutput but it's worst  Grin

Any suggestion ?

Thanks Excalibur
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Kendaer
Guest
« Reply #24 on: October 31, 2004, 09:50:22 PM »

Here is how it's typically done in the current code

Code:
$choosenum = translate_inline("Choose Number");
rawoutput(<form action='forest.php?op=number6bis' method='POST'><input name='number' value='0'><input type='submit' class='button' value='$choosenumber'>");
Logged
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #25 on: November 01, 2004, 01:35:47 AM »

As usual, thanks Kendaer  Cheesy
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Pages: 1 [2]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
30 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search