TroisVerites Posted March 15, 2012 Share Posted March 15, 2012 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. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted March 16, 2012 Share Posted March 16, 2012 You could replace all of the english with translated french.. thats about the only way. Quote Link to comment Share on other sites More sharing options...
TroisVerites Posted March 16, 2012 Author Share Posted March 16, 2012 (edited) 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 March 16, 2012 by TroisVerites Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 16, 2012 Share Posted March 16, 2012 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. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted March 16, 2012 Share Posted March 16, 2012 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. Quote Link to comment Share on other sites More sharing options...
TroisVerites Posted March 16, 2012 Author Share Posted March 16, 2012 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. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted March 17, 2012 Share Posted March 17, 2012 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. ? Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 17, 2012 Share Posted March 17, 2012 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. Quote Link to comment Share on other sites More sharing options...
TroisVerites Posted March 17, 2012 Author Share Posted March 17, 2012 Finally , I found how to use english client in others world. I think the best solution for the moment. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted March 17, 2012 Share Posted March 17, 2012 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. Quote Link to comment Share on other sites More sharing options...
FHannes Posted March 17, 2012 Share Posted March 17, 2012 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. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted March 18, 2012 Share Posted March 18, 2012 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 Quote Link to comment Share on other sites More sharing options...