#1966·Humanizer

Portuguese locale: incorrect `milhar` value and misspelled `milissegundo`

Author: rodri-oliveira-devCreated Sep 6, 2026Updated Sep 6, 2026

While reviewing the Portuguese localization files, I noticed two issues in src/Humanizer/Locales/pt.yml.

1. milhar is mapped to 1,000,000,000

The Portuguese cardinal map currently contains:

yaml
mil: 1000
'milhão': 1000000
'milhões': 1000000
milhar: 1000000000

However, milhar means one thousand (1,000), not one billion.

Since the words-to-number parser checks the cardinal map directly, parsing "milhar" may return 1_000_000_000 instead of 1_000.

I believe the correct mapping should be:

yaml
milhar: 1000

It would also be useful to add regression coverage for this behavior.

2. milisegundo should be milissegundo

The duration section currently contains forms such as:

yaml
numeric: '1 milisegundo'
words: 'um milisegundo'
default: 'milisegundos'
singular: 'milisegundo'

The correct Portuguese spelling is milissegundo, with a double s.

Interestingly, the relativeDate section of the same locale already uses the correct spelling (milissegundo / milissegundos), so the locale is currently inconsistent.

There is also test data that expects milisegundos, so those expectations would need to be updated together with the locale.

Expected changes

  • Change milhar from 1_000_000_000 to 1_000.
  • Add regression tests for parsing milhar.
  • Change milisegundo / milisegundos to milissegundo / milissegundos.
  • Update the related localization tests.

If the maintainers agree that these are valid corrections, I'd be happy to submit a PR with the changes and regression tests.