Skip to content
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

BUGFIX: Wrong plural form in modal of coding contract #1939

Conversation

catloversg
Copy link
Contributor

@catloversg catloversg commented Jan 31, 2025

A player reported this bug on Discord. In that modal, we show 1 tries instead of 1 try. While fixing the bug, I see that we rewrite this snippet everywhere:

count + ` line${count !== 1 ? "s" : ""}`

Therefore, I created a utility function for it. We don't have any plans to support more languages in the near future, so using Intl.PluralRules is a bit unnecessary, but it's still harmless.

I also intentionally skip rewriting some code that I don't think they need to use pluralize. For example:

res += `${seconds} second${!showMilli && secTruncMinutes === 1 ? "" : "s"}`;

(numThreads === 1 ? "" : ` with ${numThreads} threads`) +

Screenshots:

1
2
3
4
5
6
7
8
9

src/utils/I18nUtils.ts Outdated Show resolved Hide resolved
src/utils/I18nUtils.ts Outdated Show resolved Hide resolved
@d0sboots d0sboots merged commit 67aff2a into bitburner-official:dev Feb 2, 2025
5 checks passed
@catloversg catloversg deleted the pull-request/bugfix/wrong-plural-form-in-modal-of-coding-contract branch February 2, 2025 10:28
antoinedube pushed a commit to antoinedube/bitburner-source that referenced this pull request Feb 5, 2025
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