地區設定轉換器
解析地區設定識別符,預覽數字/日期/貨幣格式,並排比較不同地區設定 瀏覽器內快速處理,保護隱私,免費使用,無需註冊。
常用地區設定
Try Common Inputs
無效的地區設定識別符,請輸入有效的 BCP 47 地區標籤。
瀏覽器支援
解析資訊
格式替代
Resolved Locales
Fallback Chain
顯示名稱
資料預覽
數字格式
貨幣格式
日期和時間
相對時間
列表格式
排序
並排比較兩個不同地區設定如何格式化相同的資料。
如何使用
-
1
Paste Any Locale String
Start with browser locales, POSIX values like en_US.UTF-8, script tags like zh_Hans_CN, or an Accept-Language header.
-
2
Normalize The Tag
The tool canonicalizes the value into a BCP 47 locale and shows matching POSIX, HTML lang, and Intl snippets.
-
3
Copy The Right Format
Use the output block that fits your use case: web markup, JavaScript Intl, environment variables, or QA docs.
-
4
Compare Output Differences
Switch to compare mode to inspect how two locales differ for numbers, currency, dates, and collation behavior.
為什麼使用 Be Converter?
瀏覽器原生
由內建 Intl API 驅動,無需伺服器呼叫,無需外部依賴,可離線使用,保護隱私。
即時預覽
輸入時即時查看任何地區設定的數字、日期、貨幣和列表的格式化效果。
Normalize Real Inputs
Paste POSIX locales, ICU-style underscores, or Accept-Language headers and turn them into clean BCP 47 and HTML-ready locale strings.
全面分析
解析地區設定元件,以多種語言顯示名稱,並排比較兩個地區設定。
適用於
常見問題
什麼是地區設定識別符?
BCP 47 和 POSIX 地區格式有什麼區別?
這個工具是如何在沒有伺服器的情況下運作的?
為什麼某些地區設定在不同瀏覽器中顯示不同結果?
"解析後地區設定"是什麼意思?
Common Locale Conversion Examples
These are the most common locale-string cleanup tasks developers and localization teams search for when they need a locale converter online.
en_US.UTF-8
en-US
Convert Unix-style locale environment values into a BCP 47 tag you can use in frontend code.
zh_Hans_CN
zh-Hans-CN
Normalize script subtags with the casing web platforms expect.
sr_RS@latin
sr-Latn-RS
Translate a POSIX modifier into a script-aware locale tag for product localization.
Accept-Language: fr-CA,fr;q=0.9
fr-CA
Extract the preferred locale from a browser header before routing or formatting content.
瞭解地區設定識別符
BCP 47 結構
BCP 47 語言標籤由用連字號分隔的子標籤組成:語言(必要,2-3 個字母)、文字(選填,4 個字母)、地區(選填,2 個字母或 3 個數字)和變體(選填)。範例:
- • 僅語言
en, zh, ar - • 語言+地區
en-US, zh-TW, pt-BR - • 語言+文字
zh-Hant, sr-Latn - • 完整標籤
zh-Hant-TW, en-Latn-US
Intl API 實務
JavaScript Intl API 系列提供了地區設定感知的數字、日期、列表、相對時間等格式化功能。使用 Intl.Locale 解析識別符,Intl.DisplayNames 取得人類可讀名稱,Intl.NumberFormat/DateTimeFormat 進行格式化。
- •
Intl.getCanonicalLocales(["pt-br"])- canonicalize - •
new Intl.Locale("zh-Hans-CN")— parse - •
Intl.DisplayNames— display names - •
Intl.NumberFormat— numbers - •
Intl.DateTimeFormat— dates
最佳實務: 始終使用最適合您需求的最具體的地區設定標籤。對於 Web 應用程式,使用 navigator.language 取得使用者的偏好語言,並提供優雅的備用機制。在開發早期就使用多種地區設定進行測試。