Repository navigation
feat(i18n): show costs in yuan for Simplified Chinese - #1398
Open
dingxiaobo wants to merge 1 commit into
Open
dingxiaobo wants to merge 1 commit into
dingxiaobo wants to merge 1 commit into
Conversation
Costs stay stored in dollars — pi's usage.cost, the models.dev catalog and models.json's unit prices — and only the display converts. lib/money.ts is the one place that converts: zh-CN multiplies by a hardcoded rate (1 USD = 6.69 CNY, taken 2026-10-23), zh-TW and en pass amounts through. formatCostShort, formatNoticeCost, formatCacheWarmCost and formatCodemodeCost take the locale as their last argument rather than reading context, so they stay pure; components hand in useI18n().locale, and transcriptNoticeText, cacheMissSummaryText and ProcessDetailsGroup pass it down. The one-cent threshold is read in the displayed currency, so $0.002 shows as <$0.01 in English and as ¥0.01 in Simplified Chinese. Settings › Models keeps its USD unit prices, because those inputs write that value back to models.json, and ProviderUsageSummary keeps each provider's own currency: real balances, not a converted figure. (cherry picked from commit 8acd89eae96f58665ba88eb792cca3d1bbb92c97)
This was referenced Oct 25, 2026
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.
Costs stay stored in dollars — pi's usage.cost, the models.dev catalog and models.json's unit prices — and only the display converts. lib/money.ts is the one place that converts: zh-CN multiplies by a hardcoded rate (1 USD = 6.69 CNY, taken 2026-10-23), zh-TW and en pass amounts through.
formatCostShort, formatNoticeCost, formatCacheWarmCost and formatCodemodeCost take the locale as their last argument rather than reading context, so they stay pure; components hand in useI18n().locale, and transcriptNoticeText, cacheMissSummaryText and ProcessDetailsGroup pass it down. The one-cent threshold is read in the displayed currency, so $0.002 shows as <$0.01 in English and as ¥0.01 in Simplified Chinese.
Settings › Models keeps its USD unit prices, because those inputs write that value back to models.json, and ProviderUsageSummary keeps each provider's own currency: real balances, not a converted figure.
(cherry picked from commit 8acd89eae96f58665ba88eb792cca3d1bbb92c97)