fix(locale): add BYN, VES and ZMW to the currencies list by MateenAkram1 · Pull Request #14660 · appwrite/appwrite · GitHub
Skip to content

fix(locale): add BYN, VES and ZMW to the currencies list - #14660

Open
MateenAkram1 wants to merge 4 commits into
appwrite:mainfrom
MateenAkram1:fix-locale-currencies
Open

MateenAkram1 wants to merge 4 commits into
appwrite:mainfrom
MateenAkram1:fix-locale-currencies

Conversation

@MateenAkram1

Copy link
Copy Markdown

What does this PR do?

GET /v1/locale/currencies returns only the withdrawn ISO 4217 code for three countries, and not the code that replaced it:

Country In the list Withdrawn Replacement
Belarus BYR 2016-07-01 BYN
Venezuela VEF 2018-08-20 VES
Zambia ZMK 2013-01-01 ZMW

So an app building a currency picker from the Locale API can't offer the currency these countries use today. The redenominations also changed the minor unit, so amounts entered against the old code come out at the wrong scale.

This PR adds BYN, VES and ZMW to app/config/locale/currencies.php:

  • Each entry sits in alphabetical order next to the code it replaces and uses the same shape as the rest of the file.
  • Values follow Unicode CLDR: symbolNative is Br, Bs.S and K, with 2 decimal digits and rounding 0 for all three, matching ISO 4217.
  • BYR, VEF and ZMK are unchanged, so apps that already store those codes keep resolving them. This matches how the file already keeps EEK, HRK, LTL, LVL and BGN next to EUR.
  • locations is left empty on the new entries, so the currency GET /v1/locale resolves is unchanged.

Test Plan

  • Updated testGetCurrencies in tests/e2e/Services/Locale/LocaleBase.php, which runs for console, client and server:
    • The total changes from 117 to 120.
    • BYN, VES and ZMW must be returned with decimalDigits 2.
    • BYR, VEF and ZMK must still be returned.
  • Ran the updated test against the old list to confirm it fails there (117 ≠ 120).
  • Locally:
    • curl -H "X-Appwrite-Project: console" http://localhost/v1/locale/currencies returns total: 120 with all six codes.
    • Locale e2e suite (paratest --functional): 31 tests passed.
    • tests/e2e/Services/GraphQL/LocalizationTest.php passed.
    • tests/unit/Geo passed.
    • composer lint passes for both files.

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs? (No API metadata changes; data only.)

GET /v1/locale/currencies (locale.listCurrencies in the SDKs and
localeListCurrencies in GraphQL) returns the curated list in
app/config/locale/currencies.php. For three countries that list held
only a code ISO 4217 has withdrawn, and not its replacement:

  Belarus    BYR  withdrawn 2016-07-01  replaced by BYN
  Venezuela  VEF  withdrawn 2018-08-20  replaced by VES
  Zambia     ZMK  withdrawn 2013-01-01  replaced by ZMW

Apps building a currency picker from the Locale API could not offer the
currency in circulation in these countries. The redenominations also
changed the minor unit, so amounts entered against an old code are
scaled wrongly for the current one.

Changes:

- Add BYN, VES and ZMW to app/config/locale/currencies.php, each in its
  alphabetical position next to the code it replaces, using the same
  entry shape as the rest of the file. Values follow Unicode CLDR:
  English symbol as symbol, the country locale's symbol as symbolNative
  (Br, Bs.S, K), and two decimal digits with no rounding for all three,
  matching their ISO 4217 minor unit.
- Keep BYR, VEF and ZMK unchanged. Apps may already store these codes
  and look up their symbol, name or decimal digits by code, so removing
  them would break those lookups. This matches how the file already
  keeps EEK, HRK, LTL, LVL and BGN alongside EUR.
- Leave locations empty on the new entries, like most of the list, so
  the currency resolved by GET /v1/locale is unchanged.
- Update testGetCurrencies in tests/e2e/Services/Locale/LocaleBase.php:
  the total goes from 117 to 120, BYN, VES and ZMW must be returned
  with two decimal digits, and BYR, VEF and ZMK must still be returned.
  The trait runs on the console, client and server sides.

Fixes appwrite#14627
@hansi-codes

hansi-codes Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Tier S · Ready to merge

The additions match the requested catalog behavior, and the updated e2e coverage verifies the new and preserved codes.

Adds BYN, VES, and ZMW to the Locale API currency catalog while retaining the withdrawn codes. Updates the Locale e2e test to verify the catalog count and both current and legacy currency codes.

Verdict New comments Fixed Still open
💬 Commented 0 0 0

Note

@MateenAkram1 does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve.

📂 Walkthrough · 2
File Change
app/config/locale/currencies.php Adds the three current currency entries alongside their withdrawn predecessors.
tests/e2e/Services/Locale/LocaleBase.php Checks the updated total and confirms the current and legacy codes are returned.

Merged main (b69230d); no changes to this PR's code since 961263c · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

@MateenAkram1

Copy link
Copy Markdown
Author

This branch has not been deployed

No deployments
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.

Locale currencies list offers only withdrawn codes for Belarus, Venezuela and Zambia

1 participant