Skip to content

A complete Persian (FA) translation and some minor corrections in the English file#711

Merged
grunch merged 16 commits intolnp2pBot:mainfrom
RamzArzFarsi:main
Feb 25, 2026
Merged

A complete Persian (FA) translation and some minor corrections in the English file#711
grunch merged 16 commits intolnp2pBot:mainfrom
RamzArzFarsi:main

Conversation

@RamzArzFarsi
Copy link
Copy Markdown
Contributor

@RamzArzFarsi RamzArzFarsi commented Dec 12, 2025

The Persian translation file has weird phrasings and feels like a draft LLM translation.
This PR aims to replace it with a more refined and natural-sounding Persian translation done manually (no LLM is used).

Additionally, three minor mistakes were found in the English file along the way, which are also corrected by this PR.

Summary by CodeRabbit

  • Bug Fixes
    • Updated buy flow to use /fiatsent command after Fiat payment and added seller-confirmation step before satoshis are sent.
    • Corrected sell format guidance to properly indicate satoshis amount for the surplus parameter.
    • Fixed image processing error message wording and formatting.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 12, 2025

Walkthrough

Updated the English localization file (locales/en.yaml): changed buy-flow follow-up command from /release to /fiatsent, added a seller-confirmation step before sats are sent, corrected sell guidance to reference sats for the surplus parameter, and made minor wording and newline/formatting adjustments (including image-processing error text).

Changes

Cohort / File(s) Summary
Localization updates
locales/en.yaml
Replaced /release with /fiatsent in buy-flow instructions and introduced a seller-confirmation step; corrected surplus description to indicate sats (not fiat); fixed wording/newline handling for image-processing and other messages.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • Update fa.yaml #707 — edits to localization strings (includes image_processing_error and trading-related keys) that overlap with these message changes.

Suggested reviewers

  • grunch

Poem

🐰 I nibbled text and hopped a beat,
Swapped a command and fixed a seat,
Sats now whisper where numbers stood,
A seller nod keeps flow in good,
Tiny hops, the messages sweet. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes adding a Persian translation and English corrections, but the raw_summary shows only minor English changes with no Persian file modifications. Update the title to accurately reflect the actual changes shown in the diff, or ensure the Persian translation file changes are included in the pull request.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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)
locales/en.yaml (1)

428-435: Template variable rename creates breaking change: code still passes id but en.yaml expects orderId.

The code in bot/messages.ts (line 1854) passes id: order._id to render pending_payment_success, but the en.yaml template now expects ${orderId}. This mismatch will cause the order ID to render blank for English users. Synchronize the parameter name in the code to orderId to match the template, or revert the template variable back to ${id}.

Note: Other locale files (it, pt, ru, ko, uk, es, fa, fr, de) still use ${id} in their pending_payment_success templates, so only en.yaml was changed. This inconsistency across locales should also be addressed.

🧹 Nitpick comments (2)
locales/en.yaml (2)

25-25: Clarify /fiatsent usage (with/without order id) to match the bot’s actual command signature.
Right now the instructions say “use the /fiatsent command”, but /help documents /fiatsent <_order id_> while other copy shows /fiatsent without an id (e.g., fiatsent_order_cmd: /fiatsent). If the handler requires an id, this line should say /fiatsent ${orderId} (or explicitly mention selecting the order in-chat).


82-88: Wording is still ambiguous (“add the parameter 0 indicating sats amount”).
Consider tightening to “add 0 as the sats amount” and split the sentence for readability.

-  In order to create a sale with a surplus in the price of 3% \(premium\) you need to add the parameter 0 indicating sats amount\. The bot will calculate the selling price using the Bitcoin market price and applying the indicated surplus, you need to add 3 as the last parameter
+  To create a sale with a 3% premium, set the sats amount to 0\. The bot will calculate the sats amount from the market price and apply the premium\. Then add 3 as the last parameter\.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 875ede4 and a1fe355.

