From 59ee82e52786fdadebcdd15d19ab63a6e0f9fe05 Mon Sep 17 00:00:00 2001 From: Zylan Date: Mon, 31 Mar 2025 14:13:35 +0800 Subject: [PATCH] currency --- components/LanguageContext.tsx | 6 ++++++ components/calculator.tsx | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/components/LanguageContext.tsx b/components/LanguageContext.tsx index c5a1e43..92eeded 100644 --- a/components/LanguageContext.tsx +++ b/components/LanguageContext.tsx @@ -584,8 +584,10 @@ const translations: Record> = { // 表单标签 'annual_salary_cny': '年薪总包(元)', 'annual_salary_foreign': '年薪总包(当地货币)', + 'annual_salary': '年薪总包', 'salary_placeholder_cny': '税前年薪', 'salary_placeholder_foreign': '使用当地货币', + 'salary_placeholder': '税前年薪', 'non_china_salary': '非中国地区薪资', 'ppp_factor': '购买力平价(PPP)转换因子', 'ppp_tooltip': 'PPP转换因子是将各国货币购买力标准化的指标。例如中国为4.19,表示1美元在美国的购买力等同于4.19元人民币在中国的购买力。', @@ -809,8 +811,10 @@ const translations: Record> = { // Form labels 'annual_salary_cny': 'Annual Salary (CNY)', 'annual_salary_foreign': 'Annual Salary (Local Currency)', + 'annual_salary': 'Annual Salary', 'salary_placeholder_cny': 'Pre-tax annual salary', 'salary_placeholder_foreign': 'Use local currency', + 'salary_placeholder': 'Pre-tax annual salary', 'non_china_salary': 'Non-China Salary', 'ppp_factor': 'Purchasing Power Parity Factor', 'ppp_tooltip': 'PPP factor standardizes purchasing power across countries. For example, China\'s 4.19 means that 1 USD in US has the same purchasing power as 4.19 CNY in China.', @@ -1034,8 +1038,10 @@ const translations: Record> = { // フォームラベル 'annual_salary_cny': '年収(元)', 'annual_salary_foreign': '年収(現地通貨)', + 'annual_salary': '年収', 'salary_placeholder_cny': '税引前の年収', 'salary_placeholder_foreign': '現地通貨で入力', + 'salary_placeholder': '税引前の年収', 'non_china_salary': '中国以外の給与', 'ppp_factor': '購買力平価(PPP)換算係数', 'ppp_tooltip': 'PPP換算係数は各国の通貨の購買力を標準化する指標です。例えば、中国の4.19は、米国の1ドルが中国の4.19元と同等の購買力を持つことを意味します。', diff --git a/components/calculator.tsx b/components/calculator.tsx index 6fe4bab..98cfe33 100644 --- a/components/calculator.tsx +++ b/components/calculator.tsx @@ -747,7 +747,7 @@ const SalaryCalculator = () => {
-

v5.2.1

+

v5.3.1

{
@@ -797,7 +799,9 @@ const SalaryCalculator = () => { type="number" value={formData.salary} onChange={(e) => handleInputChange('salary', e.target.value)} - placeholder={selectedCountry !== 'CN' ? t('salary_placeholder_foreign') : t('salary_placeholder_cny')} + placeholder={selectedCountry !== 'CN' ? + `${t('salary_placeholder')} ${getCurrencySymbol(selectedCountry)}` : + t('salary_placeholder_cny')} className="block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 dark:text-white" />