Ulminia / blizzard-api-oauth

the blizzard api in oauth form
22 stars 7 forks source link

Locale parameter doesn't work #1

Closed Kreven closed 10 years ago

Kreven commented 10 years ago

Hi, I have a problem using $locale option

$region    = 'EU';
$locale    = 'ru_RU';

then

$criterias = $client->fetch('achievement',array('id'=>'8510'));

and

$criterias['result']['title'];

returns Siege of Orgrimmar Guild Run instead of Гильдейский марш: Осада Оргриммара

Ulminia commented 10 years ago

please past your script init in your php page minus your client and secret please

Kreven commented 10 years ago
    require('./core/OAuth2/Client.php');
    require('./core/OAuth2/GrantType/IGrantType.php');
    require('./core/OAuth2/GrantType/AuthorizationCode.php');

    /**
    *   Required vars for the api to work
    *
    **/

    $client_id          = '';
    $client_secret      = '';
    $region             = 'EU';
    $locale             = 'ru_RU';
    $redirect_uri       = 'https://enterpriseguild.me';

    // init the auth system client_id, client_secret, region, local all required
    $client = new OAuth2\Client($client_id, $client_secret, $region, $locale, $redirect_uri);

    //"http://eu.battle.net/api/wow/guild/свежеватель-душ/Энтерпрайз?fields=achievements&locale=ru_RU";
    $data = $client->fetch('guild',array('name'=>'Энтерпрайз','server'=>'свежеватель-душ','fields'=>'achievements'));

    //"http://eu.battle.net/api/wow/achievement/8510?locale=ru_RU";
    $criterias = $client->fetch('achievement',array('id'=>'8510'));

    $progress = $criterias['result']['criteria'];
    $progress = array_reverse($progress);

    $gname = $data['result']['name'];
    $realm = $data['result']['realm'];

    $title = $criterias['result']['title']);

and then goes HTML and values echo's :)

Ulminia commented 10 years ago

an error has been found pushing a fix sorry for this..

Kreven commented 10 years ago

Thanks alot for quick feedback!

Ulminia commented 10 years ago

no problem closing.. if you have another issue please post agian