Skip to content

Conversation

@philipostli
Copy link
Contributor

I have added support for dot-notation to be used on the changelog option.
This will allow for translations to be added to changelog from a github action running the homey cli.

Example:
homey app version patch --changelog.en "Added feature" --changelog.no "Ny funksjon" --commit

Will add:
{
"en": "Added feature",
"no": "Ny funksjon"
}

to the .homechangelog.json-file, and no breaking changes because:
homey app version patch --changelog "Added feature" --commit
will still add the string to "en" tag as before.

Commit message will use from "en" tag as before.

📝 Updated option description with example
@philipostli
Copy link
Contributor Author

@RobinBol Possible review

@RobinBol RobinBol requested a review from jeroenwienk May 23, 2025 08:02
@WeeJeWel
Copy link
Contributor

I like the idea, but the code itself is not quite safe. It would be better to loop the allowed language codes and see if they're provided.

@philipostli
Copy link
Contributor Author

Hm. What if this is the first commit or one wants to add a new language? What part of the code should we check for provided languages? The locales folder is not always used. Translations are not always consistently used in all places. Suggestions:

  1. Use manifest title as reference?
  2. Or just check supported languages as docs say ? They are hardcoded in the translate function.

@WeeJeWel
Copy link
Contributor

The package node-homey-lib exposes all allowed languages. Looping that array, and checking whether changelog.[languageId] exists sounds safest to me.

@philipostli
Copy link
Contributor Author

Right! The way it is done with readme. I added a check with getAppLocales() from homey-lib. Great review comment.

@WeeJeWel WeeJeWel merged commit 3e8f27a into athombv:develop Aug 23, 2025
@WeeJeWel
Copy link
Contributor

Thank you so much! The PR has been merged and released in homey@3.9.2.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants