{{ message }}
Repository navigation
fix(locale): add BYN, VES and ZMW to the currencies list - #14660
Open
MateenAkram1 wants to merge 4 commits into
Open
MateenAkram1 wants to merge 4 commits into
MateenAkram1 wants to merge 4 commits into
Conversation
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
Contributor
🟢 Tier S · Ready to merge
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.
Note @MateenAkram1 does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve. 📂 Walkthrough · 2
Merged |
Author
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
GET /v1/locale/currenciesreturns only the withdrawn ISO 4217 code for three countries, and not the code that replaced it:BYRBYNVEFVESZMKZMWSo 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,VESandZMWtoapp/config/locale/currencies.php:symbolNativeisBr,Bs.SandK, with 2 decimal digits and rounding0for all three, matching ISO 4217.BYR,VEFandZMKare unchanged, so apps that already store those codes keep resolving them. This matches how the file already keepsEEK,HRK,LTL,LVLandBGNnext toEUR.locationsis left empty on the new entries, so the currencyGET /v1/localeresolves is unchanged.Test Plan
testGetCurrenciesintests/e2e/Services/Locale/LocaleBase.php, which runs for console, client and server:BYN,VESandZMWmust be returned withdecimalDigits2.BYR,VEFandZMKmust still be returned.117 ≠ 120).curl -H "X-Appwrite-Project: console" http://localhost/v1/locale/currenciesreturnstotal: 120with all six codes.paratest --functional): 31 tests passed.tests/e2e/Services/GraphQL/LocalizationTest.phppassed.tests/unit/Geopassed.composer lintpasses for both files.Related PRs and Issues
Checklist