Last active
June 12, 2018 22:12
-
-
Save Vitexus/1aa5f32d7a2ea6d2455bc644e478a4ba to your computer and use it in GitHub Desktop.
Generator of FlexiBee EN,DE,FR Country names https://gist.github.com/Vitexus/0d02d88808b00a3516fe97856e8154a2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Vítězslav Dvořák <[email protected]> | |
* | |
* Thanks to https://github.com/mledoze/countries | |
*/ | |
require_once '../vendor/autoload.php'; | |
$coder = new \FlexiPeeHP\FlexiBeeRW(null, ['evidence' => 'stat','offline'=>'true']); | |
$newCodes = json_decode(file_get_contents('countries.json'), 'true'); | |
foreach ($newCodes as $country) { | |
$item = new \FlexiPeeHP\FlexiBeeRW([ | |
'id' => FlexiPeeHP\FlexiBeeRO::code($country['cca2']), | |
'nazev' => $country['translations']['ces']['official'], | |
'nazevA' => $country['name']['official'], | |
'nazevB' => $country['translations']['deu']['official'], | |
'nazevC' => $country['translations']['fra']['official'], | |
'@create' => 'ignore' | |
], ['evidence' => 'stat', 'offline' => 'true']); | |
$coder->join($item); | |
} | |
$change = $coder->getJsonizedData(null, JSON_PRETTY_PRINT); | |
echo $change; | |
file_put_contents('../doplneni-statu.json', $change); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment