2017 © Pedro Peláez
 

library google-supported-languages

Provides a list of supported languages by Google APIs.

image

calin-marian/google-supported-languages

Provides a list of supported languages by Google APIs.

  • Sunday, November 27, 2016
  • by calin-marian
  • Repository
  • 1 Watchers
  • 0 Stars
  • 47 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

google-supported-languages

Languages supported by Google APIs.

Google APIs support a limited list of languages. This library provides a way to validate the language parameter in your own Google API library., (*1)

Example code:, (*2)

  $googleLibrary = new MyAwesomeGoogleApiLibrary($key);

  $languageFactory = new \GoogleSupportedLanguages\LanguageFactory();

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

  $googleLibrary->setLanguage($language);

If the provided language code is not part of the supported list, an InvalidArgumentException is thrown., (*3)

Also you can then typehint the parameter to the interface \GoogleSupportedLanguages\Language\LanguageInterface:, (*4)

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

Installing the library.

  composer require calin-marian/google-supported-languages

The Versions

27/11 2016

dev-master

9999999-dev https://github.com/calin-marian/google-supported-languages

Provides a list of supported languages by Google APIs.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.2.0

 

The Development Requires

by Calin Marian

27/11 2016

v1.0.4

1.0.4.0 https://github.com/calin-marian/google-supported-languages

Provides a list of supported languages by Google APIs.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.2.0

 

The Development Requires

by Calin Marian

13/08 2016

v1.0.2

1.0.2.0 https://github.com/calin-marian/google-supported-languages

Provides a list of supported languages by Google APIs.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.2.0

 

The Development Requires

by Calin Marian

13/08 2016

v1.0.3

1.0.3.0 https://github.com/calin-marian/google-supported-languages

Provides a list of supported languages by Google APIs.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.2.0

 

The Development Requires

by Calin Marian

13/08 2016

v1.0.1

1.0.1.0 https://github.com/calin-marian/google-supported-languages

Provides a list of supported languages by Google APIs.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.2.0

 

The Development Requires

by Calin Marian

13/08 2016

v1.0.0

1.0.0.0 https://github.com/calin-marian/GoogleSupportedLanguages

Provides a list of supported languages by Google APIs.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.2.0

 

The Development Requires

by Calin Marian