📒 Files selected for processing (1)
  • locales/en.yaml (4 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: lnp2pBot/bot PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-22T14:03:55.114Z
Learning: Applies to {bot/**,locales/*.json} : Pair new bot flows with corresponding text updates under locales/
📚 Learning: 2025-08-14T18:53:14.640Z
Learnt from: CR
Repo: lnp2pBot/bot PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-14T18:53:14.640Z
Learning: Follow the Lightning Network hold-invoice escrow flow for buy and sell orders as documented

Applied to files:

  • locales/en.yaml

Comment thread locales/en.yaml Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Comment thread locales/en.yaml Outdated
Proof of payment: ${paymentSecret}
pending_payment_success: |
I have paid the lightning invoice for ${amount} satoshis, order ID: ${id}!
I have paid the lightning invoice for ${amount} satoshis, order ID: ${orderId}!
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @RamzArzFarsi Thanks for your first contribution!
Was there a specific reason for changing it to ${orderId}?
${id} was used because this template serves dual purposes, it handles both order payments (order._id) and community payments (community.id).
Just want to make sure we maintain compatibility with both use cases.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I noticed the order ID placeholder was ${orderId} in the entire file except for this one particular place. I assumed it must be a typo.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is not a typo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed it back.

Comment thread locales/fa.yaml
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The old Persian file had weird phrasings and felt like a draft LLM translation.
This is a more refined and natural-sounding translation done manually (no LLM was used).

Comment thread locales/fa.yaml Outdated

`/buy 1000 50000 IRT "پرداخت با عابربانک"`
`/sell 1000 300000 IRT "کارت به کارت"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should be /buy, not sell

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed👍

Copy link
Copy Markdown
Member

@Catrya Catrya left a comment

Choose a reason for hiding this comment

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

Hi @RamzArzFarsi , it won't compile; there are errors with the location keys. This is what appears when trying to compile:

[2025-12-15T16:52:25.134-06:00] error: Unhandled Rejection: YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key (10:62)

  7 |  ... 
  8 |  ... ‌های پایاپای بیت‌کوین روی شبکه لایتنینگ کمک می‌کند.
  9 |  ... 
 10 |  ... د از دستورهای زیر استفاده کنید:
-----------------------------------------^
 11 |  ... 
 12 |  ... ستورهای /buy (خرید) یا /sell (فروش) منتشر کنید و از دستورالعم ... 

@RamzArzFarsi
Copy link
Copy Markdown
Contributor Author

Hi @RamzArzFarsi , it won't compile; there are errors with the location keys. This is what appears when trying to compile:

[2025-12-15T16:52:25.134-06:00] error: Unhandled Rejection: YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key (10:62)

  7 |  ... 
  8 |  ... ‌های پایاپای بیت‌کوین روی شبکه لایتنینگ کمک می‌کند.
  9 |  ... 
 10 |  ... د از دستورهای زیر استفاده کنید:
-----------------------------------------^
 11 |  ... 
 12 |  ... ستورهای /buy (خرید) یا /sell (فروش) منتشر کنید و از دستورالعم ... 

The compiling error should be gone now. Please try again and let me know if there are any more errors.

@RamzArzFarsi RamzArzFarsi requested a review from Catrya December 16, 2025 10:13
Copy link
Copy Markdown
Collaborator

@Luquitasjeffrey Luquitasjeffrey left a comment

Choose a reason for hiding this comment

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

Hi @RamzArzFarsi, I pulled your pr on my local and I'm still getting the same error:

[2025-12-17T18:40:51.873-03:00] error: Unhandled Rejection: YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key (10:64)

7 | ...
8 | ... ‌های پایاپای بیت‌کوین روی شبکه لایتنینگ کمک می‌کند.
9 | ...
10 | ... د از دستورهای زیر استفاده کنید:
-----------------------------------------^
11 | ...
12 | ... ستورهای /buy (خرید) یا /sell (فروش) منتشر کنید و از دستورالعم ...

Please fix your syntax in the fa.yaml file so we can proceed with your pr.
Thanks

Copy link
Copy Markdown
Member

@Catrya Catrya left a comment

Choose a reason for hiding this comment

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

As @Luquitasjeffrey said, it still doesn't work
The bot compiles but crashes on startup due to YAML syntax errors in fa.yaml. The translation file has invalid formatting that prevents the bot from starting. This needs to be fixed.

Updated Persian translations for disclaimer and instructions.
Corrected pluralization in Persian translations for various terms.
Copy link
Copy Markdown
Collaborator

@Luquitasjeffrey Luquitasjeffrey left a comment

Choose a reason for hiding this comment

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

Now your pr is Ok. It can be merged to the main branch

@RamzArzFarsi
Copy link
Copy Markdown
Contributor Author

Please merge the PR if no further action is needed from my side.
And happy holidays to you. 🙂

@knocte
Copy link
Copy Markdown
Collaborator

knocte commented Jan 3, 2026

@RamzArzFarsi can you please edit PR title and description to have something that makes sense there?

@RamzArzFarsi RamzArzFarsi changed the title en.yaml A complete Persian (FA) translation and some minor corrections in the English file Jan 6, 2026
@RamzArzFarsi
Copy link
Copy Markdown
Contributor Author

The PR is renamed.

@knocte
Copy link
Copy Markdown
Collaborator

knocte commented Jan 6, 2026

Please replace the "Summary by CodeRabbit" with something that actually applies.

@knocte
Copy link
Copy Markdown
Collaborator

knocte commented Jan 6, 2026

@aarani can you review?

@Luquitasjeffrey
Copy link
Copy Markdown
Collaborator

Hi @RamzArzFarsi. Please solve your conflicts with the main branch so we can proceed reviewing and merging this pr

Copy link
Copy Markdown
Collaborator

@Luquitasjeffrey Luquitasjeffrey left a comment

Choose a reason for hiding this comment

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

Please fix your conflicts with main so we can proceed merging your pr

@grunch
Copy link
Copy Markdown
Member

grunch commented Jan 23, 2026

@RamzArzFarsi can you please fix the conflicts and rebase?

@RamzArzFarsi
Copy link
Copy Markdown
Contributor Author

I apologise for the delay. The recent events in Iran suddenly made me extremely busy. Thank you for your patience and understanding.

Copy link
Copy Markdown
Contributor

@mostronatorcoder mostronatorcoder Bot left a comment

Choose a reason for hiding this comment

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

Review ✅

Good work on this PR. I verified the following:

en.yaml fixes (3 corrections) ✅

  1. Step 7: /release/fiatsent for the buyer flow — correct, buyers use /fiatsent after paying fiat, not /release
  2. sell_correct_format: "fiat amount" → "sats amount" — correct, the 0 parameter indicates sats amount (letting the bot calculate price from market rate)
  3. image_processing_error: "wait few minutes" → "wait a few minutes" — grammar fix

fa.yaml (Persian translation) ✅

  • YAML syntax is valid — the parsing error reported earlier has been fixed
  • 279 of 280 keys present — only counterparty_wants_cooperativecancel is missing (was added to main after this PR was created, can be addressed in a follow-up)
  • Conflicts with main resolved — merge commit on Feb 4
  • Translation appears to be a thorough manual rewrite (not LLM-generated) with more natural Persian phrasing
  • Examples updated with more realistic IRT values (300,000 instead of 50,000)
  • /fiatsent correction carried through consistently to the Persian translation as well

Minor note

  • Missing key counterparty_wants_cooperativecancel in fa.yaml — this was added to main after the PR was created. Should be added in a follow-up PR or the contributor can add it before merge.

Approved — the English fixes are correct and important, and the Persian translation is a significant quality improvement.

Copy link
Copy Markdown
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

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

LGTM

@grunch grunch merged commit 6c45629 into lnp2pBot:main Feb 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants