export const languages = {
  en: "English",
  zh: "简体中文",
} as const;

export const defaultLang = "en";
export const translations = {
  en: {
    nav: {
      home: "Home",
      about: "About",
      projects: "Projects",
      blog: "Blog",
      hire: "Hire",
      uses: "Uses",
      contact: "Contact",
      now: "Now",
    },
    site: {
      title: "Joey Z. - AI Full-stack Engineer",
      description:
        "AI full-stack engineer focused on complex systems, product delivery, and long-term maintainability",
    },
    hero: {
      greeting: "Hello, I'm",
      viewProjects: "View Projects",
      contactMe: "Get in Touch",
      lookingForJob:
        "Looking for a Frontend/TS Full-stack Engineer (Remote)? Contact me!",
      digitalNomad:
        "Exploring the freelance journey, striving to become a digital nomad",
      contactInfo: "Contact Me",
      githubLink: "GitHub Profile",
      linkedinLink: "LinkedIn Profile",
      tagline: "Full-stack + AI Product Builder",
      ctaPrimary: "Let's Build Together",
      ctaSecondary: "View My Work",
    },
    footer: {
      rights: "All rights reserved",
    },
    project: {
      featured: "Featured",
      filter: {
        all: "All",
      },
      tag: {
        business: "Business Project",
        opensource: "Open Source",
        personal: "Personal Product",
        portfolio: "Portfolio",
        ecommerce: "E-Commerce",
      },
      type: {
        product: "Product",
        client: "Client Project",
        experiment: "Experiment",
      },
      status: {
        building: "Building",
        completed: "Completed",
        archived: "Archived",
      },
      role: "Role",
      impact: "Impact",
      visit: "Visit",
      demo: "Live Demo",
    },
    projects: {
      title: "My Projects",
      description:
        "A collection of my recent work, showcasing innovative solutions and clean code. Explore the details of each project below.",
      slogan:
        "Crafting elegant solutions to complex problems with clean code and innovative thinking.",
    },
    blog: {
      slogan: "This is where innovative thinking meets complex problems.",
      backToList: "Back to Writing",
    },
    services: {
      title: "What I Do",
      viewAll: "Learn More",
    },
    about: {
      title: "About Me",
      description: "Learn more about my background, skills, and experiences",
      intro: {
        title: "Introduction",
        content:
          "I'm a TypeScript Full Stack Engineer who loves development, technology, and exploring new possibilities. I enjoy bringing digital projects to life. 🚀",
        belief:
          "I believe this is where ideas become reality. I'm exploring the freelance journey, striving to become a digital nomad.",
      },
      me: {
        title: "About me 🧠",
        content:
          "I started my programming journey in 2016 when I accidentally encountered programming. This opportunity became the catalyst for my coding adventure, and I fell in love with programming during my subsequent self-learning journey. \n\nI enjoy creating websites and applications with code and sharing them with users. The sense of achievement I get from this process makes me increasingly fascinated. My dream is to become a lifelong coder.",
      },
      skills: {
        title: "My Skills 💪",
        description:
          "Below are the technology stacks I'm currently familiar with or proficient in, as well as those I'm learning or planning to learn.",
        mastered: {
          title: "Skills I've Mastered",
          items: [
            "HTML, CSS, JavaScript",
            "Frontend Frameworks: Vue.js, React.js, Node.js, uniApp, WeChat Mini Program",
            "TypeScript",
            "Databases: MySQL, MongoDB",
            "DevOps: Linux, Git",
            "Others: Markdown, Docker, Kubernetes, Nginx, Apache, etc.",
          ],
        },
        learning: {
          title: "Skills I'm Learning/Planning to Learn",
          items: [
            "Programming Languages: Python, Java, Go",
            "Mobile Development: Flutter, Dart",
            "iOS Development: Swift, SwiftUI",
          ],
        },
      },
      interests: {
        title: "My Interests 🌈",
        items: [
          {
            title: "Reading",
            content:
              "I enjoy reading various books, especially technical ones.",
          },
          {
            title: "Travel",
            content:
              "I like visiting different places, particularly on road trips.",
          },
          {
            title: "Food",
            content: "I enjoy various cuisines, especially hot pot.",
          },
          {
            title: "Mobile Games",
            content:
              "I like playing League of Legends, Honor of Kings, PUBG Mobile, and other mobile games.",
          },
        ],
      },
      contact: {
        title: "Contact Me 📫",
        warning:
          "Since everyone's time is valuable, please add a note when contacting me, such as: collaboration, consultation, project requirements, etc. I may not reply to or might ignore messages without notes. Thank you for your cooperation!",
        methods: [
          {
            label: "Email",
            value: "32df4a784e33b3964f4c06f6c6aeeecd",
            icon: "mail",
          },
          {
            label: "WeChat",
            value: "1b2f7b05fca4d2b892e7fa7741d077ee",
            icon: "wechat",
          },
          {
            label: "Telegram",
            value: "592dff213bb5e79a511c34a37f7edbb5",
            icon: "send",
          },
        ],
      },
      socials: {
        title: "Community & Media 🌐",
        items: [
          {
            label: "GitHub",
            value: "github.com/zhaoguiyang",
            icon: "github",
            link: "https://github.com/zhaoguiyang",
          },
          {
            label: "Blog",
            value: "zhaoguiyang.site",
            icon: "globe",
            link: "https://zhaoguiyang.site",
          },
        ],
      },
    },
    home: {
      hero: {
        eyebrow: "Personal Brand",
        summary:
          "I design and build reliable digital products with clear user value, strong engineering foundations, and practical AI integration.",
        ctaPrimary: "About Me",
        ctaSecondary: "Work With Me",
        terminalStatus: "Open to remote roles and project collaboration",
      },
      trust: {
        item1: "Remote Ready",
        item2: "Async Friendly Collaboration",
        item3: "Product + Engineering Mindset",
        item4: "Stable Delivery Rhythm",
      },
      metrics: {
        item1: "Focused on long-term product quality",
        item2: "Strong in TypeScript, React, and Node.js",
        item3: "Comfortable with AI-enabled product workflows",
        item4: "Available for freelance and full-time opportunities",
      },
      services: {
        eyebrow: "What I Deliver",
        title: "Services",
        description: "Practical technical support from strategy to execution.",
      },
      career: {
        eyebrow: "Career Snapshot",
        title: "Career Highlights",
        description:
          "Mock milestones for layout. Real details can be swapped in later.",
        cta: "View Full Resume",
        card1: {
          period: "2024 — Now",
          title: "AI Product Builder · Independent",
          outcome:
            "Built and iterated AI-first product concepts with fast prototyping and clear product direction.",
        },
        card2: {
          period: "2021 — 2024",
          title: "Senior Frontend Engineer · Remote Team",
          outcome:
            "Led core front-end modules and improved team delivery efficiency through reusable architecture.",
        },
        card3: {
          period: "2018 — 2021",
          title: "Full-stack Engineer · Growth Stage Startup",
          outcome:
            "Delivered multiple customer-facing features across web stack and supported stable product growth.",
        },
      },
      featured: {
        eyebrow: "Featured Work",
        title: "Representative Project",
        challenge: "Challenge",
        approach: "Approach",
        outcome: "Outcome",
        ctaPrimary: "View Project",
        ctaSecondary: "See More Opportunities",
      },
      final: {
        title: "Open to Meaningful Work",
        description:
          "If you are building quality products and need reliable execution, I would love to connect.",
        ctaPrimary: "Know Me Better",
        ctaSecondary: "Start a Conversation",
      },
    },
  },
  zh: {
    nav: {
      home: "首页",
      about: "关于",
      projects: "项目",
      blog: "博客",
      hire: "合作",
      uses: "工具",
      contact: "联系",
      now: "现在",
    },
    site: {
      title: "Joey Z. - AI 全栈工程师",
      description: "专注复杂系统、产品交付与长期可维护性的 AI 全栈工程师",
    },
    hero: {
      greeting: "你好，我是",
      viewProjects: "查看项目",
      contactMe: "联系我",
      lookingForJob: "正在寻找前端/TS 全栈工程师（远程）？联系我！",
      digitalNomad: "探索自由职业道路，努力成为数字游民",
      contactInfo: "联系我",
      githubLink: "GitHub 主页",
      linkedinLink: "LinkedIn 主页",
      tagline: "全栈 + AI 产品构建者",
      ctaPrimary: "一起构建",
      ctaSecondary: "查看作品",
    },
    footer: {
      rights: "版权所有",
    },
    project: {
      featured: "精选",
      filter: {
        all: "全部",
      },
      tag: {
        business: "商业项目",
        opensource: "开源项目",
        personal: "个人项目",
        portfolio: "作品集",
        ecommerce: "电子商务",
      },
      type: {
        product: "产品",
        client: "客户项目",
        experiment: "实验",
      },
      status: {
        building: "开发中",
        completed: "已完成",
        archived: "已归档",
      },
      role: "角色",
      impact: "成果",
      visit: "访问",
      demo: "在线演示",
    },
    projects: {
      title: "我的项目",
      description:
        "这里展示了我最近的作品集，展现了创新解决方案和整洁的代码。请浏览下方了解每个项目的详细信息。",
      slogan: "用优雅的代码和创新的思维，为复杂问题打造精致的解决方案。",
    },
    blog: {
      slogan: "这里是创新思维与复杂问题相遇的地方。",
      backToList: "返回写作列表",
    },
    services: {
      title: "我能做什么",
      viewAll: "了解更多",
    },
    about: {
      title: "关于我",
      description: "了解更多关于我的背景、技能和经验",
      intro: {
        title: "简介",
        content:
          "我是Joey Z., 一名Ts全栈工程师，也是本站的站长。\n\n热爱生活、阅读以及编程，寻找远程工作的机会，探索自由职业的可能性。\n喜欢自驾，去追寻那些美丽的风景，尝试新的事物。",
        belief:
          "我相信这里是想法变为现实的地方。我正在探索自由职业者之路，努力成为数字游民中的一员。",
      },
      me: {
        title: "自我介绍 🧠",
        content:
          "在2016年一次偶然的机会中接触到了编程，以此为契机，开始了我的编程之旅，并在后续的自学之旅中爱上了编程，我喜欢用代码编写出一个个的网页、应用，分享给用户使用，这其中获得的成就感让我愈发着迷。梦想是成为一名终身编码者。",
      },
      skills: {
        title: "我的技能 💪",
        description:
          "以下展示了我目前熟悉或精通的技术栈，以及正在/准备学习的技术栈。",
        mastered: {
          title: "已掌握的技能",
          items: [
            "HTML、CSS、JavaScript",
            "Vue.js、React.js、Node.js、uniApp、微信小程序等前端框架",
            "TypeScript",
            "MySQL、MongoDB",
            "Linux、Git",
            "其他：Markdown、Docker、Kubernetes、Nginx、Apache等技术",
          ],
        },
        learning: {
          title: "正在/准备学习的技能",
          items: ["Python、Java、Go", "Flutter、Dart", "Swift、SwiftUI"],
        },
      },
      interests: {
        title: "兴趣爱好 🌈",
        items: [
          { title: "阅读", content: "喜欢阅读各种书籍，尤其是技术类书籍。" },
          { title: "旅游", content: "喜欢去不同的地方看看，尤其是自驾游。" },
          { title: "美食", content: "喜欢吃各种美食，尤其是火锅。" },
          {
            title: "手游",
            content: "喜欢玩英雄联盟、王者荣耀、绝地求生等手游。",
          },
        ],
      },
      contact: {
        title: "联系我 📫",
        warning:
          "由于大家的时间都很宝贵，所以请在联系我时添加备注，如：合作、咨询、项目需求等，不予备注的我可能不会回复或直接忽略，谢谢合作！",
        methods: [
          {
            label: "邮箱",
            value: "32df4a784e33b3964f4c06f6c6aeeecd",
            icon: "mail",
          },
          {
            label: "微信",
            value: "1b2f7b05fca4d2b892e7fa7741d077ee",
            icon: "wechat",
          },
          {
            label: "Telegram",
            value: "592dff213bb5e79a511c34a37f7edbb5",
            icon: "send",
          },
        ],
      },
      socials: {
        title: "社区与媒体 🌐",
        items: [
          {
            label: "GitHub",
            value: "github.com/zhaoguiyang",
            icon: "github",
            link: "https://github.com/zhaoguiyang",
          },
          {
            label: "Blog",
            value: "zhaoguiyang.site",
            icon: "globe",
            link: "https://zhaoguiyang.site",
          },
        ],
      },
    },
    home: {
      hero: {
        eyebrow: "个人品牌",
        summary:
          "我专注于打造可靠且有业务价值的数字产品，兼顾工程质量、产品思维与 AI 实践落地。",
        ctaPrimary: "了解我",
        ctaSecondary: "合作咨询",
        terminalStatus: "可远程合作，开放全职与项目机会",
      },
      trust: {
        item1: "支持远程协作",
        item2: "擅长异步协作流程",
        item3: "产品与工程双视角",
        item4: "稳定可预期的交付节奏",
      },
      metrics: {
        item1: "重视长期可维护的产品质量",
        item2: "核心技术栈 TypeScript / React / Node.js",
        item3: "具备 AI 产品化与工程化经验",
        item4: "可承接项目合作与全职机会",
      },
      services: {
        eyebrow: "可交付能力",
        title: "服务方向",
        description: "从技术方案到落地交付，提供务实可靠的支持。",
      },
      career: {
        eyebrow: "履历速览",
        title: "关键经历",
        description: "当前为布局示例数据，后续可替换为你的真实履历。",
        cta: "查看完整履历",
        card1: {
          period: "2024 — 至今",
          title: "AI 产品构建者 · 独立开发",
          outcome:
            "围绕 AI 场景进行产品探索与快速原型迭代，持续验证方向与可行性。",
        },
        card2: {
          period: "2021 — 2024",
          title: "高级前端工程师 · 远程团队",
          outcome:
            "负责核心前端模块建设，通过可复用架构提升团队交付效率与稳定性。",
        },
        card3: {
          period: "2018 — 2021",
          title: "全栈工程师 · 成长期团队",
          outcome:
            "完成多项面向用户的功能交付，覆盖前后端协作并支撑产品稳定增长。",
        },
      },
      featured: {
        eyebrow: "代表作品",
        title: "精选项目",
        challenge: "挑战",
        approach: "方案",
        outcome: "结果",
        ctaPrimary: "查看项目",
        ctaSecondary: "了解合作方式",
      },
      final: {
        title: "期待长期且有价值的合作",
        description:
          "如果你也在构建高质量产品，并需要稳定执行与协作，我很乐意进一步沟通。",
        ctaPrimary: "进一步了解我",
        ctaSecondary: "发起沟通",
      },
    },
  },
} as const;

/**
 * Generate flattened translations for better performance
 * This creates a flat object with dot notation keys
 */
export function generateFlatTranslations() {
  const flattenedTranslations: Record<string, Record<string, string>> = {};

  // Initialize for each language
  Object.keys(translations).forEach((lang) => {
    flattenedTranslations[lang] = {};
  });

  // Recursive function to flatten nested objects
  function flatten(obj: any, lang: string, prefix = "") {
    for (const key in obj) {
      const value = obj[key];
      const newKey = prefix ? `${prefix}.${key}` : key;

      if (typeof value === "object" && value !== null) {
        flatten(value, lang, newKey);
      } else {
        flattenedTranslations[lang][newKey] = value;
      }
    }
  }

  // Process each language
  Object.keys(translations).forEach((lang) => {
    flatten(translations[lang as keyof typeof translations], lang);
  });

  return flattenedTranslations;
}

/**
 * Flattened translations for faster lookups
 */
export const flatTranslations = generateFlatTranslations();
