Skip to content

Initial commit of numbers to words converter in Dutch#218

Merged
smeech merged 4 commits into
espanso:mainfrom
brentgees:main
May 14, 2026
Merged

Initial commit of numbers to words converter in Dutch#218
smeech merged 4 commits into
espanso:mainfrom
brentgees:main

Conversation

@brentgees
Copy link
Copy Markdown
Contributor

Based on the website https://www.zegge.nu where you can convert numbers to full written-out words

number.to.words.converter.mp4

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces an Espanso package to convert numeric currency amounts into fully written-out Dutch text (based on zegge.nu).

Changes:

  • Added package metadata via _manifest.yml.
  • Added Espanso match configuration and an embedded Python converter script in package.yml.
  • Added usage and installation documentation in README.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
packages/number-to-words-nl/0.1.0/README.md Documents the package purpose, install command, and basic usage.
packages/number-to-words-nl/0.1.0/package.yml Defines the :nr trigger, input form, and Python-based conversion logic.
packages/number-to-words-nl/0.1.0/_manifest.yml Adds Espanso Hub manifest metadata (name/version/tags).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/number-to-words-nl/0.1.0/README.md Outdated
Comment thread packages/number-to-words-nl/0.1.0/_manifest.yml Outdated
Comment on lines +20 to +23
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')

getal = '{{form1.getal}}'

Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User-provided form input is interpolated directly into the Python source (getal = '{{form1.getal}}'). If the input contains a single quote/newline it can break the string literal and inject arbitrary Python code. Pass the value as a separate argv argument (or encode via JSON) and read it from sys.argv instead of templating it into the script.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not overly concerned about this - all data entered is going to come locally from the user. If they want to try and inject arbitrary Python code that's up to them.

Comment thread packages/number-to-words-nl/0.1.0/package.yml
Comment thread packages/number-to-words-nl/0.1.0/README.md Outdated
Copy link
Copy Markdown
Collaborator

@smeech smeech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fun package to convert numbers to Dutch written currency text. Uses an inline Python script to process the data entered via a form. The script appears benign, with no malicious code.

I've let Copilot do its stuff and it raises a number of issues, some of which need addressing and others which can be ignored - see my notes.

There are some minor inconsistencies in use, but these may be intentional:

12.34→twaalf euro en vierendertig eurocent
12,34→twaalf euro en vierendertig eurocent
12.345→twaalfduizend driehonderdvijfenveertig euro
12,345→twaalfduizend driehonderdvijfenveertig euro

It doesn't distinguish between periods . and commas ,, which I suppose allows for Dutch and English number formats to be used.

Comment thread packages/number-to-words-nl/0.1.0/README.md Outdated
Comment thread packages/number-to-words-nl/0.1.0/README.md Outdated
Comment on lines +20 to +23
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')

getal = '{{form1.getal}}'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not overly concerned about this - all data entered is going to come locally from the user. If they want to try and inject arbitrary Python code that's up to them.

Comment thread packages/number-to-words-nl/0.1.0/_manifest.yml Outdated
Comment thread packages/number-to-words-nl/0.1.0/package.yml
brentgees and others added 3 commits May 13, 2026 15:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Removed installation instructions from README.
@brentgees
Copy link
Copy Markdown
Contributor Author

Applied the suggested changes where necessary,

The periods and commas was indeed intentional to allow multiple input formats.

Copy link
Copy Markdown
Collaborator

@smeech smeech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. That looks better.

I'll re-run Copilot and the automated checks and merge if all is well.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment on lines +9 to +10
- 150 becomes honderdvijftig euro
- 1 009 123,50 becomes een miljoen negenduizend honderddrieëntwintig euro en vijftig eurocent
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not concerned.

Comment on lines +74 to +92
# Zoek het laatste scheidingsteken (. of ,)
laatste_punt = getal_str.rfind('.')
laatste_komma = getal_str.rfind(',')
laatste_scheiding = max(laatste_punt, laatste_komma)

if laatste_scheiding > 0:
# Controleer of er 1 of 2 cijfers na het laatste scheidingsteken staan
na_scheiding = getal_str[laatste_scheiding + 1:]
if len(na_scheiding) <= 2 and na_scheiding.isdigit():
# Dit is het decimaalteken
hoofdgetal = getal_str[:laatste_scheiding].replace('.', '').replace(',', '')
decimalen = (na_scheiding + '00')[:2]
else:
# Geen decimalen, alles is hoofdgetal
hoofdgetal = getal_str.replace('.', '').replace(',', '')
decimalen = ''
else:
hoofdgetal = getal_str
decimalen = ''
@smeech smeech merged commit 7dd4d94 into espanso:main May 14, 2026
5 checks passed
@smeech
Copy link
Copy Markdown
Collaborator

smeech commented May 14, 2026

Merged - it'll take a few hours to appear on the Hub website.

Thank you.

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.

4 participants