Conversation
WalkthroughRefactors order description title generation by introducing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
bot/ordersActions.ts (1)
244-250:⚠️ Potential issue | 🟠 MajorRemove unused
amountTextto unblock lint.
amountTextis assigned but never read (Line 244 / Line 247), and CI is failing ontypescript-eslint/no-unused-vars.🧹 Suggested fix
- let amountText = `${numberFormat(fiatCode, amount)} `; let tasaText = ''; if (priceFromAPI) { - amountText = ''; tasaText = i18n.t('rate') + `: ${process.env.FIAT_RATE_NAME} ${priceMarginText}\n`; } else {As per coding guidelines, "Follow ESLint Standard plus TypeScript rules and address warnings instead of disabling them".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bot/ordersActions.ts` around lines 244 - 250, The variable amountText is assigned but never used in the block guarded by priceFromAPI causing a lint error; remove the unused assignment and any redundant initialization of amountText and instead only set tasaText when priceFromAPI is truthy (keep the existing use of tasaText, priceFromAPI, numberFormat, fiatCode and amount elsewhere intact), or collapse the conditional so amountText is not declared at all in this scope—ensure references to amountText elsewhere are preserved or replaced if they relied on this value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@locales/fr.yaml`:
- Line 441: The French translation key showusername_selling_sats uses the
incorrect verb form "vent"; update its value to use the singular conjugation
"vend" so the line reads showusername_selling_sats: "@${username} vend des sats"
to match the singular subject interpolation @${username}.
---
Outside diff comments:
In `@bot/ordersActions.ts`:
- Around line 244-250: The variable amountText is assigned but never used in the
block guarded by priceFromAPI causing a lint error; remove the unused assignment
and any redundant initialization of amountText and instead only set tasaText
when priceFromAPI is truthy (keep the existing use of tasaText, priceFromAPI,
numberFormat, fiatCode and amount elsewhere intact), or collapse the conditional
so amountText is not declared at all in this scope—ensure references to
amountText elsewhere are preserved or replaced if they relied on this value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d052ce83-ced9-4825-b670-f78bd928e73d
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (12)
bot/ordersActions.tslocales/de.yamllocales/en.yamllocales/es.yamllocales/fa.yamllocales/fr.yamllocales/it.yamllocales/ko.yamllocales/pt.yamllocales/ru.yamllocales/uk.yamlpackage.json
| buying_sats: Achat de sats | ||
| receive_payment: Réception du paiement | ||
| showusername_buying_sats: "@${username} achète des sats" | ||
| showusername_selling_sats: "@${username} vent des sats" |
There was a problem hiding this comment.
Fix French conjugation in username sell sentence.
Line 441 currently says vent; it should be vend for singular subject (@${username}).
✏️ Proposed fix
-showusername_selling_sats: "@${username} vent des sats"
+showusername_selling_sats: "@${username} vend des sats"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| showusername_selling_sats: "@${username} vent des sats" | |
| showusername_selling_sats: "@${username} vend des sats" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@locales/fr.yaml` at line 441, The French translation key
showusername_selling_sats uses the incorrect verb form "vent"; update its value
to use the singular conjugation "vend" so the line reads
showusername_selling_sats: "@${username} vend des sats" to match the singular
subject interpolation @${username}.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
bot/ordersActions.ts (1)
263-296:⚠️ Potential issue | 🟡 MinorFix Prettier formatting before merging.
The CI pipeline reports formatting violations on these lines. As per coding guidelines, run Prettier before committing.
npm run format🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bot/ordersActions.ts` around lines 263 - 296, The file has Prettier formatting issues; run the formatter and fix whitespace/line breaks around the description assembly in the ordersActions.ts function (the multi-line description construction and related template strings) and ensure getOrderTitleMessage remains unchanged in behavior; run "npm run format" and commit the formatted changes so the CI formatting checks pass.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@bot/ordersActions.ts`:
- Around line 263-296: The file has Prettier formatting issues; run the
formatter and fix whitespace/line breaks around the description assembly in the
ordersActions.ts function (the multi-line description construction and related
template strings) and ensure getOrderTitleMessage remains unchanged in behavior;
run "npm run format" and commit the formatted changes so the CI formatting
checks pass.
|
utACK, pls fix CI |
Improve i18n flexibility for showusername order sentences
Problem
When a user sets
/showusername yesand creates an order, the bot constructs a sentence using several isolated one-word strings fromlocales/en.yaml(lines 442–456):This produces sentences like:
This approach assumes English word order, which breaks natural phrasing in many other languages. Translators are forced to work around a fixed sentence structure they have no control over.
A concrete example is Persian (Farsi), an RTL language. Telegram determines text direction based on the first character of each line. Since
@usernamealways comes first and@is an LTR character, the entire line is rendered LTR — making Persian text appear incorrectly. A common workaround is prepending a native word (e.g. "کاربر" meaning "User") to trigger RTL rendering, but the current string structure makes this impossible.Solution
Replace the four isolated strings with two complete, context-aware strings:
This gives translators full control over word order, sentence structure, and the ability to add language-specific words where needed — without changing the meaning for English speakers.
Changes
selling,buying,is, andsatsentries used for order sentence construction fromlocales/en.yamlshowusername_buyandshowusername_sellwith interpolated${username}Summary by CodeRabbit