Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Sign in to follow this  
TroisVerites

OSI -> RS2 with French and others than english

Recommended Posts

I would like to know if Scripts that use , work fine with Client RS2 in French.

 

Sample: Bank.scar

 

[sCAR]

 

function BankScreen: Boolean;

var

TPA: TPointArray;

P: TPoint;

begin

Result := False;

FindColors(TPA, 4106994, 119, 25, 328, 47);

if (Length(TPA) > 20) then

Result := FindTextTPAInTPA('ank of', ScreenChars, TPA, P.X, P.Y);

end;

 

[/sCAR]

 

It seems that there are words in English in the code. Is there a clean way to use the RS2 code with a French client ?

 

Same sugestion for scripts provided.

Share this post


Link to post
Share on other sites

Yes I know I could replace all the english with translated french.

 

The goal is to keep the same code after the use of StringTranslate.

 

But I search a better solution to help the others too. And if you make an update of the RS2 , I have to do all the work. no good. I didn't learn to work like that.

 

---------- Post added at 09:27 AM ---------- Previous post was at 08:42 AM ----------

 

Perhaps we can use something like that.

 

I want to know all your solutions. What is the better way.

 

[sCAR]

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Runescape 2

String Translate routines

--------------------------------------------------------------------------------

* procedure ST_Setup();

By: TroisVerites

* procedure ST_LangSet(const Lang:string);

By: TroisVerites

* function ST_Add(Lang:string; US_Str:string; Lang_Str:string):boolean;

By: TroisVerites

* function ST_Get(const StrToTrans:string):string;

By: TroisVerites

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Global variables

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

var

// String containing langage used ( 'US' , 'FR' , etc...). Default is 'US'

gST_lang: string;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

procedure ST_Setup();

Contributors: TroisVerites

Description: Setup String Translate.

Date Created: March 16th, 2012. By TroisVerites Build 001

Last Modification:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

procedure ST_Setup();

begin

if ( gST_lang = '' ) then gST_lang:= 'US';

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

procedure ST_LangSet(const Lang:string);

Contributors: TroisVerites

Description: Set the new langage. ( 'FR' , etc...)

Date Created: March 16th, 2012. By TroisVerites Build 001

Last Modification:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

procedure ST_LangSet(const Lang:string);

begin

gST_lang:= Lang;

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function ST_Add(Lang:string; US_Str:string; Lang_Str:string):boolean;

Contributors: TroisVerites

Description: Fill the table with the stranslated string.

Date Created: March 16th, 2012. By TroisVerites Build 001

Last Modification:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

function ST_Add(Lang:string; US_Str:string; Lang_Str:string):boolean;

begin

Result := true;

// TODO how to fill the table

// Hash Table is a good way, don't know if we have in scar

// Add code security

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function ST_Get(const StrToTrans:string);

Contributors: TroisVerites

Description: Get the string translated.

Date Created: March 16th, 2012. By TroisVerites Build 001

Last Modification:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

function ST_Get(const StrToTrans:string):string;

begin

// A better solution is to add the string in tha table if not found.

// Then we can drop drop the table to see what string is missing.

 

// Return original string if :

// - No Translate need

// - the string is not found in the table.

// - Others errors

Result := StrToTrans;

if ( gST_lang = 'US' ) then exit;

// TODO the code

// Add code security

// becarefull with lower and upper. what we want?

end;

 

begin

ST_Setup();

ST_LangSet('FR');

ST_Add('FR','bank','banque');

writeln(ST_Get('bank'));

 

end.

 

[/sCAR]

Edited by TroisVerites

Share this post


Link to post
Share on other sites

An actual language database would probably be better here. SCAR has routines for using SQLite databases, if you were to store strings for each language in there, they could be easily retrieved when needed.

Share this post


Link to post
Share on other sites
Yes I know I could replace all the english with translated french.

 

The goal is to keep the same code after the use of StringTranslate.

 

But I search a better solution to help the others too. And if you make an update of the RS2 , I have to do all the work. no good. I didn't learn to work like that.

 

[/sCAR]

How would you recommend making a universal macro to replace the string 'ank of' ??? lol there not whole words, so you would spend more time making this library than it would take you to use the "Find and Replace" Feature of scar... Also What if not every English word has the same direct translation into french?What if instead of 'ank of' changes it to 'k of' ...? you would then need to go update you lib just like you would if you had just used the find and replace function. So I don't see the point in trying to make this just do all the translations and "Select --> Copy --> Paste" and you would only need to do this for the selected files in use...

 

Not saying this is not a good idea, i think it will take alot more work than just replacing the text.

 

If there was an update then it wouldnt change every single text.."login" would not be changed to "Hello" ect.... maybe a 1 line change but not to hard to update.

Share this post


Link to post
Share on other sites

I don't want a good translation , I would like the text used in a French version ( for use in the same thing).

 

I make a copy of this file Inventory.scar in another directory and change OSI.scar to OSI_FR.scar.

I would try if there is only this problem ( English string and French String ).

 

I need more time , because I think there is another problem with the current Tab 'function' , the color used is not the same.

Share this post


Link to post
Share on other sites
I don't want a good translation , I would like the text used in a French version ( for use in the same thing).

 

I make a copy of this file Inventory.scar in another directory and change OSI.scar to OSI_FR.scar.

I would try if there is only this problem ( English string and French String ).

 

I need more time , because I think there is another problem with the current Tab 'function' , the color used is not the same.

 

why not just use a English server on RS? you seem to understand/speak it pretty good. ?

Share this post


Link to post
Share on other sites
How would you recommend making a universal macro to replace the string 'ank of' ??? lol there not whole words, so you would spend more time making this library than it would take you to use the "Find and Replace" Feature of scar... Also What if not every English word has the same direct translation into french?What if instead of 'ank of' changes it to 'k of' ...? you would then need to go update you lib just like you would if you had just used the find and replace function. So I don't see the point in trying to make this just do all the translations and "Select --> Copy --> Paste" and you would only need to do this for the selected files in use...

 

Not saying this is not a good idea, i think it will take alot more work than just replacing the text.

 

If there was an update then it wouldnt change every single text.."login" would not be changed to "Hello" ect.... maybe a 1 line change but not to hard to update.

 

He doesn't seem to be suggesting to just replace stuff, he's looking for a way to do it... As for the "no direct translation"... There's always a translation, or there wouldn't be any text in the french version of RS.

Share this post


Link to post
Share on other sites
He doesn't seem to be suggesting to just replace stuff, he's looking for a way to do it... As for the "no direct translation"... There's always a translation, or there wouldn't be any text in the french version of RS.
well replace it virtually is what i meant, i would not be permanently replaced just in memory. And by "No Direct Translation" I meant Stated "Also What if not every English word has the same direct translation into french?" he would have to go through all the options and make sure the word he picked matched the word that shows up when that option is available in french.. because there could be a fw options which would be time consuming.

Share this post


Link to post
Share on other sites
well replace it virtually is what i meant, i would not be permanently replaced just in memory. And by "No Direct Translation" I meant Stated "Also What if not every English word has the same direct translation into french?" he would have to go through all the options and make sure the word he picked matched the word that shows up when that option is available in french.. because there could be a fw options which would be time consuming.

 

You'd always have to go through every option... Most words have multiple translations.

Share this post


Link to post
Share on other sites
You'd always have to go through every option... Most words have multiple translations.

 

Which is why his statement of being more effiecnt/quicker was wrong because it would take more time than replacing the text in lib with what he needed, vrs writing a lib to support/change all the text universally

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...