@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * |
| 20 | 20 | * @return array Sorted list of "accept" options |
| 21 | 21 | */ |
| 22 | -$sortAccept = function ($header) |
|
| 22 | +$sortAccept = function($header) |
|
| 23 | 23 | { |
| 24 | 24 | $matches = array(); |
| 25 | 25 | foreach (explode(',', $header) as $option) { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @return string|NULL a matched option, or NULL if no match |
| 55 | 55 | */ |
| 56 | -$matchAccept = function ($header, $supported) use ($sortAccept) |
|
| 56 | +$matchAccept = function($header, $supported) use ($sortAccept) |
|
| 57 | 57 | { |
| 58 | 58 | $matches = $sortAccept($header); |
| 59 | 59 | foreach ($matches as $key => $q) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * |
| 86 | 86 | * @return string The negotiated language result or the supplied default. |
| 87 | 87 | */ |
| 88 | -$negotiateLanguage = function ($supported, $default = 'en-US') use ($matchAccept) |
|
| 88 | +$negotiateLanguage = function($supported, $default = 'en-US') use ($matchAccept) |
|
| 89 | 89 | { |
| 90 | 90 | $supp = array(); |
| 91 | 91 | foreach ($supported as $lang => $isSupported) { |
@@ -165,22 +165,22 @@ discard block |
||
| 165 | 165 | // Merge the pokedex, pokemon translation and rarity file into a new array |
| 166 | 166 | ########################################################################## |
| 167 | 167 | |
| 168 | -$pokedex_file = file_get_contents(SYS_PATH.'/core/json/pokedex.json'); |
|
| 169 | -$pokemons = json_decode($pokedex_file); |
|
| 168 | +$pokedex_file = file_get_contents(SYS_PATH.'/core/json/pokedex.json'); |
|
| 169 | +$pokemons = json_decode($pokedex_file); |
|
| 170 | 170 | |
| 171 | 171 | $pokedex_rarity_file = SYS_PATH.'/core/json/pokedex.rarity.json'; |
| 172 | 172 | $pokemons_rarity = json_decode(file_get_contents($pokedex_rarity_file)); |
| 173 | 173 | |
| 174 | 174 | foreach ($pokemons->pokemon as $pokeid => $pokemon) { |
| 175 | 175 | // Merge name and description from translation files |
| 176 | - $pokemon->name = $pokemon_trans->pokemon->$pokeid->name; |
|
| 177 | - $pokemon->description = $pokemon_trans->pokemon->$pokeid->description; |
|
| 176 | + $pokemon->name = $pokemon_trans->pokemon->$pokeid->name; |
|
| 177 | + $pokemon->description = $pokemon_trans->pokemon->$pokeid->description; |
|
| 178 | 178 | |
| 179 | 179 | // Replace quick and charge move with translation |
| 180 | - $quick_move = $pokemon->quick_move; |
|
| 181 | - $pokemon->quick_move = $pokemon_trans->quick_moves->$quick_move; |
|
| 182 | - $charge_move = $pokemon->charge_move; |
|
| 183 | - $pokemon->charge_move = $pokemon_trans->charge_moves->$charge_move; |
|
| 180 | + $quick_move = $pokemon->quick_move; |
|
| 181 | + $pokemon->quick_move = $pokemon_trans->quick_moves->$quick_move; |
|
| 182 | + $charge_move = $pokemon->charge_move; |
|
| 183 | + $pokemon->charge_move = $pokemon_trans->charge_moves->$charge_move; |
|
| 184 | 184 | |
| 185 | 185 | // Replace types with translation |
| 186 | 186 | foreach ($pokemon->types as &$type) { |
@@ -190,8 +190,8 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | // Resolve candy_id to candy_name |
| 192 | 192 | if (isset($pokemon->candy_id)) { |
| 193 | - $candy_id = $pokemon->candy_id; |
|
| 194 | - $pokemon->candy_name = $pokemon_trans->pokemon->$candy_id->name; |
|
| 193 | + $candy_id = $pokemon->candy_id; |
|
| 194 | + $pokemon->candy_name = $pokemon_trans->pokemon->$candy_id->name; |
|
| 195 | 195 | unset($pokemon->candy_id); |
| 196 | 196 | } |
| 197 | 197 | // Convert move numbers to names |
@@ -227,8 +227,8 @@ discard block |
||
| 227 | 227 | // Translate typecolors array keys as well |
| 228 | 228 | $types_temp = new stdClass(); |
| 229 | 229 | foreach ($pokemons->typecolors as $type => $color) { |
| 230 | - $type_trans = $pokemon_trans->types->$type; |
|
| 231 | - $types_temp->$type_trans = $color; |
|
| 230 | + $type_trans = $pokemon_trans->types->$type; |
|
| 231 | + $types_temp->$type_trans = $color; |
|
| 232 | 232 | } |
| 233 | 233 | // Replace typecolors array with translated one |
| 234 | 234 | $pokemons->typecolors = $types_temp; |