Skip to content

Releases: PrinsFrank/standards

v3.8.0 Top Level Domain, Script detection for strings and a lot of fixes and improvements!

02 Feb 17:06
f1178f2
Compare
Choose a tag to compare

What's Changed

Introduction of Top Level Domains

There are 6 categories of Top Level Domains, and all of them have been introduced as seperate enums:

CountryCodeTLD::from('nl');                      // CountryCodeTLD::nl
CountryCodeTLD::nl;                              // CountryCodeTLD::nl
CountryCodeTLD::from('nl')->value;               // 'nl'
CountryCodeTLD::from('nl')->name;                // 'nl'
CountryCodeTLD::from('nl')->isAssigned();        // true
CountryCodeTLD::from('nl')->getCountryAlpha2();  // CountryAlpha2::Netherlands
CountryCodeTLD::from('nl')->getCountryAlpha3();  // CountryAlpha3::Netherlands
CountryCodeTLD::from('nl')->getCountryNumeric(); // CountryNumeric::Netherlands

GenericRestrictedTLD::from('name');                // GenericRestrictedTLD::name
GenericRestrictedTLD::name;                        // GenericRestrictedTLD::name
GenericRestrictedTLD::from('name')->value;         // 'name'
GenericRestrictedTLD::from('name')->name;          // 'name'
GenericRestrictedTLD::from('name')->isAssigned();  // true

GenericTLD::from('aaa');                // GenericTLD::aaa
GenericTLD::aaa;                        // GenericTLD::aaa
GenericTLD::from('aaa')->value;         // 'aaa'
GenericTLD::from('aaa')->name;          // 'aaa'
GenericTLD::from('aaa')->isAssigned();  // true

InfrastructureTLD::from('arpa');                // InfrastructureTLD::arpa
InfrastructureTLD::arpa;                        // InfrastructureTLD::arpa
InfrastructureTLD::from('arpa')->value;         // 'arpa'
InfrastructureTLD::from('arpa')->name;          // 'arpa'
InfrastructureTLD::from('arpa')->isAssigned();  // true

SponsoredTLD::from('aero');                // SponsoredTLD::aero
SponsoredTLD::arpa;                        // SponsoredTLD::aero
SponsoredTLD::from('aero')->value;         // 'aero'
SponsoredTLD::from('aero')->name;          // 'aero'
SponsoredTLD::from('aero')->isAssigned();  // true

TestTLD::from('テスト');              // TestTLD::tesuto_katakana
TestTLD::tesuto_katakana;            // TestTLD::tesuto_katakana
TestTLD::from('テスト')->value;       // 'テスト'
TestTLD::from('テスト')->name;        // 'tesuto_katakana'
TestTLD::from('テスト')->isAssigned() // false

Retrieving scripts for strings

It is now possible to retrieve the script(s) for a string:

ScriptAlias::allForString('еюeuеюευ');         // [ScriptAlias::Cyrillic, ScriptAlias::Greek, ScriptAlias::Latin]
ScriptAlias::hasMultipleForString('еюeuеюευ'); // true
ScriptAlias::mostCommonInString('еюeuеюευ');   // ScriptAlias::Cyrillic

ScriptCode::allForString('еюeuеюευ');         // [ScriptCode::Cyrillic, ScriptCode::Greek, ScriptCode::Latin]
ScriptCode::hasMultipleForString('еюeuеюευ'); // true
ScriptCode::mostCommonInString('еюeuеюευ');   // ScriptCode::Cyrillic

ScriptNumber::allForString('еюeuеюευ');         // [ScriptNumber::Cyrillic, ScriptAlias::Greek, ScriptAlias::Latin]
ScriptNumber::hasMultipleForString('еюeuеюευ'); // true
ScriptNumber::mostCommonInString('еюeuеюευ');   // ScriptNumber::Cyrillic

LanguageExtensive has received some updates

  • Automatic language-extensive spec update by @github-actions in #145, #167 and #202

Fixes and Improvements

New Contributors

Full Changelog: v3.7.0...v...

Read more

v3.7.0 Sierra Leone has finished currency transition: Sierra_Leone_Old is now deprecated and not returned by currencyForCountry

01 Jan 13:47
bd6945e
Compare
Choose a tag to compare

What's Changed

  • Sierra Leone has finished currency transition: Sierra_Leone_Old is now deprecated and not returned by currencyForCountry by @github-actions in #130

Other

Full Changelog: v3.6.0...v3.7.0

v3.6.0 Allow configurable subtag separator for LanguageTags/Locales when parsing from string or casting to string

27 Dec 14:38
aff7c5b
Compare
Choose a tag to compare

What's Changed

  • Allow configurable subtag separator when parsing from string or casting to string by @PrinsFrank in #125

Full Changelog: v3.5.0...v3.6.0

v3.5.0 Added '__toString' method to LanguageTag

26 Dec 21:23
06e615c
Compare
Choose a tag to compare

What's Changed

  • Add Stringable/__toString() to LanguageTags (Locales) by @PrinsFrank in #124

Full Changelog: v3.4.0...v3.5.0

v3.4.0 Country/Language names in different languages, Number/Currency formatting based on country/language, National call prefixes

22 Dec 16:10
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.3.0...v3.4.0

v3.3.0 Relationship between country and language & Minor units for currencies

02 Dec 11:36
1331328
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.2.0...v3.3.0

v3.2.0 Add relationships between Countries and Currencies

01 Dec 14:20
9c64486
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.1.0...v3.2.0

v3.1.0 Add TravelDocuments Alpha2/Alpha3 UserAssigned country codes in new specfication

17 Nov 09:43
660b34a
Compare
Choose a tag to compare

