feat: add Lao (lo-LA) locale - #2444
Merged
Merged
Conversation
Adds cardinal, currency and ordinal support for Lao.
Lao is not Thai with different glyphs, so lo-LA is not a copy of th-TH:
- 20 is ຊາວ, not a compound of ສອງ and ສິບ.
- A trailing 1 after any ten is ເອັດ (ສິບເອັດ, ຊາວເອັດ, ເກົ້າສິບເອັດ).
These are carried by exactWordsMapping, which the converter also consults
for chunk remainders, so 121 resolves to ໜຶ່ງຮ້ອຍຊາວເອັດ.
- 100,000 has a named scale word (ແສນ) but 10,000 does not: written Lao
finance reads it as ສິບພັນ rather than the spoken ໝື່ນ, so 10^4 is left
unnamed and composed from ພັນ.
Ordinals use the prefix ທີ, so ordinalPrefix is used rather than a
per-number ordinal mapping, matching the approach taken by km-KH.
The kip subunit (ອັດ / att) is defunct, so fractional currency amounts are
read as a decimal instead of being given a subunit name. texts.and supplies
the leading ຈຸດ, because the currency converter emits it before the
fractional words while a fractionalUnit name would follow them. One
consequence worth noting: convert(n, { useAnd: true }) now inserts ຈຸດ
between a unit word and its remainder. Lao uses no conjunction in numbers,
so useAnd is not meaningful for this locale either way.
Also bumps the full UMD gzip budget from 70.5 KiB to 71 KiB, which the new
locale pushes past, and updates the locale counts in docs and smoke checks.
Closes mastermunj#2443
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2444 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 144 145 +1
Lines 2281 2291 +10
Branches 352 349 -3
=========================================
+ Hits 2281 2291 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
|
Thank you for your contribution @xubmuajkub. Release v7.1.0 |
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.
Closes #2443
Adds cardinal, currency and ordinal support for Lao.
Why this is not a copy of
th-THLao shares script ancestry and scale vocabulary with Thai, but three things differ:
The ເອັດ forms are carried by
exactWordsMapping.convertInternalconsults it for chunk remainders as well as whole numbers, so121resolves to ໜຶ່ງຮ້ອຍຊາວເອັດ without needing an entry per hundred.Scale
100,000 has a named scale word (ແສນ), but 10,000 does not get one: written Lao finance reads it as ສິບພັນ rather than the spoken ໝື່ນ. Leaving 10^4 unnamed lets the composer build it from ພັນ.
Ordinals
Lao forms ordinals with the prefix ທີ, so this uses
ordinalPrefixrather than a per-numberordinalWordsMapping, matchingkm-KH.toOrdinal(21)→ ທີຊາວເອັດ.Currency
The kip subunit (ອັດ / att) is defunct and not used in practice, so fractional amounts are read as a decimal instead of being given a subunit name:
One thing I would like a maintainer's opinion on.
texts.andsupplies that leading ຈຸດ, because the currency converter emitstexts.andbefore the fractional words while afractionalUnitname would follow them. The side effect is thatconvert(n, { useAnd: true })now inserts ຈຸດ between a unit word and its remainder. Lao uses no conjunction inside numbers, souseAndis not meaningful for this locale either way — but if you would rather not overloadtexts.and, I am happy to drop the ຈຸດ and emit the bare digits instead, or to rework it against a small core change.Bundle size budget
The new locale pushes the full UMD build to 70.79 KB gzip, just past the existing 70.50 KiB ceiling, so
SIZE_BUDGETS.fullGzippedis raised to 71 KiB. Per-locale budgets are untouched.Verification
All steps from CONTRIBUTING pass, plus
docs:check:npm run formatreports one pre-existing issue inCHANGELOG.mdthat is also present on a cleanmain; left untouched.Also updated
SUPPORTED_LOCALEScount 135 → 136 in the manifest test, runtime smoke check, README and docslocale-specificnumbering-system count 4 → 5losubtagdocs/locales/lao.md, locales index, VitePress sidebar,NumberDemo.vue🤖 Generated with Claude Code