From 16967381d88e5f9aceb38abe81d25ced1f8afbd2 Mon Sep 17 00:00:00 2001 From: eson <474420502@qq.com> Date: Sun, 14 Apr 2024 23:09:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BF=BB=E8=AF=91=E7=9A=84?= =?UTF-8?q?=E5=8F=AF=E8=A1=8C=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 4 +- go.sum | 8 +- translator/en.toml | 266 +++++++++++++++++++++++++++++++ translator/ja.toml | 284 ++++++++++++++++++++++++++++++++++ translator/translator_test.go | 34 ++++ 5 files changed, 590 insertions(+), 6 deletions(-) create mode 100644 translator/en.toml create mode 100644 translator/ja.toml diff --git a/go.mod b/go.mod index 1c21e9d..c4d3e9e 100644 --- a/go.mod +++ b/go.mod @@ -33,14 +33,14 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nicksnyder/go-i18n/v2 v2.4.0 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect golang.org/x/arch v0.3.0 // indirect golang.org/x/crypto v0.22.0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sys v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/text v0.14.0 google.golang.org/protobuf v1.30.0 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 33f9a43..b5b71db 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/474420502/generator v0.0.10 h1:ftWAuhTjgibMMVRUW0iJhi92Es9B/NHeZYtn1K8rTaI= github.com/474420502/generator v0.0.10/go.mod h1:iQ2V8rik9Ff4XKrxIpKlrVat8H8IaEJc5Lyo2qlcKX0= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= @@ -59,13 +61,10 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/nicksnyder/go-i18n v1.10.3 h1:0U60fnLBNrLBVt8vb8Q67yKNs+gykbQuLsIkiesJL+w= -github.com/nicksnyder/go-i18n v1.10.3/go.mod h1:hvLG5HTlZ4UfSuVLSRuX7JRUomIaoKQM19hm6f+no7o= github.com/nicksnyder/go-i18n/v2 v2.4.0 h1:3IcvPOAvnCKwNm0TB0dLDTuawWEj+ax/RERNC+diLMM= github.com/nicksnyder/go-i18n/v2 v2.4.0/go.mod h1:nxYSZE9M0bf3Y70gPQjN9ha7XNHX7gMc814+6wVyEI4= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -109,7 +108,8 @@ google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/translator/en.toml b/translator/en.toml new file mode 100644 index 0000000..3d6b754 --- /dev/null +++ b/translator/en.toml @@ -0,0 +1,266 @@ +[email_verify_code] +description = "Email verification code" +[get_email_verify_code_first] +description = "Please get the email verification code first" +[email_verify_code_wrong] +description = "Incorrect email verification code" +[email_verify_code_wrong_login_fail] +description = "Incorrect email verification code, login failed" +[email_registered] +description = "Email already registered" +[email_registered_forget_password] +description = "Email already registered, please log in directly. If you forgot your login password, please retrieve it" +[invitation_code_not_exists] +description = "Invitation code does not exist or is incorrect, please check and try again" +[password_match_error] +description = "Passwords do not match" +[account_not_registered] +description = "Account not registered, please register before operating" +[account_disabled] +description = "Your account has been disabled and cannot be operated temporarily" +[phone_number_not_registered] +description = "Account not registered, please register before operating" +[phone_number_country_incorrect] +description = "Incorrect country for the phone number, please check" +[phone_number_verify_code_wrong] +description = "Incorrect phone verification code" +[phone_number_registered] +description = "Phone number already registered" +[phone_number_registered_forget_password] +description = "Phone number already registered, please log in directly. If you forgot your login password, please retrieve it" +[get_phone_number_verify_code_first] +description = "Please get the phone verification code first" +[phone_number_verify_code_wrong_login_fail] +description = "Incorrect phone verification code, login failed" +[account_disabled_not_login] +description = "Your account has been disabled and cannot be operated temporarily" +[account_or_password_login_failed] +description = "Incorrect account or password, login failed" +[record_not_exist] +description = "Record does not exist" +[category_not_exist] +description = "Category does not exist" +[data_not_exist] +description = "Data does not exist!" +[data_not_exist_retry] +description = "Data does not exist, please try again!" +[new_shares_do_not_exist] +description = "New shares do not exist" +[state_not_cancel] +description = "Current state does not allow cancellation" +[apply_cannot_be_cancelled] +description = "This application has been closed and cannot be cancelled" +[financing_not_cancel] +description = "Sorry, financing for new shares is not allowed to be cancelled" +[application_has_been_submitted] +description = "Sorry, the application has been submitted to the exchange and cannot be cancelled" +[fund_has_been_delisted] +description = "Sorry, the fund has been delisted and cannot be subscribed temporarily" +[subscription_failed_over_purchased] +description = "Subscription failed, over-purchased. The current remaining subscription quota for the fund is: " +[minimum_purchase_amount] +description = "Minimum purchase amount" +[rise] +description = "and up" +[hongkong_account_is_insufficient] +description = "Insufficient balance in Hong Kong stock account, please deposit first" +[us_account_is_insufficient] +description = "Insufficient balance in US stock account, please deposit first" +[usdt_account_is_insufficient] +description = "Insufficient balance in USDT account, please deposit first" +[format_account_is_insufficient] +description = "Insufficient account balance, please deposit first" +[subscription_deadline_has_passed] +description = "The subscription deadline has passed!" +[have_a_subscription_record] +description = "You already have a subscription record for this new share and cannot apply again" +[hongkong_stock_account_not_be_less_than] +description = "Financing subscription requires Hong Kong stock account balance not less than" +[us_stock_account_not_be_less_than] +description = "Financing subscription requires US stock account balance not less than" +[please_deposit_first] +description = ", please deposit first!" +[incorrect_amount_retry] +description = "Incorrect amount, please try again" +[have_an_entrustment_record] +description = "You already have an entrustment record for this new share and cannot entrust again" +[currently_only_supports_conversion_hkd] +description = "Currently only supports conversion to Hong Kong Dollar HKD $" +[insufficient_account_balance] +description = "Insufficient account balance, conversion failed" +[record_is_not_cancel] +description = "This record is not allowed to be cancelled currently" +[order_needs_3_minutes_before] +description = "Market orders need to be placed 3 minutes before they can be cancelled" +[order_is_not_cancel] +description = "This order does not support cancellation currently" +[order_failed_retry] +description = "Order failed, please try again" +[market_closed_orders_cannot_be_placed] +description = "The current market is closed, orders cannot be placed temporarily" +[incorrect_security_code_retry] +description = "Incorrect security code, please try again" +[stock] +description = "Stock" +[order_failed_odd_lot_trading] +description = "Order failed, odd lot trading is not supported" +[withfunding_asset_total_must_large_than_order_total] +description = "Order failed, operating funds must be greater than order amount" +[order_failed_price_cannot_be_lower_than] +description = "Order failed, price cannot be lower than" +[order_failed_price_cannot_be_higher_than] +description = "Order failed, price cannot be higher than" +[order_failed_price_is_incorrect] +description = "Order failed, price is incorrect" +[stock_insufficient] +description = "You currently do not hold this stock or the holding quantity is insufficient, unable to sell" +[current_position_of_the_stock] +description = "Current holding quantity of the stock" +[holding_amount_is_insufficient] +description = ", holding amount is insufficient, unable to sell" +[maximum_number_of_sells] +description = "The maximum allowed selling quantity is" +[stocks_do_not_support_grey_market_trading] +description = "Stocks do not support grey market trading" +[non_grey_market_trading_time] +description = "Currently not in grey market trading time, order failed" +[pretrade_not_allow_market_order] +description = "Pre-trade does not support market orders, please change and try again" +[text_required] +description = "Data error" +[days_ago] +description = " days ago" +[hours_ago] +description = " hours ago" +[minutes_ago] +description = " minutes ago" +[balance_role_1] +description = "Stock buy" +[balance_role_2] +description = "Buy commission" +[balance_role_3] +description = "Stock sell" +[balance_role_4] +description = "Sell commission" +[balance_role_5] +description = "New share subscription" +[balance_role_6] +description = "New share financing interest" +[balance_role_7] +description = "New share subscription commission" +[balance_role_8] +description = "New share allotment commission" +[balance_role_9] +description = "International placement margin" +[balance_role_10] +description = "Platform share" +[balance_role_11] +description = "Withdrawal" +[balance_role_12] +description = "Deposit" +[balance_role_13] +description = "Fund subscription amount" +[balance_role_14] +description = "Fund subscription fee" +[balance_role_15] +description = "Fund management fee" +[balance_role_16] +description = "Fund deduction" +[balance_role_17] +description = "Fund refund" +[balance_role_18] +description = "Fund settlement profit" +[balance_role_19] +description = "Virtual deposit" +[balance_role_20] +description = "Manual deposit" +[balance_role_21] +description = "Fund transfer" +[balance_role_22] +description = "Promotion commission" +[balance_role_23] +description = "Fund excess management fee" +[balance_role_24] +description = "Currency exchange" +[balance_role_25] +description = "Leveraged investment principal" +[balance_role_26] +description = "Leveraged interest" +[balance_role_28] +description = "Bonus" +[balance_return] +description = "(Returned)" +[day] +description = "Day" +[week] +description = "Week" +[month] +description = "Month" +[fund_order_status_1] +description = "Subscribed" +[fund_order_status_2] +description = "Cancelled" +[fund_order_status_3] +description = "Settled" +[withfunding_must_all_clear] +description = "Order failed, leveraged positions must be sold all" +[sell_success_title] +description = "Sell trade completed" +[sell_success_content_1] +description = "Your trade " +[sell_success_content_2] +description = " sell " +[sell_success_content_3] +description = " has been completed" +[buy_success_title] +description = "Buy trade completed" +[buy_success_content_1] +description = "Your trade " +[buy_success_content_2] +description = " buy " +[buy_success_content_3] +description = " has been completed" +[sms_verify_code_content_1] +description = "Your SMS verification code is: " +[email_exchange_title] +description = "Fund Change Notification" +[currency_exchange_status_1] +description = "Pending" +[currency_exchange_status_2] +description = "Exchange successful" +[currency_exchange_status_3] +description = "Exchange failed" +[currency_exchange_status_4] +description = "Cancelled" +[to_be_disclosed] +description = "To be disclosed" +[ipo_times] +description = " times" +[ipo_cash_commission] +description = "Cash commission" +[password_match_error_origin] +description = "Original password does not match" +[ipo_financing_10_times] +description = "10 times financing" +[ipo_financing_20_times] +description = "20 times financing" +[other] +description = "Other" +[max] +description = "Max" +[the_maximum_quantity_is_limited_to_10_digits] +description = "The maximum quantity is limited to 10 digits" +[waiting_to_open] +description = "Waiting to open" +[the_market_is_closed_on_weekends] +description = "The market is closed on weekends" +[the_market_is_closed] +description = "The market is closed" +[in_transaction] +description = "In transaction" +[default_trading_time_period] +description = "Default trading time period" +[non_default_trading_time_period] +description = "Non-default trading time period" +[all_day_transaction] +description = "All-day transaction" \ No newline at end of file diff --git a/translator/ja.toml b/translator/ja.toml new file mode 100644 index 0000000..b8dc15a --- /dev/null +++ b/translator/ja.toml @@ -0,0 +1,284 @@ +[email_verify_code] +description = "メール認証コード" +[get_email_verify_code_first] +description = "まずメール認証コードを取得してください" +[email_verify_code_wrong] +description = "メール認証コードが正しくありません" +[email_verify_code_wrong_login_fail] +description = "メール認証コードが正しくありません。ログインに失敗しました" +[email_registered] +description = "メールアドレスは既に登録されています" +[email_registered_forget_password] +description = "メールアドレスは既に登録されています。直接ログインしてください。パスワードをお忘れの場合は、パスワードを再設定してください" +[invitation_code_not_exists] +description = "招待コードが存在しないか、誤りがあります。確認の上、再度お試しください" +[password_match_error] +description = "パスワードが一致しません" +[account_not_registered] +description = "アカウントが登録されていません。登録後に操作してください" +[account_disabled] +description = "アカウントが無効になっているため、現在操作できません" +[phone_number_not_registered] +description = "アカウントが登録されていません。登録後に操作してください" +[phone_number_country_incorrect] +description = "電話番号の国が正しくありません。確認してください" +[phone_number_verify_code_wrong] +description = "携帯電話の認証コードが正しくありません" +[phone_number_registered] +description = "電話番号は既に登録されています" +[phone_number_registered_forget_password] +description = "電話番号は既に登録されています。直接ログインしてください。パスワードをお忘れの場合は、パスワードを再設定してください" +[get_phone_number_verify_code_first] +description = "まず携帯電話の認証コードを取得してください" +[phone_number_verify_code_wrong_login_fail] +description = "携帯電話の認証コードが正しくありません。ログインに失敗しました" +[account_disabled_not_login] +description = "アカウントが無効になっているため、現在操作できません" +[account_or_password_login_failed] +description = "アカウントまたはパスワードが正しくありません。ログインに失敗しました" + +[record_not_exist] +description = "記録が存在しません" +[category_not_exist] +description = "カテゴリが存在しません" +[data_not_exist] +description = "データが存在しません!" +[data_not_exist_retry] +description = "データが存在しません。再度お試しください!" +[new_shares_do_not_exist] +description = "新株が存在しません" + +[state_not_cancel] +description = "現在の状態ではキャンセルできません" +[apply_cannot_be_cancelled] +description = "この申請は締め切られており、キャンセルできません" +[financing_not_cancel] +description = "申し訳ありませんが、新株引受融資はキャンセルできません" +[application_has_been_submitted] +description = "申し訳ありませんが、申請は既に取引所に提出されており、キャンセルできません" +[fund_has_been_delisted] +description = "申し訳ありませんが、ファンドは上場廃止となっており、現在申し込みできません" +[subscription_failed_over_purchased] +description = "申し込みに失敗しました。購入超過です。ファンドの現在の残りの申し込み可能額は次の通りです:" +[minimum_purchase_amount] +description = "最低購入金額" +[rise] +description = "以上" +[hongkong_account_is_insufficient] +description = "香港株口座の残高が不足しています。まず入金してください" +[us_account_is_insufficient] +description = "米国株口座の残高が不足しています。まず入金してください" +[usdt_account_is_insufficient] +description = "USDT口座の残高が不足しています。まず入金してください" +[format_account_is_insufficient] +description = "口座の残高が不足しています。まず入金してください" +[subscription_deadline_has_passed] +description = "現在、申し込み期限を過ぎています!" +[have_a_subscription_record] +description = "既にこの新株の申し込み記録があるため、重複して申請できません" +[hongkong_stock_account_not_be_less_than] +description = "新株引受融資には、香港株口座の残高が次の金額を下回らないことが要求されます" +[us_stock_account_not_be_less_than] +description = "新株引受融資には、米国株口座の残高が次の金額を下回らないことが要求されます" +[please_deposit_first] +description = "。まず入金してください!" +[incorrect_amount_retry] +description = "金額が正しくありません。再度お試しください" +[have_an_entrustment_record] +description = "既にこの新株の委託記録があるため、重複して委託できません" +[currently_only_supports_conversion_hkd] +description = "現在、香港ドル(HKD)への変換のみをサポートしています" +[insufficient_account_balance] +description = "口座残高が不足しているため、変換に失敗しました" +[record_is_not_cancel] +description = "この記録は現在キャンセルできません" +[order_needs_3_minutes_before] +description = "成行注文は、注文後3分経過しないと取り消せません" +[order_is_not_cancel] +description = "この注文は現在取り消しをサポートしていません" +[order_failed_retry] +description = "注文に失敗しました。再度お試しください" +[market_closed_orders_cannot_be_placed] +description = "現在、市場は休場中のため、注文を出せません" +[incorrect_security_code_retry] +description = "証券コードが正しくありません。再度お試しください" +[stock] +description = "株式" +[order_failed_odd_lot_trading] +description = "注文に失敗しました。端株取引はサポートしていません" +[withfunding_asset_total_must_large_than_order_total] +description = "注文に失敗しました。運用資金は注文金額を上回る必要があります" +[order_failed_price_cannot_be_lower_than] +description = "注文に失敗しました。価格は次の金額を下回ることはできません" +[order_failed_price_cannot_be_higher_than] +description = "注文に失敗しました。価格は次の金額を上回ることはできません" +[order_failed_price_is_incorrect] +description = "注文に失敗しました。価格が正しくありません" +[stock_insufficient] +description = "現在、この株式を保有していないか、保有数量が不足しているため、売却できません" +[current_position_of_the_stock] +description = "株式の現在の保有数量" +[holding_amount_is_insufficient] +description = "。保有数量が不足しているため、売却できません" +[maximum_number_of_sells] +description = "売却可能な最大数量は次の通りです" +[stocks_do_not_support_grey_market_trading] +description = "株式はグレーマーケット取引をサポートしていません" +[non_grey_market_trading_time] +description = "現在はグレーマーケット取引時間外のため、注文に失敗しました" +[pretrade_not_allow_market_order] +description = "プレオープン取引では成行注文はサポートされていません。変更して再度お試しください" + +[text_required] +description = "データが正しくありません" + +[days_ago] +description = "日前" +[hours_ago] +description = "時間前" +[minutes_ago] +description = "分前" + +[balance_role_1] +description = "株式買付" +[balance_role_2] +description = "買付手数料" +[balance_role_3] +description = "株式売却" +[balance_role_4] +description = "売却手数料" +[balance_role_5] +description = "新株申し込み" +[balance_role_6] +description = "新株引受融資利息" +[balance_role_7] +description = "新株申し込み手数料" +[balance_role_8] +description = "新株当選手数料" +[balance_role_9] +description = "国内割当意向金" +[balance_role_10] +description = "プラットフォーム分配" +[balance_role_11] +description = "出金" +[balance_role_12] +description = "入金" +[balance_role_13] +description = "ファンド申し込み金額" +[balance_role_14] +description = "ファンド申し込み手数料" +[balance_role_15] +description = "ファンド管理手数料" +[balance_role_16] +description = "資金追加徴収" +[balance_role_17] +description = "資金返還" +[balance_role_18] +description = "ファンド決済益" +[balance_role_19] +description = "仮想入金" +[balance_role_20] +description = "手動入金" +[balance_role_21] +description = "資金移動" +[balance_role_22] +description = "プロモーション手数料" +[balance_role_23] +description = "ファンド超過管理手数料" +[balance_role_24] +description = "通貨両替" +[balance_role_25] +description = "レバレッジ投資元本" +[balance_role_26] +description = "レバレッジ利息" +[balance_role_28] +description = "ボーナス" +[balance_return] +description = "(返金)" + +[day] +description = "日" +[week] +description = "週" +[month] +description = "月" +[fund_order_status_1] +description = "申し込み済み" +[fund_order_status_2] +description = "キャンセル済み" +[fund_order_status_3] +description = "決済済み" + +[withfunding_must_all_clear] +description = "注文に失敗しました。レバレッジは全て売却する必要があります" + +[sell_success_title] +description = "売却取引が成立しました" +[sell_success_content_1] +description = "あなたの取引 " +[sell_success_content_2] +description = " 売却 " +[sell_success_content_3] +description = " が成立しました" +[buy_success_title] +description = "買付取引が成立しました" +[buy_success_content_1] +description = "あなたの取引 " +[buy_success_content_2] +description = " 買付 " +[buy_success_content_3] +description = " が成立しました" + +[sms_verify_code_content_1] +description = "あなたのSMS認証コードは:" + +[email_exchange_title] +description = "資金変動通知" + +[currency_exchange_status_1] +description = "処理待ち" +[currency_exchange_status_2] +description = "両替成功" +[currency_exchange_status_3] +description = "両替失敗" +[currency_exchange_status_4] +description = "キャンセル済み" + +[to_be_disclosed] +description = "公開待ち" + +[ipo_times] +description = "倍" + +[ipo_cash_commission] +description = "現金委託" +[password_match_error_origin] +description = "元のパスワードが一致しません" +[ipo_financing_10_times] +description = "10倍融資" +[ipo_financing_20_times] +description = "20倍融資" +[other] +description = "その他" +[max] +description = "最大" + +[the_maximum_quantity_is_limited_to_10_digits] +description = "数量は最大10桁に制限されています" + +[waiting_to_open] +description = "開場待ち" +[the_market_is_closed_on_weekends] +description = "週末は休場中です" +[the_market_is_closed] +description = "休場中" +[in_transaction] +description = "取引中" +[default_trading_time_period] +description = "デフォルトの取引時間帯" +[non_default_trading_time_period] +description = "デフォルト以外の取引時間帯" +[all_day_transaction] +description = "終日取引" + + \ No newline at end of file diff --git a/translator/translator_test.go b/translator/translator_test.go index 3c24d5e..671891e 100644 --- a/translator/translator_test.go +++ b/translator/translator_test.go @@ -3,6 +3,7 @@ package translator import ( "bytes" "go/format" + "log" "os" "path/filepath" "runtime" @@ -51,6 +52,26 @@ func TestGenTrCode(t *testing.T) { // log.Println(string(buf.Bytes())) } +func TestCase(t *testing.T) { + a := TomlFileToMap("./zh_cn.toml") + b := TomlFileToMap("./en.toml") + c := TomlFileToMap("./ja.toml") + + for k1, v1 := range a { + if v2, ok := b[k1]; ok { + log.Println(v1, v2) + } else { + log.Panicln("k1:", k1, "不存在") + } + + if v2, ok := c[k1]; ok { + log.Println(v1, v2) + } else { + log.Panicln("k1:", k1, "不存在") + } + } +} + func createTrCode(filePath string) { tomlFile, err := os.Open(filePath) if err != nil { @@ -115,3 +136,16 @@ func toCamelCase(s string) string { } return sb.String() } + +func TomlFileToMap(tomlfile string) map[string]any { + f, err := os.Open(tomlfile) + if err != nil { + panic(err) + } + var m map[string]any + err = toml.NewDecoder(f).Decode(&m) + if err != nil { + panic(err) + } + return m +}