What's Changed

  • Add TravelDocuments Alpha2/Alpha3 UserAssigned country codes in new specfication by @rbiya in #96

New Contributors

  • @rbiya made their first contribution in #96

Full Changelog: v3.0.0...v3.1.0

v3.0.0

16 Nov 15:23
Compare
Choose a tag to compare

New features

RFC 5646 language tags added by @PrinsFrank in #69

Language tags have been added. It is possible to construct a language tag from seperate parts, but much more useful is the parsing of language tags from strings:

+ LanguageTag::from('yue-HK'); // new LanguageTag(LanguageAlpha3Extensive::Yue_Chinese, regionSubtag: CountryAlpha2::Hong_Kong)
+ LanguageTag::from('yue-HK')->regionSubtag; // CountryAlpha2::Hong_Kong

+ new LanguageTag(LanguageAlpha3Extensive::Yue_Chinese, regionSubtag: CountryAlpha2::Hong_Kong);

Relation added between countries and Country Calling Cod(es) by @PrinsFrank in #81

If you have a country, it is now possible to get it's country calling prefix and the other way round:

+ CountryAlpha2::from('US')->getCountryCallingCodes(); // [CountryCallingCode::Integrated_numbering_plan]

+ CountryCallingCode::from(358)->getCountriesAlpha2(); // [CountryAlpha2::Finland, CountryAlpha2::Aland_Islands] 

Relation added between countries and international call prefix(es) by @PrinsFrank in #82

International call prefixes were already added, but the relation to specific countries was not there yet. In this release it is now possible to retrieve an international call prefix for a country and the other way round:

+ CountryAlpha2::from('NL')->getInternationalCallPrefix()->value; // '00'

+ InternationalCallPrefix::from('000')->getCountries(); // [CountryAlpha2::Kenya, CountryAlpha2::Singapore, CountryAlpha2::Tanzania, CountryAlpha2::Uganda]

Methods added to create language tags from languages by @PrinsFrank in #83

With the introduction of language tags, it is now also possible to create a language tag instance from a language directly:

$language = LanguageAlpha3Terminology::from('nld')
+ $languageTag = $language->toLanguageTag();

This method has been added to LanguageAlpha2, LanguageAlpha3Bibliographic, LanguageAlpha3Terminology and LanguageAlpha3Extensive.

"getFlagEmoji" method added to country standards by @PrinsFrank in #93

It is now possible to retrieve the country flag emoji from a country:

+ CountryAlpha3::from('NLD')->getFlagEmoji(); // '🇳🇱'

This might not be displayed correctly in these release notes if you're on windows, see https://prinsfrank.nl/2021/01/25/Non-existing-flag-emojis-on-windows to make these flag emojis visible for Windows users.

Breaking changes

(See UPGRADING.md)

Removal of LanguageAlpha3Common; merged into LanguageAlpha3Bibliographic and LanguageAlpha3Terminology by @PrinsFrank in #91

LanguageAlpha3Common contained all the cases that were present in both LanguageAlpha3Bibliographic and LanguageAlpha3Terminology. That resulted in complicated type hints. For the sake of simplicity these have now been merged. All the cases that were present in the LanguageAlpha3Common enum are now also present in the LanguageAlpha3Bibliographic and LanguageAlpha3Terminology enums, and the LanguageAlpha3Common class has been removed.

This change also results in the return types of the methods on language classes 'toLanguageAlpha3Terminology' changing from an intersection type with the common class to just an instance of LanguageAlpha3Terminology or null and the 'toLanguageAlpha3Bibliographic' changing from an intersection type with the common class to just an instance of LanguageAlpha3Bibliographic or null.

To process this change, simply remove all references to the following class:

- LanguageAlpha3Common

ScriptCode and ScriptNumber naming inverted

In the previous release 2.5.0, the naming for scriptCode and ScriptNumber were swapped. In this release the naming has been fixed. If you used any of these classes already, please swap them in your code as well:

- ScriptCode
+ ScriptName
- ScriptName
+ ScriptCode

Typo fixed in CountryCallingCode enum case by @szepeviktor in #65

A typo in the name of Global Mobile Satellite System has been fixed. If you were using the Global_Mobile_Satelite_System_shared_code case of CountryCallingCode as a hardcoded value in your codebase, you schould change it: (Note the extra letter 'l')

- CountryCallingCode::Global_Mobile_Satelite_System_shared_code;
+ CountryCallingCode::Global_Mobile_Satellite_System_shared_code;

BackedEnum and UnitEnum are now marked internal @PrinsFrank in #92

These classes should not be used outside of this package, as the method signature might change between minor versions. As such, these classes are now marked internal. If you use the classes in your code you can continue to do so at your own risk, or you might want to remove their usages.

Other

Full Changelog: v2.5.0...v3.0.0

v2.5.0 Extensive language tags from ISO639-3 and several fixes

28 Oct 12:09
f6a4bbd
Compare
Choose a tag to compare

What's Changed

  • Rewrite source parsing to allow for more source formats by @PrinsFrank in #72
  • Deprecate "unused" status code as multiple status codes are unused and it's not part of the spec by @PrinsFrank in #73
  • Exclude "Reserved for local use" from being included in language names as it doesn't have a single code by @PrinsFrank in #75
  • Fix incorrect column count in script mapping resulting in incorrect Scripts by @PrinsFrank in #76
  • Add missing old "Bolivar Soberano" and "Leone" as due to a name collision it was missing from the spec by @PrinsFrank in #74
  • Add extensive alpha3 languages from ISO639-3 by @PrinsFrank in #71

Full Changelog: v2.4.0...v2.5.0