项目作者: rinvex

项目描述 :
Rinvex Language is a simple and lightweight package for retrieving language details with flexibility. A whole bunch of data including name, native, iso codes, language family, language script, language cultures, and other attributes for the 180+ known languages worldwide at your fingertips.
高级语言: PHP
项目地址: git://github.com/rinvex/languages.git
创建时间: 2017-01-01T09:26:59Z
项目社区:https://github.com/rinvex/languages

开源协议:MIT License

下载


Rinvex Language

Rinvex Language is a simple and lightweight package for retrieving language details with flexibility. A whole bunch of data including name, native, iso codes, language family, language script, language cultures, and other attributes for the 180+ known languages worldwide at your fingertips.

Packagist
Scrutinizer Code Quality
Travis
StyleCI
License

Usage

Install via composer require rinvex/languages, then use intuitively:

  1. // Get single language
  2. $english = language('en');
  3. // Get language name: English
  4. echo $english->getName();
  5. // Get language native name: English
  6. echo $english->getNativeName();
  7. // Get language ISO 639-1 code: en
  8. echo $english->getIso6391();
  9. // Get language ISO 639-2 code: eng
  10. echo $english->getIso6392();
  11. // Get language ISO 639-3 code: eng
  12. echo $english->getIso6393();
  13. // Get language script details: {"name": "Latin","iso_15924": "Latn","iso_numeric": "215","direction": "ltr"}
  14. echo $english->getScript();
  15. // Get language script name: Latin
  16. echo $english->getScriptName();
  17. // Get language script ISO 15924 code: Latn
  18. echo $english->getScriptIso15924();
  19. // Get language script ISO numeric code: 215
  20. echo $english->getScriptIsoNumeric();
  21. // Get language script direction: ltr
  22. echo $english->getScriptDirection();
  23. // Get language family details: {"name": "Indo-European","iso_639_5": "ine","hierarchy": "ine"}
  24. echo $english->getFamily();
  25. // Get language family name: Indo-European
  26. echo $english->getFamilyName();
  27. // Get language family ISO 6395 code: ine
  28. echo $english->getFamilyIso6395();
  29. // Get language family hierarchy: ine
  30. echo $english->getFamilyHierarchy();
  31. // Get language scope: individual
  32. echo $english->getScope();
  33. // Get language type: living
  34. echo $english->getType();
  35. // Get language cultures: {"en-US": {"name": "English (United States)","native": "English (United States)"}, {...}}
  36. echo $english->getCultures();
  37. // Get language specific culture: {"name": "English (United States)","native": "English (United States)"}
  38. echo $english->getCulture('en-US');
  39. // Get all languages
  40. $languages = languages();
  41. // Get all language scripts
  42. $language_scripts = language_scripts();
  43. // Get all language families
  44. $language_families = language_families();
  45. // Get languages with where condition (language script: Latin)
  46. $whereLanguages = \Rinvex\Language\LanguageLoader::where('script.name', 'Latin');

Notes:

  • Rinvex Language is framework-agnostic, so it’s compatible with any PHP framework whatsoever without any dependencies at all, except for the PHP version itself ^8.0.0. Awesome, huh? :smiley:
  • Rinvex Language provides the global helpers for your convenience and for ease of use, but in fact it’s just wrappers around the underlying LanguageLoader class, which you can utilize and use directly if you wish

Features Explained

  • Language data are all stored here: resources/languages.json.
  • name - language english name
  • native - language native name
  • iso_639_1 - two letter code ISO 639-1
  • iso_639_2 - three letter code ISO 639-2
  • iso_639_3 - three letter code ISO 639-3
  • script - language script details
    • name: language script name
    • iso_15924: language script ISO 15924 code
    • iso_numeric: language script ISO numeric code
    • direction: language script writing direction
  • family - language family details
    • name: language family name
    • iso_639_5: three-letter ISO 639-5 code
    • hierarchy: language family hierarchy
  • cultures - list of language cultures
    • key: four-letter language culture code (iso_639_1-iso_3166_1)
    • value: culture object
      • name: language culture name
      • native: language culture native name
  • scope - language scope (like individual or macrolanguage)
  • type - language type (like living or ancient)

Changelog

Refer to the Changelog for a full history of the project.

Support

The following support channels are available at your fingertips:

Contributing & Protocols

Thank you for considering contributing to this project! The contribution guide can be found in CONTRIBUTING.md.

Bug reports, feature requests, and pull requests are very welcome.

Security Vulnerabilities

If you discover a security vulnerability within this project, please send an e-mail to help@rinvex.com"">help@rinvex.com. All security vulnerabilities will be promptly addressed.

About Rinvex

Rinvex is a software solutions startup, specialized in integrated enterprise solutions for SMEs established in Alexandria, Egypt since June 2016. We believe that our drive The Value, The Reach, and The Impact is what differentiates us and unleash the endless possibilities of our philosophy through the power of software. We like to call it Innovation At The Speed Of Life. That’s how we do our share of advancing humanity.

License

This software is released under The MIT License (MIT).

(c) 2016-2022 Rinvex LLC, Some rights reserved.