PHP code example of calin-marian / google-supported-languages

1. Go to this page and download the library: Download calin-marian/google-supported-languages library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

calin-marian / google-supported-languages example snippets


  $googleLibrary = new MyAwesomeGoogleApiLibrary($key);
  
  $languageFactory = new \GoogleSupportedLanguages\LanguageFactory();

  $languageCode = 'en';
  $language = $languageFactory->create($languageCode);
  
  $googleLibrary->setLanguage($language);

  class MyAwesomeGoogleApiLibrary implements MyAwesomeGoogleApiLibraryInterface;
    ....
    public function setLanguage(\GoogleSupportedLanguages\Language\LanguageInterface $language){
      $this->language = $language;
    }
    ....
    public function execute() {
      ...
      $parameters['language'] = $this->language->getCode();
      ....
    }
    ....
  }