elixir-cldr / cldr_units

Unit formatting (volume, area, length, ...) functions for the Common Locale Data Repository (CLDR)
Other
16 stars 13 forks source link

Add parse_unit_name/2 #31

Closed Awlexus closed 1 year ago

Awlexus commented 1 year ago

As discussed in #30, this merge request will add a new function called parse_unit_name/2 to Cldr.Unit and MyApp.Cldr.Unit.

I was unable to run the tests locally, because I could not download the data required for some languages, so I could only test it by integrating it into my codebase.

Error message ``` Compiling 23 files (.ex) 00:46:49.696 [error] Failed to connect to 'raw.githubusercontent.com' to download locale :af. Reason: {:options, {:cacertfile, '../../ca-certificates/extracted/tls-ca-bundle.pem', {:error, :enoent}}} 00:46:49.716 [error] Failed to connect to 'raw.githubusercontent.com' to download locale :"af-NA". Reason: {:options, {:cacertfile, '../../ca-certificates/extracted/tls-ca-bundle.pem', {:error, :enoent}}} 00:46:49.732 [error] Failed to connect to 'raw.githubusercontent.com' to download locale :ar. Reason: {:options, {:cacertfile, '../../ca-certificates/extracted/tls-ca-bundle.pem', {:error, :enoent}}} 00:46:49.748 [error] Failed to connect to 'raw.githubusercontent.com' to download locale :bs. Reason: {:options, {:cacertfile, '../../ca-certificates/extracted/tls-ca-bundle.pem', {:error, :enoent}}} 00:46:49.763 [error] Failed to connect to 'raw.githubusercontent.com' to download locale :de. Reason: {:options, {:cacertfile, '../../ca-certificates/extracted/tls-ca-bundle.pem', {:error, :enoent}}} 00:46:49.778 [error] Failed to connect to 'raw.githubusercontent.com' to download locale :fr. Reason: {:options, {:cacertfile, '../../ca-certificates/extracted/tls-ca-bundle.pem', {:error, :enoent}}} 00:46:49.793 [error] Failed to connect to 'raw.githubusercontent.com' to download locale :he. Reason: {:options, {:cacertfile, '../../ca-certificates/extracted/tls-ca-bundle.pem', {:error, :enoent}}} 00:46:49.809 [error] Failed to connect to 'raw.githubusercontent.com' to download locale :se. Reason: {:options, {:cacertfile, '../../ca-certificates/extracted/tls-ca-bundle.pem', {:error, :enoent}}} 00:46:49.824 [error] Failed to connect to 'raw.githubusercontent.com' to download locale :"se-SE". Reason: {:options, {:cacertfile, '../../ca-certificates/extracted/tls-ca-bundle.pem', {:error, :enoent}}} ```
kipcole9 commented 1 year ago

Nice work @Awlexus , really appreciate it - will publish to hex in the next couple of hours!

kipcole9 commented 1 year ago

🥳🥳🥳🥳🥳