Commit d1775b13 authored by Benjamin Elsdon's avatar Benjamin Elsdon Committed by Melledy
Browse files

Attempt to fix untranslated login window

parent e6514f7a
...@@ -4,6 +4,7 @@ import emu.grasscutter.GameConstants; ...@@ -4,6 +4,7 @@ import emu.grasscutter.GameConstants;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.server.http.objects.HttpJsonResponse; import emu.grasscutter.server.http.objects.HttpJsonResponse;
import emu.grasscutter.server.http.Router; import emu.grasscutter.server.http.Router;
import emu.grasscutter.server.http.objects.WebStaticVersionResponse;
import express.Express; import express.Express;
import express.http.Request; import express.http.Request;
import express.http.Response; import express.http.Response;
...@@ -43,7 +44,7 @@ public final class GenericHandler implements Router { ...@@ -43,7 +44,7 @@ public final class GenericHandler implements Router {
express.all("/perf/config/verify", new HttpJsonResponse("{\"code\":0}")); express.all("/perf/config/verify", new HttpJsonResponse("{\"code\":0}"));
// webstatic-sea.hoyoverse.com // webstatic-sea.hoyoverse.com
express.get("/admin/mi18n/plat_oversea/*", new HttpJsonResponse("{\"version\":51}")); express.get("/admin/mi18n/plat_oversea/*", new WebStaticVersionResponse());
express.get("/status/server", GenericHandler::serverStatus); express.get("/status/server", GenericHandler::serverStatus);
} }
......
package emu.grasscutter.server.http.objects;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.DataLoader;
import emu.grasscutter.utils.FileUtils;
import emu.grasscutter.utils.Utils;
import express.http.HttpContextHandler;
import express.http.MediaType;
import express.http.Request;
import express.http.Response;
import io.javalin.core.util.FileUtil;
import java.io.IOException;
import java.io.InputStream;
import static emu.grasscutter.Configuration.DATA;
public class WebStaticVersionResponse implements HttpContextHandler {
@Override
public void handle(Request request, Response response) throws IOException {
if(request.path().contains("version")) {
getPageResources("/webstatic/version.json", response);
return;
} else { // TODO other versions
getPageResources("/webstatic/en.json", response);
}
}
private static void getPageResources(String path, Response response) {
try(InputStream filestream = FileUtils.readResourceAsStream(path)) {
MediaType fromExtension = MediaType.getByExtension(path.substring(path.lastIndexOf(".") + 1));
response.type((fromExtension != null) ? fromExtension.getMIME() : "application/octet-stream");
response.send(filestream.readAllBytes());
} catch (Exception e) {
Grasscutter.getLogger().warn("File does not exist: " + path);
response.status(404);
}
}
}
{
"Apple": "Apple",
"Game Center": "Game Center",
"accept": "Accept",
"account_deactive": "Your current account is in the process of being deleted.",
"account_empty": "",
"account_login": "Log in using account & password",
"agree": "Agree",
"another_account": "Log in to another account",
"back": "",
"bind": "Link",
"bind_email": "Link email",
"bind_email_oversea": "Link Email",
"bind_email_success": "Email linked successfully",
"bind_request": "Linking...",
"cancel": "Cancel",
"cancel_pay": "Leave",
"captcha_empty": "Please enter SMS verification code",
"captcha_mail_empty": "Please enter the verification code from the email",
"captcha_success": "Verification code sent",
"change_password_success": "Password successfully changed",
"check_network": "Please check your Internet connection or refresh the page and try again",
"combo_download_downloading": "Downloading...",
"combo_download_failed_title": "Download Failed",
"combo_download_finish_content": "Download complete",
"combo_download_pause": "Pause",
"combo_download_speed": "Download speed: %s Time remaining: %s",
"combo_download_title": "Download Complete",
"combo_ensure_login": "Confirm login",
"combo_ensure_login_tips": "Logging in to desktop version of %s. Please confirm that this is you.",
"combo_expired_qrcode": "QR code expired",
"combo_go_setting": "Open Camera",
"combo_invalid_qrcode": "QR code invalid",
"combo_login_first": "Please log in first",
"combo_notice_auth_key_failed": "Failed to load Notices",
"combo_platform_cancel": "Cancel",
"combo_platform_ensure": "OK",
"combo_platform_ensure_exit": "Do you want to exit?",
"combo_platform_ensure_logout": "Select \"OK\" to log out",
"combo_qrcode_failed": "Login error, please try again",
"combo_qrcode_goto_setting": "Settings",
"combo_qrcode_goto_setting_tips": "Go to Settings > Apps and enable camera permissions in order to log in using the scan function.",
"combo_qrcode_notice_permission": "Please give this app permission to access your camera. You can do this in your phone's settings.",
"combo_qrcode_notice_scan": "Place the QR code within the frame",
"combo_qrcode_success": "Login successful",
"combo_qrcode_tips": "In order to log in via QR code scan, you must allow access to your camera.",
"combo_qrcode_title": "Scan",
"combo_re_login": "Please log in again",
"confirm_order": "Confirming payment...",
"continue_login": "",
"continue_pay": "Continue Payment",
"createOrder_failed": "Failed to create order",
"currency": "$",
"delete_account_notice": "Delete account login records? (Does not delete other account data)",
"delete_ensure": "Delete",
"determine_reactivate_account_or_not": "Would you like to reactivate it?",
"email_empty": "Please enter your email address",
"email_exist": "Email already registered. Log in?",
"email_register_tips": "Email not registered. Register now?",
"ensure": "OK",
"ensure_back": "Confirm and return",
"ensure_email": "Confirm registration email:\\n%s",
"enter_game": "Log in",
"existing_account": "Bind Account",
"exit": "Exit",
"facebook": "Facebook",
"fast_game": "Guest",
"fatigue_reminder_tip": "",
"file_upload_setting_camera_tip": "Go to \"Settings - Apps\" and allow camera permissions in order to use camera features.",
"file_upload_setting_microphone_tip": "Go to Settings > Apps and allow access to your microphone in order to use the video recording function in the feedback center.",
"file_upload_setting_photos_tip": "Go to Settings > Apps and enable photo permissions in order to upload images.",
"forget_pwd": "Forgot password?",
"gamecenter_tips": "Log in to Game Center in Settings",
"go_login": "Log in",
"go_pay": "Confirm and pay",
"go_register": "Register",
"guest_account": "Guest",
"guest_bind_email": "You are about to link the following email address: %s",
"guest_bind_failed": "Current account is not a guest account or user is not logged in",
"guest_bind_phone_notice": "To protect your data, please link at least one other account.",
"guest_login": "Guest login",
"guest_login_request": "Logging in as guest...",
"guest_login_tips": "Welcome, guest.",
"guest_pay_error": "Guest accounts cannot make purchases",
"http_time_out": "Connection failed. Try again later.",
"http_unknow_host": "Network error",
"if_cancel_pay": "Leave payment screen?",
"init_first": "Please complete initialization first.",
"input_account": "Enter mobile number or email address",
"input_code_number": "Enter SMS verification code",
"input_email": "Enter email address",
"input_get_code": "Get Code",
"input_mail_capture": "Verification Code",
"input_mail_code": "",
"input_mi_email": "Enter email address",
"input_password": "Enter password",
"input_password_ensure": "Enter password again",
"input_phone_number": "Enter mobile number to register/log in",
"input_phone_number_bind": "Enter mobile number",
"input_re_get_code": "Try again",
"invaild_captcha": "Invalid SMS verification code, please check",
"invaild_mail_captcha": "Verification code invalid, please check",
"invaild_name": "Please enter your name correctly",
"invaild_password": "Please enter the correct password",
"invaild_phone": "Please provide a valid mobile phone number",
"invaild_realname": "Please provide a valid ID Card number",
"last_login_day_number": "Last login %s days ago",
"last_login_hour_number": "Last login %s hours ago",
"last_login_just_now": "Last login just now",
"last_login_minute_number": "Last login %s minutes ago",
"last_login_month_number": "Last login six months ago",
"last_login_time": "Last login on %s",
"login": "Log In",
"login_again": "Please log in again",
"login_bind_mobile": "",
"login_bind_mobile_verify_mail": "",
"login_bind_safe_notice": "Before logging in to the game, please link your account with a security phone number",
"login_failed": "Login failed",
"login_first": "Please log in first",
"login_request": "Logging in...",
"login_verify_by_bind": "Verify using linked number",
"login_verify_by_bind_phone": "Verify using linked number: %s",
"login_verify_by_safety": "Verify using security phone number",
"login_verify_by_safety_phone": "Verify using security phone number: %s",
"login_verify_notice": "Verification is required when you log in using a new device.",
"meet_problem": "Having Problems?",
"more": "More",
"name_empty": "Please enter your full name",
"network_json_error": "System error. Please try again later.",
"network_time_out": "Connection failed. Try again later.",
"next": "Next",
"no_account": "Haven't signed up yet?",
"no_captcha": "Please obtain a verification code",
"no_more_interruptions_today": "Don't show again today",
"other_device_know": "OK",
"other_device_login_day_number": "Logged in %s day(s) ago",
"other_device_login_device_info": "Login Device Information:",
"other_device_login_hour_number": "Logged in %s hour(s) ago",
"other_device_login_minute_number": "Logged in %s minute(s) ago",
"other_device_login_month_number": "Logged in %s month(s) ago",
"other_device_suggest": "If this was not you, we recommend that you link an email to your account.",
"other_device_title": "Your account was logged into on another device.",
"other_way_verification": "Other Verification Methods",
"oversea_guardian": "접속하신 아이디는 만 14세 미만 법정대리인 동의가 필요한 아이디로써 관련 규정에 따라 법정대리인의 동의가 필요합니다. \\\\n관련 정보를 입력하고 인증해 주세요",
"oversea_input_account": "Enter email/username",
"oversea_pay": "Pay",
"oversea_pay_button": "Proceed to payment",
"oversea_pay_card_payment": "Credit card",
"oversea_pay_error": "Loading failed",
"oversea_pay_error_btn": "Reload",
"oversea_pay_error_tips": "Try again later.",
"oversea_pay_operator": "Select payment method",
"oversea_pay_product_name": "Product",
"oversea_pay_success": "Payment successful",
"oversea_pay_success_btn": "Return to game",
"oversea_pay_success_tips": "Please enter game to access product",
"oversea_pay_type": "Select payment type",
"oversea_realname": "관련 규정에 따라 실명인증을 완료해 주세요\\\\n궁금하신 점이 있을 경우 고객센터로 문의하세요",
"password_empty": "Enter password",
"pay": "Pay",
"pay_aid_uid_mismatch_tips": "Your account login status has expired, please log in again.",
"pay_back_game": "Return to game %s",
"pay_bind_notice": "Guest accounts must be linked to another account before making payment",
"pay_choose_new_way": "Payment incomplete. Please select another payment method to continue.",
"pay_failed": "Payment failed. Try again later.",
"pay_failed_notice": "Payment failed. Please try again.",
"pay_limit_amount_tips": "",
"pay_loading_notice": "If payment was successful, please check your account shortly.",
"pay_loading_time": "(%s)",
"pay_success": "Payment successful",
"pay_success_notice": "You have successfully purchased: %s",
"pay_time_out": "Payment timeout",
"pay_turn": "Proceed to payment",
"phone_empty": "Enter mobile number",
"phone_login": "Log in using phone",
"phone_message_request": "Verifying...",
"phone_message_request_fail": "Failed to send verification code. Please try again.",
"phone_register_tips": "Mobile number not yet registered. Register now?",
"phone_registered": "Number already registered. Enter verification code to log in.",
"privacy": "Privacy Policy",
"product_name": "Product",
"re_login": "Please log in again",
"re_read": "Read Again",
"re_register": "Enter again",
"reactivate_accoun_notice_cn": "Your account is currently in the \"deletion confirmation period.\"\\nDo you want to reactivate your account and log in?\\nPlease note that the deletion process will be canceled after reactivation.\\n※The deletion confirmation period is 3 days from the date on which you request the deletion.",
"reactivate_accoun_notice_os": "Your account is currently in the \"deletion confirmation period.\"\\nDo you want to reactivate your account and log in?\\nPlease note that the deletion process will be canceled after reactivation.\\n※The deletion confirmation period is 30 days from the date on which you request the deletion.",
"reactivate_account": "Reactivate Account",
"read_user_agreement_first": "Please read and agree to the Terms of Service",
"real_name_request": "Verifying real name...",
"real_people_agree": "",
"real_people_agreement": "",
"real_people_anti_addiction_pc_tip": "",
"real_people_anti_addiction_rule_click": "",
"real_people_anti_addiction_tip": "",
"real_people_back_tip": "",
"real_people_continue_verify": "",
"real_people_message": "",
"real_people_minor_privacy": "",
"real_people_modify": "",
"real_people_not_verify": "",
"real_people_pc_tip": "",
"real_people_real_name_full_name": "",
"real_people_real_name_identity_card": "",
"real_people_real_name_info_tip": "",
"real_people_request_camera_tip": "",
"real_people_search_result": "",
"real_people_service_agreement": "",
"real_people_setting_camera_tip": "",
"real_people_start_verify": "",
"real_people_title": "",
"real_people_verify_cancel": "",
"real_people_verify_fail": "",
"real_people_verify_success": "",
"real_people_wait_search_result": "",
"realname_account": "Name on ID Card",
"realname_account_notice": "Last name\\u3000First name",
"realname_button_finish": "Complete verification",
"realname_close_notice": "To finish account registration, you must complete real-name verification. Otherwise, you will be returned to the %s screen.",
"realname_continue": "Continue verification",
"realname_empty": "Please enter your ID Card number",
"realname_failed": "Real-name verification failed. Please try again.",
"realname_notice": "Users must provide an ID to play online. For a smooth, uninterrupted gaming experience, please enter your ID information below.",
"realname_number": "ID Card Number",
"realname_number_notice": "ID Card",
"realname_pay_close_notice": "Real-name verification must be completed before payment can be made. Are you sure you want to cancel?",
"realname_success": "Real-name verification successful",
"refresh": "Refresh",
"refuse": "Refuse",
"register_bind": "Register and link",
"register_email": "Register with email address",
"register_login": "Register and log in",
"register_new_account": "Register",
"register_now": "Register now",
"register_phone": "Register with phone number",
"register_request": "Registering...",
"second_real_name_hint": "",
"second_real_name_verify_hint": "",
"send_mail_success": "A verification code has been sent to your email address (%s). Please check your email.",
"share_image_request_photos_tip": "Access to your photos is required in order to use the photo sharing function.",
"share_image_setting_photos_tip": "Go to Settings > Apps and allow access to your photos in order to use the photo sharing function.",
"sign_in_with": "Log in with",
"status_code_429": "Network busy. Please try again later.",
"status_code_4xx": "Network busy. Please try again later.",
"status_code_5xx": "Server busy. Please try again later.",
"suggest_bind_email": "To improve your account security, it is strongly recommended that you link your email address",
"suggest_device_grant": "You must complete security verification when logging in on a new device",
"suggest_verify_phone": "To improve your account security, it is strongly recommended that you link your email address.\nPlease complete the security verification first.",
"tips_bind_account": "Please link at least one account as soon as possible to protect your data and to avoid losing it.",
"tips_bind_success": "Sucessfully linked with: %s",
"tips_enter_game": "Welcome, %s!",
"tips_exprience_full": "Dear player, guest accounts provide a limited experience of up to n miHoYo games.\\n\\nFor a better gaming experience, it is highly recommended to register a full account.",
"tips_mail_capture": "Verification code sent to: %s",
"tips_ok": "OK",
"tips_prefix_verify_email": "Verify linked email:",
"tips_prefix_verify_mobile": "Verify using linked number:",
"tips_request_camera_permission": "In order to upload images in the Feedback Center, you must allow access to your camera.",
"tips_request_microphone_permission": "In order to use the video recording function in the feedback center, you must allow recording permissions.",
"tips_request_photos_permission": "In order to take and upload photos in the feedback center, you must allow access to your photos and camera.",
"title_realname": "Real-name Verification",
"token_invalid": "Login expired, please log in again",
"twitter": "Twitter",
"twitter_login": "Twitter",
"update_notice": "The Terms of Service or Privacy Policy has been updated",
"user_agreement": "Terms of Service",
"user_agreement_agree_tips": "Please carefully read the Terms of Service and Privacy Policy, and tick to agree",
"user_agreement_all_agree": "Agree to all the following",
"user_agreement_content": "Please read carefully and understand the terms before agreeing.",
"user_agreement_link_click_desc": "Tap the following link to read the full terms:",
"user_agreement_marketing_content": "After carefully reading and agreeing to the policies, please select Accept",
"user_agreement_marketing_update_title": "Marketing Agreement Update Notice",
"user_agreement_notice": "I have read and agree to the %s and %s",
"user_agreement_notice_content": "",
"user_agreement_notice_content_with_third_privacy": "",
"user_agreement_notice_minors": "",
"user_agreement_notice_privacy": "Privacy Policy",
"user_agreement_notice_third_privacy": "",
"user_agreement_notice_ua": "Terms of Service",
"user_agreement_optional": "(Optional)",
"user_agreement_refuse_tips": "Please read and accept our Terms of Service and Privacy Policy before you continue playing.",
"user_agreement_required": "(Required)",
"user_agreement_title": "Terms of Service and Privacy Policy Notice",
"user_agreement_update_content": "Please read carefully and understand the terms before agreeing.",
"user_agreement_update_title": "Terms of Service and Privacy Policy Update Notice",
"user_center": "User Center",
"username_empty": "Please enter email address/username",
"verify_email": "",
"verify_finish": "",
"verify_other": "",
"verify_phone": ""
}
\ No newline at end of file
{
"version": 51
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment