Recipe addon problem 1/2 [solved]

Guild listing of known recipes

Moderator: ds

Recipe addon problem 1/2

Postby PleegWat » Thu Aug 31, 2006 3:52 pm

Yes, you'd have to have the regex localized.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Recipe addon problem 1/2

Postby zanix » Thu Aug 31, 2006 4:03 pm

EDITED

So then we have in each locale file
localiztation/enUS.php
Code: Select all
$wordings['enUS']['requires_level'] = '/Requires level ([\d]+)/'

localiztation/deDE.php
(The ö is going to have to be utf-8 encoded)
Code: Select all
$wordings['deDE']['requires_level'] = '/Benötigtes Level ([\d]+)/'

localiztation/frFR.php
Code: Select all
$wordings['frFR']['requires_level'] = '/Niveau ([\d]+) requis/'



lib/wowdb.php
Find this
Code: Select all
                    foreach(array_keys($item) as $recipe_name)
                    {
                        
$recipeDetails $item[$recipe_name];
                        
$recipe $this->make_recipe$recipeDetails$memberId$skill_name$recipe_type$recipe_name );
                        
$this->insert_recipe$recipe );
                    } 

Replace with this
Code: Select all
                    foreach(array_keys($item) as $recipe_name)
                    {
                        
$recipeDetails $item[$recipe_name];
                        
$recipe $this->make_recipe$recipeDetails$memberId$skill_name$recipe_type$recipe_name );
                        
$this->insert_recipe$recipe,$data['Locale'] );
                    } 


Then change the insert_recipe() function to
Code: Select all
    function insert_recipe$recipe,$locale )
    {
        global 
$wordings;

        
$this->reset_values();
        
$this->add_value('member_id'$recipe['member_id'] );
        
$this->add_value('recipe_name'$recipe['recipe_name'] );
        
$this->add_value('recipe_type'$recipe['recipe_type'] );
        
$this->add_value('skill_name'$recipe['skill_name'] );
        
$this->add_value('difficulty'$recipe['difficulty'] );
        
$this->add_value('item_color'$recipe['item_color'] );
        
$this->add_value('reagents'$recipe['reagents'] );
        
$this->add_value('recipe_texture'$recipe['recipe_texture'] );

        
$this->add_value('recipe_tooltip'$recipe['recipe_tooltip'] );

        if( 
preg_match($wordings[$locale]['requires_level'],$recipe['recipe_tooltip'],$level))
            
$this->add_value('level',$level[1]);

        
$querystr "INSERT INTO `".ROSTER_RECIPESTABLE."` SET ".$this->assignstr;
        
$result $this->query($querystr);
        if( !
$result )
        {
            
$this->setError('Recipe ['.$recipe['recipe_name'].'] could not be inserted',$this->error());
        }
    } 
Last edited by zanix on Fri Sep 01, 2006 4:02 am, edited 1 time in total.
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Recipe addon problem 1/2

Postby sturmy » Thu Aug 31, 2006 5:13 pm

LOOKS great to me. I'll test-drive this this evening (in the GMT+1 sense of the word) to confirm.

Having looked at Max.resist translation as well, I believe we're facing the same "issue" with a need for regexp to catch 2 different locale wordings over there. With what has been posted here, I should be able to be more specific and hopefully close that issue at the same time.

Great work guys!
sturmy
WR.net Expert
WR.net Expert
 
Posts: 160
Joined: Wed Aug 16, 2006 9:07 pm

Re: Recipe addon problem 1/2

Postby sturmy » Thu Aug 31, 2006 9:41 pm

*gasp* I get "empty regexp" upon new profile upload.

Where is the locale string supposed to be? in the recipe addon localization file or in the global /localization/frFR.php ? (I tried both to no joy, but since I don't know where it's supposed to be)
sturmy
WR.net Expert
WR.net Expert
 
Posts: 160
Joined: Wed Aug 16, 2006 9:07 pm

Recipe addon problem 1/2

Postby zanix » Fri Sep 01, 2006 3:51 am

Oops, I didn't specify
The locale strings should be in the main localization files

And this is gonna have to be further edited to pick up the character's locale, for those cases where the character's locale doesn't match the mian locale
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Recipe addon problem 1/2

Postby zanix » Fri Sep 01, 2006 4:03 am

Ok, I updated my post above to reflect the nessessary changes
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Recipe addon problem 1/2

Postby sturmy » Sat Sep 02, 2006 12:11 pm

OK, you can put a solved in front of that. Though not all levels have appeared, I assume this is only because I'm the only one having updated after patching and I didn't want to wipe the tables clean (wiping in HL instances is enough ;-) )

Good job guys!
sturmy
WR.net Expert
WR.net Expert
 
Posts: 160
Joined: Wed Aug 16, 2006 9:07 pm

Recipe addon problem 1/2 [solved]

Postby RainRider » Mon Sep 18, 2006 10:19 am

The in-game german translation of "Requires level" ist "Benötigt Stufe ##". That's in the tooltips.

Thank you your fix, wonderfully done.
RainRider
WR.net Apprentice
WR.net Apprentice
 
Posts: 50
Joined: Thu Jul 20, 2006 11:47 pm

Previous

Return to Made By

Who is online

Users browsing this forum: No registered users and 0 guests

cron