Skip to content

Commit 7824404

Browse files
authored
Merge pull request #81 from Teakowa/fix-appdetails-language
Fix appdetails not follow l attribute
2 parents bce8a89 + 76fb8a2 commit 7824404

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ This gets all the details for a game. This is most of the information from the
321321
Name | Type | Description | Required | Default
322322
-----|------|-------------|----------|---------
323323
appIds| int[] | The ids of the games you want details for | Yes |
324-
cc | string | The cc is the country code, you can get appropriate currency values according to [ISO 3166-1](https://wikipedia.org/wiki/ISO_3166-1) | No |
325-
l | string | The l is the language parameter, you can get the appropriate language according to [ISO 639-1](https://wikipedia.org/wiki/ISO_639-1) (If there is one) | No |
324+
cc | string | The cc is the country code, you can get appropriate currency values according to [ISO 3166-1](https://wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) | No |
325+
l | string | The l is the language parameter, you can get the appropriate language according to [ISO 639-1](https://wikipedia.org/wiki/List_of_ISO_639-1_codes) | No |
326326

327327

328328
> Example Output: [appDetails](./examples/app/appDetails.txt)
@@ -388,4 +388,4 @@ group| string or int | The ID or the name of the group. | Yes
388388
- [MaartenStaa](https://github.com/MaartenStaa)
389389
- [JRizzle88](https://github.com/JRizzle88)
390390
- [jastend](https://github.com/jastend)
391-
- [2er7](https://github.com/2er7)
391+
- [Teakowa](https://github.com/Teakowa)

src/Syntax/SteamApi/Client.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,15 @@ protected function setUpClient(array $arguments = [])
117117
// Build the query string
118118
$parameters = http_build_query($parameters);
119119

120+
$headers = [];
121+
if (array_key_exists('l', $arguments)) {
122+
$headers = [
123+
'Accept-Language' => $arguments['l'],
124+
];
125+
}
126+
120127
// Send the request and get the results
121-
$request = new Request('GET', $steamUrl . '?' . $parameters);
128+
$request = new Request('GET', $steamUrl . '?' . $parameters, $headers);
122129
$response = $this->sendRequest($request);
123130

124131
// Pass the results back

0 commit comments

Comments
 (0)