Skip to content

Add pronounced option tests (for :en & :nl)#214

Open
Wessel-Boers wants to merge 1 commit intokslazarev:masterfrom
Wessel-Boers:spoken-option
Open

Add pronounced option tests (for :en & :nl)#214
Wessel-Boers wants to merge 1 commit intokslazarev:masterfrom
Wessel-Boers:spoken-option

Conversation

@Wessel-Boers
Copy link
Copy Markdown

This PR is the result of a conversation from issue #213 . This issue discusses the introduction of an option that would make numbers -> words as they are spoken.

For example:

I18n.with_locale(:en) { 1100.to_words pronounced: false }
=> "one thousand one hundred" # This is not how we pronounce the year 1100.

I18n.with_locale(:en) { 1100.to_words pronounced: true }
=> "eleven hunderd" # This is how we would pronounce the year 1100.

However! While looking through the code, I came across an option for only the English locale that already implements this! It's the pronounced option. Although not mentioned as an option in the README, it already does what we've discussed.

I could not find tests for this option for the English locale. This PR adds tests that should pass. It also adds failing tests for the Dutch (:nl) locale.

I propose that the README is updated, so everyone can find about this option. And hopefully we can implement the functionality for other languages as well.

@dblock
Copy link
Copy Markdown
Collaborator

dblock commented Feb 1, 2026

Thanks, try to implement it?

I am not in love with "pronounced", maybe "spoken", or an interface that can be more common across other languages such as dialect: :spoken? Other suggestions?

@dblock
Copy link
Copy Markdown
Collaborator

dblock commented Feb 1, 2026

Thanks, try to implement it?

I am not in love with "pronounced", maybe "spoken", or an interface that can be more common across other languages such as dialect: :spoken? Other suggestions?

Oh I just saw #213 (comment)! If we already have that in English then we should absolutely do this in other languages. Try to implement this and document it for English as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants