Skip to content

Feat: Add dynamic {problems_pluralize} variable #384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Slipstreamm
Copy link

This pull request introduces changes to improve the handling of problem count pluralization in status messages and refactors related code for better readability and maintainability.

Improvements to status message pluralization:

  • package.json: Updated the default value of vscord.status.problems.text to include {problems_pluralize}, allowing dynamic pluralization of the word "problem" based on the count.

Code refactoring for problem count handling:

  • src/activity.ts: Introduced a totalProblems variable to centralize the calculation of the total problem count, replacing duplicate logic in the replaceMap.
  • src/activity.ts: Added a new placeholder {problems_pluralize} to the replaceMap, dynamically setting it to "problem" or "problems" based on the value of totalProblems.

This commit introduces a new `{problems_pluralize}` variable to the `replaceMap` in `src/activity.ts`.

This variable dynamically resolves to "problem" or "problems" based on the total number of problems detected, allowing for more natural language in the user's status.

The `{problems_count}` variable is now derived from a `totalProblems` constant for consistency.
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.

1 participant