#!/usr/bin/env bash

function create_easy_localization_structure(){
  DEST_DIR="${FLUTTER_PROJECT_DIR}/assets/l10n"
  # Check if pubspec.yaml contains easy_localization dependency
  PUBSPEC_FILE="${FLUTTER_PROJECT_DIR}/pubspec.yaml"
  if ! grep -q "easy_localization:" "$PUBSPEC_FILE"; then
    echo "Adding easy_localization dependency to pubspec.yaml..."
    (cd "$FLUTTER_PROJECT_DIR" && flutter pub add easy_localization && flutter pub get)
    echo "✅ easy_localization dependency added to pubspec.yaml."
  else
    echo "easy_localization dependency already exists in pubspec.yaml."
  fi
  # Create English file
  ENGLISH_FILE="$DEST_DIR/en.json"
  cat <<EOL > "$ENGLISH_FILE"
{
  "app_title": "Demo App",
  "login": "Login",
  "logout": "Logout",
  "register": "Register",
  "email": "Email",
  "password": "Password",
  "confirm_password": "Confirm Password",
  "name": "Name",
  "welcome": "Welcome, {name}!",
  "home": "Home",
  "settings": "Settings",
  "profile": "Profile",
  "language": "Language",
  "biometric_auth": "Authenticate with biometrics",
  "face_id": "Face ID",
  "fingerprint": "Fingerprint",
  "authentication_success": "Authentication successful!",
  "authentication_failed": "Authentication failed!",
  "password_requirements": "Password must contain at least 8 characters, including uppercase, lowercase, number, and special character.",
  "forgot_password": "Forgot Password?",
  "reset_password": "Reset Password",
  "send": "Send",
  "cancel": "Cancel",
  "or_continue_with": "or continue with",
  "dont_have_account": "Don't have an account?",
  "already_have_account": "Already have an account?",
  "register_now": "Register now",
  "login_now": "Login now",
  "create_account_message": "Let's Create an account for you",
  "sign_up": "SIGN UP",
  "please_fill_all_fields": "Please fill all fields correctly.",
  "password_does_not_meet_requirements": "Password does not meet requirements.",
  "please_enter_your_name": "Please enter your name",
  "please_enter_your_email": "Please enter your email",
  "please_enter_valid_email": "Please enter a valid email",
  "please_enter_your_password": "Please enter your password",
  "please_confirm_your_password": "Please confirm your password",
  "passwords_do_not_match": "Passwords do not match",
  "at_least_1_lowercase": "At least 1 lowercase letter",
  "at_least_1_uppercase": "At least 1 uppercase letter",
  "at_least_1_special_character": "At least 1 special character",
  "at_least_1_number": "At least 1 number",
  "at_least_8_characters": "At least 8 characters long",
  "forgot_password_title": "Forgot Password",
  "forgot_password_subtitle": "Don't worry! It happens. Please enter the email address associated with your account.",
  "enter_email": "Enter your email",
  "send_reset_link": "Send Reset Link",
  "back_to_login": "Back to Login",
  "reset_link_sent": "Reset link sent!",
  "reset_link_sent_message": "We have sent a password reset link to your email address. Please check your inbox and follow the instructions.",
  "reset_link_sent_to": "Reset link sent to {email}",
  "email_not_found": "Email not found",
  "email_not_found_message": "No account found with this email address. Please check your email or create a new account."
}
EOL
  echo "📄 Created en.json file successfully at $ENGLISH_FILE"

  # Create Arabic file
  ARABIC_FILE="$DEST_DIR/ar.json"
  cat <<EOL > "$ARABIC_FILE"
{
  "app_title": "تطبيق تجريبي",
  "login": "تسجيل الدخول",
  "logout": "تسجيل الخروج",
  "register": "التسجيل",
  "email": "البريد الإلكتروني",
  "password": "كلمة المرور",
  "confirm_password": "تأكيد كلمة المرور",
  "name": "الاسم",
  "welcome": "مرحباً، {name}!",
  "home": "الرئيسية",
  "settings": "الإعدادات",
  "profile": "الملف الشخصي",
  "language": "اللغة",
  "biometric_auth": "المصادقة بالبيانات الحيوية",
  "face_id": "معرف الوجه",
  "fingerprint": "بصمة الإصبع",
  "authentication_success": "تمت المصادقة بنجاح!",
  "authentication_failed": "فشلت المصادقة!",
  "password_requirements": "يجب أن تحتوي كلمة المرور على 8 أحرف على الأقل، بما في ذلك حروف كبيرة وصغيرة ورقم ورمز خاص.",
  "forgot_password": "نسيت كلمة المرور؟",
  "reset_password": "إعادة تعيين كلمة المرور",
  "send": "إرسال",
  "cancel": "إلغاء",
  "or_continue_with": "أو المتابعة مع",
  "dont_have_account": "ليس لديك حساب؟",
  "already_have_account": "لديك حساب بالفعل؟",
  "register_now": "سجل الآن",
  "login_now": "سجل دخولك الآن",
  "create_account_message": "دعنا ننشئ حساباً لك",
  "sign_up": "التسجيل",
  "please_fill_all_fields": "يرجى ملء جميع الحقول بشكل صحيح.",
  "password_does_not_meet_requirements": "كلمة المرور لا تلبي المتطلبات.",
  "please_enter_your_name": "يرجى إدخال اسمك",
  "please_enter_your_email": "يرجى إدخال بريدك الإلكتروني",
  "please_enter_valid_email": "يرجى إدخال بريد إلكتروني صالح",
  "please_enter_your_password": "يرجى إدخال كلمة المرور",
  "please_confirm_your_password": "يرجى تأكيد كلمة المرور",
  "passwords_do_not_match": "كلمات المرور غير متطابقة",
  "at_least_1_lowercase": "حرف صغير واحد على الأقل",
  "at_least_1_uppercase": "حرف كبير واحد على الأقل",
  "at_least_1_special_character": "رمز خاص واحد على الأقل",
  "at_least_1_number": "رقم واحد على الأقل",
  "at_least_8_characters": "8 أحرف على الأقل",
  "forgot_password_title": "نسيت كلمة المرور",
  "forgot_password_subtitle": "لا تقلق! هذا يحدث. يرجى إدخال عنوان البريد الإلكتروني المرتبط بحسابك.",
  "enter_email": "أدخل بريدك الإلكتروني",
  "send_reset_link": "إرسال رابط إعادة التعيين",
  "back_to_login": "العودة لتسجيل الدخول",
  "reset_link_sent": "تم إرسال رابط إعادة التعيين!",
  "reset_link_sent_message": "لقد أرسلنا رابط إعادة تعيين كلمة المرور إلى عنوان بريدك الإلكتروني. يرجى فحص صندوق الوارد واتباع التعليمات.",
  "reset_link_sent_to": "تم إرسال رابط إعادة التعيين إلى {email}",
  "email_not_found": "البريد الإلكتروني غير موجود",
  "email_not_found_message": "لم يتم العثور على حساب بهذا البريد الإلكتروني. يرجى التحقق من بريدك الإلكتروني أو إنشاء حساب جديد."
}
EOL
  echo "📄 Created ar.json file successfully at $ARABIC_FILE"

  # Create German file
  GERMAN_FILE="$DEST_DIR/de.json"
  cat <<EOL > "$GERMAN_FILE"
{
  "app_title": "Demo-App",
  "login": "Anmelden",
  "logout": "Abmelden",
  "register": "Registrieren",
  "email": "E-Mail",
  "password": "Passwort",
  "confirm_password": "Passwort bestätigen",
  "name": "Name",
  "welcome": "Willkommen, {name}!",
  "home": "Startseite",
  "settings": "Einstellungen",
  "profile": "Profil",
  "language": "Sprache",
  "biometric_auth": "Mit Biometrie authentifizieren",
  "face_id": "Face ID",
  "fingerprint": "Fingerabdruck",
  "authentication_success": "Authentifizierung erfolgreich!",
  "authentication_failed": "Authentifizierung fehlgeschlagen!",
  "password_requirements": "Das Passwort muss mindestens 8 Zeichen enthalten, einschließlich Groß- und Kleinbuchstaben, Zahlen und Sonderzeichen.",
  "forgot_password": "Passwort vergessen?",
  "reset_password": "Passwort zurücksetzen",
  "send": "Senden",
  "cancel": "Abbrechen",
  "or_continue_with": "oder fortfahren mit",
  "dont_have_account": "Haben Sie kein Konto?",
  "already_have_account": "Haben Sie bereits ein Konto?",
  "register_now": "Jetzt registrieren",
  "login_now": "Jetzt anmelden",
  "create_account_message": "Lassen Sie uns ein Konto für Sie erstellen",
  "sign_up": "REGISTRIEREN",
  "please_fill_all_fields": "Bitte füllen Sie alle Felder korrekt aus.",
  "password_does_not_meet_requirements": "Das Passwort erfüllt nicht die Anforderungen.",
  "please_enter_your_name": "Bitte geben Sie Ihren Namen ein",
  "please_enter_your_email": "Bitte geben Sie Ihre E-Mail ein",
  "please_enter_valid_email": "Bitte geben Sie eine gültige E-Mail ein",
  "please_enter_your_password": "Bitte geben Sie Ihr Passwort ein",
  "please_confirm_your_password": "Bitte bestätigen Sie Ihr Passwort",
  "passwords_do_not_match": "Passwörter stimmen nicht überein",
  "at_least_1_lowercase": "Mindestens 1 Kleinbuchstabe",
  "at_least_1_uppercase": "Mindestens 1 Großbuchstabe",
  "at_least_1_special_character": "Mindestens 1 Sonderzeichen",
  "at_least_1_number": "Mindestens 1 Zahl",
  "at_least_8_characters": "Mindestens 8 Zeichen lang",
  "forgot_password_title": "Passwort vergessen",
  "forgot_password_subtitle": "Keine Sorge! Das passiert. Bitte geben Sie die E-Mail-Adresse ein, die mit Ihrem Konto verknüpft ist.",
  "enter_email": "Geben Sie Ihre E-Mail ein",
  "send_reset_link": "Reset-Link senden",
  "back_to_login": "Zurück zur Anmeldung",
  "reset_link_sent": "Reset-Link gesendet!",
  "reset_link_sent_message": "Wir haben einen Link zum Zurücksetzen des Passworts an Ihre E-Mail-Adresse gesendet. Bitte überprüfen Sie Ihren Posteingang und folgen Sie den Anweisungen.",
  "reset_link_sent_to": "Reset-Link gesendet an {email}",
  "email_not_found": "E-Mail nicht gefunden",
  "email_not_found_message": "Kein Konto mit dieser E-Mail-Adresse gefunden. Bitte überprüfen Sie Ihre E-Mail oder erstellen Sie ein neues Konto."
}
EOL
  echo "📄 Created de.json file successfully at $GERMAN_FILE"

  # Create French file
  FRENCH_FILE="$DEST_DIR/fr.json"
  cat <<EOL > "$FRENCH_FILE"
{
  "app_title": "Application Démo",
  "login": "Connexion",
  "logout": "Déconnexion",
  "register": "S'inscrire",
  "email": "E-mail",
  "password": "Mot de passe",
  "confirm_password": "Confirmer le mot de passe",
  "name": "Nom",
  "welcome": "Bienvenue, {name}!",
  "home": "Accueil",
  "settings": "Paramètres",
  "profile": "Profil",
  "language": "Langue",
  "biometric_auth": "S'authentifier avec la biométrie",
  "face_id": "Face ID",
  "fingerprint": "Empreinte digitale",
  "authentication_success": "Authentification réussie!",
  "authentication_failed": "Échec de l'authentification!",
  "password_requirements": "Le mot de passe doit contenir au moins 8 caractères, incluant des majuscules, minuscules, chiffres et caractères spéciaux.",
  "forgot_password": "Mot de passe oublié?",
  "reset_password": "Réinitialiser le mot de passe",
  "send": "Envoyer",
  "cancel": "Annuler",
  "or_continue_with": "ou continuer avec",
  "dont_have_account": "Vous n'avez pas de compte?",
  "already_have_account": "Vous avez déjà un compte?",
  "register_now": "S'inscrire maintenant",
  "login_now": "Se connecter maintenant",
  "create_account_message": "Créons un compte pour vous",
  "sign_up": "S'INSCRIRE",
  "please_fill_all_fields": "Veuillez remplir tous les champs correctement.",
  "password_does_not_meet_requirements": "Le mot de passe ne répond pas aux exigences.",
  "please_enter_your_name": "Veuillez entrer votre nom",
  "please_enter_your_email": "Veuillez entrer votre e-mail",
  "please_enter_valid_email": "Veuillez entrer un e-mail valide",
  "please_enter_your_password": "Veuillez entrer votre mot de passe",
  "please_confirm_your_password": "Veuillez confirmer votre mot de passe",
  "passwords_do_not_match": "Les mots de passe ne correspondent pas",
  "at_least_1_lowercase": "Au moins 1 lettre minuscule",
  "at_least_1_uppercase": "Au moins 1 lettre majuscule",
  "at_least_1_special_character": "Au moins 1 caractère spécial",
  "at_least_1_number": "Au moins 1 chiffre",
  "at_least_8_characters": "Au moins 8 caractères",
  "forgot_password_title": "Mot de passe oublié",
  "forgot_password_subtitle": "Ne vous inquiétez pas! Cela arrive. Veuillez entrer l'adresse e-mail associée à votre compte.",
  "enter_email": "Entrez votre e-mail",
  "send_reset_link": "Envoyer le lien de réinitialisation",
  "back_to_login": "Retour à la connexion",
  "reset_link_sent": "Lien de réinitialisation envoyé!",
  "reset_link_sent_message": "Nous avons envoyé un lien de réinitialisation de mot de passe à votre adresse e-mail. Veuillez vérifier votre boîte de réception et suivre les instructions.",
  "reset_link_sent_to": "Lien de réinitialisation envoyé à {email}",
  "email_not_found": "E-mail non trouvé",
  "email_not_found_message": "Aucun compte trouvé avec cette adresse e-mail. Veuillez vérifier votre e-mail ou créer un nouveau compte."
}
EOL
  echo "📄 Created fr.json file successfully at $FRENCH_FILE"

  # Create Spanish file
  SPANISH_FILE="$DEST_DIR/es.json"
  cat <<EOL > "$SPANISH_FILE"
{
  "app_title": "Aplicación Demo",
  "login": "Iniciar sesión",
  "logout": "Cerrar sesión",
  "register": "Registrarse",
  "email": "Correo electrónico",
  "password": "Contraseña",
  "confirm_password": "Confirmar contraseña",
  "name": "Nombre",
  "welcome": "¡Bienvenido, {name}!",
  "home": "Inicio",
  "settings": "Configuración",
  "profile": "Perfil",
  "language": "Idioma",
  "biometric_auth": "Autenticar con biométricos",
  "face_id": "Face ID",
  "fingerprint": "Huella dactilar",
  "authentication_success": "¡Autenticación exitosa!",
  "authentication_failed": "¡Autenticación fallida!",
  "password_requirements": "La contraseña debe contener al menos 8 caracteres, incluyendo mayúsculas, minúsculas, números y caracteres especiales.",
  "forgot_password": "¿Olvidaste tu contraseña?",
  "reset_password": "Restablecer contraseña",
  "send": "Enviar",
  "cancel": "Cancelar",
  "or_continue_with": "o continuar con",
  "dont_have_account": "¿No tienes una cuenta?",
  "already_have_account": "¿Ya tienes una cuenta?",
  "register_now": "Regístrate ahora",
  "login_now": "Inicia sesión ahora",
  "create_account_message": "Creemos una cuenta para ti",
  "sign_up": "REGISTRARSE",
  "please_fill_all_fields": "Por favor, completa todos los campos correctamente.",
  "password_does_not_meet_requirements": "La contraseña no cumple con los requisitos.",
  "please_enter_your_name": "Por favor, ingresa tu nombre",
  "please_enter_your_email": "Por favor, ingresa tu correo electrónico",
  "please_enter_valid_email": "Por favor, ingresa un correo electrónico válido",
  "please_enter_your_password": "Por favor, ingresa tu contraseña",
  "please_confirm_your_password": "Por favor, confirma tu contraseña",
  "passwords_do_not_match": "Las contraseñas no coinciden",
  "at_least_1_lowercase": "Al menos 1 letra minúscula",
  "at_least_1_uppercase": "Al menos 1 letra mayúscula",
  "at_least_1_special_character": "Al menos 1 carácter especial",
  "at_least_1_number": "Al menos 1 número",
  "at_least_8_characters": "Al menos 8 caracteres de longitud",
  "forgot_password_title": "Contraseña olvidada",
  "forgot_password_subtitle": "¡No te preocupes! Esto pasa. Por favor, ingresa la dirección de correo electrónico asociada con tu cuenta.",
  "enter_email": "Ingresa tu correo electrónico",
  "send_reset_link": "Enviar enlace de restablecimiento",
  "back_to_login": "Volver al inicio de sesión",
  "reset_link_sent": "¡Enlace de restablecimiento enviado!",
  "reset_link_sent_message": "Hemos enviado un enlace de restablecimiento de contraseña a tu dirección de correo electrónico. Por favor, revisa tu bandeja de entrada y sigue las instrucciones.",
  "reset_link_sent_to": "Enlace de restablecimiento enviado a {email}",
  "email_not_found": "Correo electrónico no encontrado",
  "email_not_found_message": "No se encontró ninguna cuenta con esta dirección de correo electrónico. Por favor, verifica tu correo electrónico o crea una nueva cuenta."
}
EOL
  echo "📄 Created es.json file successfully at $SPANISH_FILE"

  # Create Italian file
  ITALIAN_FILE="$DEST_DIR/it.json"
  cat <<EOL > "$ITALIAN_FILE"
{
  "app_title": "App Demo",
  "login": "Accedi",
  "logout": "Esci",
  "register": "Registrati",
  "email": "Email",
  "password": "Password",
  "confirm_password": "Conferma password",
  "name": "Nome",
  "welcome": "Benvenuto, {name}!",
  "home": "Home",
  "settings": "Impostazioni",
  "profile": "Profilo",
  "language": "Lingua",
  "biometric_auth": "Autenticati con biometria",
  "face_id": "Face ID",
  "fingerprint": "Impronta digitale",
  "authentication_success": "Autenticazione riuscita!",
  "authentication_failed": "Autenticazione fallita!",
  "password_requirements": "La password deve contenere almeno 8 caratteri, inclusi maiuscole, minuscole, numeri e caratteri speciali.",
  "forgot_password": "Password dimenticata?",
  "reset_password": "Reimposta password",
  "send": "Invia",
  "cancel": "Annulla",
  "or_continue_with": "o continua con",
  "dont_have_account": "Non hai un account?",
  "already_have_account": "Hai già un account?",
  "register_now": "Registrati ora",
  "login_now": "Accedi ora",
  "create_account_message": "Creiamo un account per te",
  "sign_up": "REGISTRATI",
  "please_fill_all_fields": "Per favore, compila tutti i campi correttamente.",
  "password_does_not_meet_requirements": "La password non soddisfa i requisiti.",
  "please_enter_your_name": "Per favore, inserisci il tuo nome",
  "please_enter_your_email": "Per favore, inserisci la tua email",
  "please_enter_valid_email": "Per favore, inserisci un'email valida",
  "please_enter_your_password": "Per favore, inserisci la tua password",
  "please_confirm_your_password": "Per favore, conferma la tua password",
  "passwords_do_not_match": "Le password non corrispondono",
  "at_least_1_lowercase": "Almeno 1 lettera minuscola",
  "at_least_1_uppercase": "Almeno 1 lettera maiuscola",
  "at_least_1_special_character": "Almeno 1 carattere speciale",
  "at_least_1_number": "Almeno 1 numero",
  "at_least_8_characters": "Almeno 8 caratteri di lunghezza",
  "forgot_password_title": "Password dimenticata",
  "forgot_password_subtitle": "Non preoccuparti! Capita. Per favore, inserisci l'indirizzo email associato al tuo account.",
  "enter_email": "Inserisci la tua email",
  "send_reset_link": "Invia link di reimpostazione",
  "back_to_login": "Torna al login",
  "reset_link_sent": "Link di reimpostazione inviato!",
  "reset_link_sent_message": "Abbiamo inviato un link di reimpostazione password al tuo indirizzo email. Per favore, controlla la tua casella di posta e segui le istruzioni.",
  "reset_link_sent_to": "Link di reimpostazione inviato a {email}",
  "email_not_found": "Email non trovata",
  "email_not_found_message": "Nessun account trovato con questo indirizzo email. Per favore, controlla la tua email o crea un nuovo account."
}
EOL
  echo "📄 Created it.json file successfully at $ITALIAN_FILE"

  # Create Japanese file
  JAPANESE_FILE="$DEST_DIR/ja.json"
  cat <<EOL > "$JAPANESE_FILE"
{
  "app_title": "デモアプリ",
  "login": "ログイン",
  "logout": "ログアウト",
  "register": "登録",
  "email": "メールアドレス",
  "password": "パスワード",
  "confirm_password": "パスワード確認",
  "name": "名前",
  "welcome": "ようこそ、{name}さん！",
  "home": "ホーム",
  "settings": "設定",
  "profile": "プロフィール",
  "language": "言語",
  "biometric_auth": "生体認証で認証",
  "face_id": "Face ID",
  "fingerprint": "指紋",
  "authentication_success": "認証に成功しました！",
  "authentication_failed": "認証に失敗しました！",
  "password_requirements": "パスワードは大文字、小文字、数字、特殊文字を含む8文字以上である必要があります。",
  "forgot_password": "パスワードを忘れましたか？",
  "reset_password": "パスワードリセット",
  "send": "送信",
  "cancel": "キャンセル",
  "or_continue_with": "または続ける",
  "dont_have_account": "アカウントをお持ちではありませんか？",
  "already_have_account": "すでにアカウントをお持ちですか？",
  "register_now": "今すぐ登録",
  "login_now": "今すぐログイン",
  "create_account_message": "アカウントを作成しましょう",
  "sign_up": "サインアップ",
  "please_fill_all_fields": "すべての項目を正しく入力してください。",
  "password_does_not_meet_requirements": "パスワードが要件を満たしていません。",
  "please_enter_your_name": "お名前を入力してください",
  "please_enter_your_email": "メールアドレスを入力してください",
  "please_enter_valid_email": "有効なメールアドレスを入力してください",
  "please_enter_your_password": "パスワードを入力してください",
  "please_confirm_your_password": "パスワードを確認してください",
  "passwords_do_not_match": "パスワードが一致しません",
  "at_least_1_lowercase": "小文字を1文字以上",
  "at_least_1_uppercase": "大文字を1文字以上",
  "at_least_1_special_character": "特殊文字を1文字以上",
  "at_least_1_number": "数字を1文字以上",
  "at_least_8_characters": "8文字以上",
  "forgot_password_title": "パスワードを忘れた場合",
  "forgot_password_subtitle": "ご心配なく！よくあることです。アカウントに関連付けられたメールアドレスを入力してください。",
  "enter_email": "メールアドレスを入力",
  "send_reset_link": "リセットリンクを送信",
  "back_to_login": "ログインに戻る",
  "reset_link_sent": "リセットリンクを送信しました！",
  "reset_link_sent_message": "パスワードリセットリンクをメールアドレスに送信しました。受信トレイを確認し、指示に従ってください。",
  "reset_link_sent_to": "リセットリンクを{email}に送信しました",
  "email_not_found": "メールアドレスが見つかりません",
  "email_not_found_message": "このメールアドレスのアカウントが見つかりません。メールアドレスを確認するか、新しいアカウントを作成してください。"
}
EOL
  echo "📄 Created ja.json file successfully at $JAPANESE_FILE"

  # Create Korean file
  KOREAN_FILE="$DEST_DIR/ko.json"
  cat <<EOL > "$KOREAN_FILE"
{
  "app_title": "데모 앱",
  "login": "로그인",
  "logout": "로그아웃",
  "register": "회원가입",
  "email": "이메일",
  "password": "비밀번호",
  "confirm_password": "비밀번호 확인",
  "name": "이름",
  "welcome": "환영합니다, {name}님!",
  "home": "홈",
  "settings": "설정",
  "profile": "프로필",
  "language": "언어",
  "biometric_auth": "생체 인증으로 인증",
  "face_id": "Face ID",
  "fingerprint": "지문",
  "authentication_success": "인증에 성공했습니다!",
  "authentication_failed": "인증에 실패했습니다!",
  "password_requirements": "비밀번호는 대문자, 소문자, 숫자, 특수문자를 포함하여 최소 8자 이상이어야 합니다.",
  "forgot_password": "비밀번호를 잊으셨나요?",
  "reset_password": "비밀번호 재설정",
  "send": "보내기",
  "cancel": "취소",
  "or_continue_with": "또는 계속하기",
  "dont_have_account": "계정이 없으신가요?",
  "already_have_account": "이미 계정이 있으신가요?",
  "register_now": "지금 가입하기",
  "login_now": "지금 로그인하기",
  "create_account_message": "계정을 만들어보겠습니다",
  "sign_up": "회원가입",
  "please_fill_all_fields": "모든 필드를 올바르게 입력해주세요.",
  "password_does_not_meet_requirements": "비밀번호가 요구사항을 충족하지 않습니다.",
  "please_enter_your_name": "이름을 입력해주세요",
  "please_enter_your_email": "이메일을 입력해주세요",
  "please_enter_valid_email": "유효한 이메일을 입력해주세요",
  "please_enter_your_password": "비밀번호를 입력해주세요",
  "please_confirm_your_password": "비밀번호를 확인해주세요",
  "passwords_do_not_match": "비밀번호가 일치하지 않습니다",
  "at_least_1_lowercase": "소문자 최소 1개",
  "at_least_1_uppercase": "대문자 최소 1개",
  "at_least_1_special_character": "특수문자 최소 1개",
  "at_least_1_number": "숫자 최소 1개",
  "at_least_8_characters": "최소 8자 이상",
  "forgot_password_title": "비밀번호 찾기",
  "forgot_password_subtitle": "걱정하지 마세요! 이런 일은 흔합니다. 계정과 연관된 이메일 주소를 입력해주세요.",
  "enter_email": "이메일을 입력하세요",
  "send_reset_link": "재설정 링크 보내기",
  "back_to_login": "로그인으로 돌아가기",
  "reset_link_sent": "재설정 링크를 보냈습니다!",
  "reset_link_sent_message": "비밀번호 재설정 링크를 이메일 주소로 보냈습니다. 받은편지함을 확인하고 지시사항을 따라주세요.",
  "reset_link_sent_to": "{email}로 재설정 링크를 보냈습니다",
  "email_not_found": "이메일을 찾을 수 없습니다",
  "email_not_found_message": "이 이메일 주소로 된 계정을 찾을 수 없습니다. 이메일을 확인하거나 새 계정을 만들어주세요."
}
EOL
  echo "📄 Created ko.json file successfully at $KOREAN_FILE"

  # Create Chinese file
  CHINESE_FILE="$DEST_DIR/zh.json"
  cat <<EOL > "$CHINESE_FILE"
{
  "app_title": "演示应用",
  "login": "登录",
  "logout": "退出登录",
  "register": "注册",
  "email": "邮箱",
  "password": "密码",
  "confirm_password": "确认密码",
  "name": "姓名",
  "welcome": "欢迎，{name}！",
  "home": "首页",
  "settings": "设置",
  "profile": "个人资料",
  "language": "语言",
  "biometric_auth": "使用生物识别验证",
  "face_id": "面容ID",
  "fingerprint": "指纹",
  "authentication_success": "验证成功！",
  "authentication_failed": "验证失败！",
  "password_requirements": "密码必须包含至少8个字符，包括大写字母、小写字母、数字和特殊字符。",
  "forgot_password": "忘记密码？",
  "reset_password": "重置密码",
  "send": "发送",
  "cancel": "取消",
  "or_continue_with": "或继续使用",
  "dont_have_account": "没有账户？",
  "already_have_account": "已有账户？",
  "register_now": "立即注册",
  "login_now": "立即登录",
  "create_account_message": "让我们为您创建一个账户",
  "sign_up": "注册",
  "please_fill_all_fields": "请正确填写所有字段。",
  "password_does_not_meet_requirements": "密码不符合要求。",
  "please_enter_your_name": "请输入您的姓名",
  "please_enter_your_email": "请输入您的邮箱",
  "please_enter_valid_email": "请输入有效的邮箱",
  "please_enter_your_password": "请输入您的密码",
  "please_confirm_your_password": "请确认您的密码",
  "passwords_do_not_match": "密码不匹配",
  "at_least_1_lowercase": "至少1个小写字母",
  "at_least_1_uppercase": "至少1个大写字母",
  "at_least_1_special_character": "至少1个特殊字符",
  "at_least_1_number": "至少1个数字",
  "at_least_8_characters": "至少8个字符长度",
  "forgot_password_title": "忘记密码",
  "forgot_password_subtitle": "别担心！这种情况经常发生。请输入与您账户关联的邮箱地址。",
  "enter_email": "输入您的邮箱",
  "send_reset_link": "发送重置链接",
  "back_to_login": "返回登录",
  "reset_link_sent": "重置链接已发送！",
  "reset_link_sent_message": "我们已向您的邮箱地址发送了密码重置链接。请检查您的收件箱并按照说明操作。",
  "reset_link_sent_to": "重置链接已发送至{email}",
  "email_not_found": "未找到邮箱",
  "email_not_found_message": "未找到使用此邮箱地址的账户。请检查您的邮箱或创建新账户。"
}
EOL
  echo "📄 Created zh.json file successfully at $CHINESE_FILE"

  echo "✅ All localization templates generated successfully."
  echo

  echo "Now Adding assets/l10n/ path to pubspec.yaml"
  cd - >/dev/null || exit 1

  # Get the absolute path to the real script location, resolving symlinks
  # Get the absolute path to the real script location, resolving symlinks
  # If SCRIPT_DIR is already set (from parent script), use that instead
  if [ -z "$SCRIPT_DIR" ]; then
    SOURCE="${BASH_SOURCE[0]}"
    while [ -h "$SOURCE" ]; do
      DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
      SOURCE="$(readlink "$SOURCE")"
      [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
    done
    SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")/../../.." && pwd)"
  fi

  source "$SCRIPT_DIR/templates/helper/add_assets_yaml.sh"

  echo "✅ Localization structure created successfully at $DEST_DIR"
  echo "You can now use these localization files in your Flutter project"

}

export -f create_easy_localization_structure
