<?php
/**
 * Complete Module Translations Script
 *
 * This script generates translations for all modules by applying
 * a comprehensive translation dictionary.
 */

// Translation dictionaries for each language
$translations = [
    'ja' => [
        // Common terms
        "Dashboard" => "ダッシュボード",
        "Settings" => "設定",
        "Save" => "保存",
        "Save Settings" => "設定を保存",
        "Cancel" => "キャンセル",
        "Delete" => "削除",
        "Edit" => "編集",
        "Create" => "作成",
        "Update" => "更新",
        "View" => "表示",
        "Search" => "検索",
        "Filter" => "フィルター",
        "Export" => "エクスポート",
        "Import" => "インポート",
        "Download" => "ダウンロード",
        "Upload" => "アップロード",
        "Submit" => "送信",
        "Confirm" => "確認",
        "Yes" => "はい",
        "No" => "いいえ",
        "OK" => "OK",
        "Close" => "閉じる",
        "Back" => "戻る",
        "Next" => "次へ",
        "Previous" => "前へ",
        "First" => "最初",
        "Last" => "最後",
        "Add" => "追加",
        "Remove" => "削除",
        "Select" => "選択",
        "All" => "すべて",
        "None" => "なし",
        "Name" => "名前",
        "Title" => "タイトル",
        "Description" => "説明",
        "Status" => "ステータス",
        "Date" => "日付",
        "Time" => "時間",
        "Actions" => "アクション",
        "Details" => "詳細",
        "Information" => "情報",
        "Notes" => "メモ",
        "Comments" => "コメント",
        "Active" => "アクティブ",
        "Inactive" => "非アクティブ",
        "Enabled" => "有効",
        "Disabled" => "無効",
        "Pending" => "保留中",
        "Approved" => "承認済み",
        "Rejected" => "却下",
        "Employee" => "従業員",
        "Employees" => "従業員",
        "Department" => "部門",
        "Departments" => "部門",
        "Company" => "会社",
        "Branch" => "支店",
        "Manager" => "マネージャー",
        "Admin" => "管理者",
        "User" => "ユーザー",
        "Users" => "ユーザー",
        "Role" => "役割",
        "Roles" => "役割",
        "Permission" => "権限",
        "Permissions" => "権限",
        "Email" => "メール",
        "Phone" => "電話",
        "Address" => "住所",
        "Country" => "国",
        "City" => "都市",
        "Code" => "コード",
        "Amount" => "金額",
        "Total" => "合計",
        "Price" => "価格",
        "Quantity" => "数量",
        "Report" => "レポート",
        "Reports" => "レポート",
        "Calendar" => "カレンダー",
        "List" => "リスト",
        "Table" => "テーブル",
        "Chart" => "チャート",
        "Overview" => "概要",
        "Summary" => "概要",
        "Configuration" => "設定",
        "General" => "一般",
        "Advanced" => "詳細設定",
        "Basic" => "基本",
        "Required" => "必須",
        "Optional" => "任意",
        "Loading..." => "読み込み中...",
        "Please wait..." => "お待ちください...",
        "Success" => "成功",
        "Error" => "エラー",
        "Warning" => "警告",
        "Info" => "情報",
        "Help" => "ヘルプ",
        "Support" => "サポート",
        "Contact" => "連絡先",
        "Home" => "ホーム",
        "Profile" => "プロフィール",
        "Account" => "アカウント",
        "Logout" => "ログアウト",
        "Login" => "ログイン",
        "Password" => "パスワード",
        "Username" => "ユーザー名",
        "Remember me" => "ログイン状態を保持",
        "Forgot password?" => "パスワードをお忘れですか？",
        "Sign in" => "サインイン",
        "Sign out" => "サインアウト",
        "Register" => "登録",
        "Type" => "タイプ",
        "Category" => "カテゴリー",
        "Categories" => "カテゴリー",
        "Group" => "グループ",
        "Groups" => "グループ",
        "Location" => "場所",
        "Locations" => "場所",
        "Shift" => "シフト",
        "Shifts" => "シフト",
        "Holiday" => "休日",
        "Holidays" => "休日",
        "Leave" => "休暇",
        "Leaves" => "休暇",
        "Attendance" => "出勤",
        "Check In" => "チェックイン",
        "Check Out" => "チェックアウト",
        "Present" => "出勤",
        "Absent" => "欠勤",
        "Late" => "遅刻",
        "Early" => "早退",
        "Overtime" => "残業",
        "Working Hours" => "勤務時間",
        "Payroll" => "給与計算",
        "Salary" => "給与",
        "Bonus" => "ボーナス",
        "Deduction" => "控除",
        "Deductions" => "控除",
        "Tax" => "税金",
        "Taxes" => "税金",
        "Net" => "手取り",
        "Gross" => "総額",
        "Basic" => "基本",
        "Allowance" => "手当",
        "Allowances" => "手当",
        "Benefits" => "福利厚生",
        "Bank" => "銀行",
        "Account Number" => "口座番号",
        "Payment" => "支払い",
        "Payments" => "支払い",
        "Invoice" => "請求書",
        "Invoices" => "請求書",
        "Order" => "注文",
        "Orders" => "注文",
        "Product" => "製品",
        "Products" => "製品",
        "Customer" => "顧客",
        "Customers" => "顧客",
        "Supplier" => "サプライヤー",
        "Suppliers" => "サプライヤー",
        "Inventory" => "在庫",
        "Stock" => "在庫",
        "Warehouse" => "倉庫",
        "Warehouses" => "倉庫",
        "Transfer" => "移動",
        "Transfers" => "移動",
        "Adjustment" => "調整",
        "Adjustments" => "調整",
        "Project" => "プロジェクト",
        "Projects" => "プロジェクト",
        "Task" => "タスク",
        "Tasks" => "タスク",
        "Document" => "ドキュメント",
        "Documents" => "ドキュメント",
        "File" => "ファイル",
        "Files" => "ファイル",
        "Folder" => "フォルダー",
        "Folders" => "フォルダー",
        "Notification" => "通知",
        "Notifications" => "通知",
        "Message" => "メッセージ",
        "Messages" => "メッセージ",
        "Chat" => "チャット",
        "Meeting" => "会議",
        "Meetings" => "会議",
        "Event" => "イベント",
        "Events" => "イベント",
        "Announcement" => "お知らせ",
        "Announcements" => "お知らせ",
        "Notice" => "通知",
        "Notices" => "通知",
        "Policy" => "ポリシー",
        "Policies" => "ポリシー",
        "Request" => "リクエスト",
        "Requests" => "リクエスト",
        "Approval" => "承認",
        "Approvals" => "承認",
        "History" => "履歴",
        "Log" => "ログ",
        "Logs" => "ログ",
        "Activity" => "アクティビティ",
        "Activities" => "アクティビティ",
        "Audit" => "監査",
        "Backup" => "バックアップ",
        "Restore" => "復元",
        "System" => "システム",
        "Module" => "モジュール",
        "Modules" => "モジュール",
        "Version" => "バージョン",
        "Language" => "言語",
        "Languages" => "言語",
        "Currency" => "通貨",
        "Timezone" => "タイムゾーン",
        "Format" => "フォーマット",
        "Template" => "テンプレート",
        "Templates" => "テンプレート",
        "Field" => "フィールド",
        "Fields" => "フィールド",
        "Form" => "フォーム",
        "Forms" => "フォーム",
        "Builder" => "ビルダー",
        "Workflow" => "ワークフロー",
        "Workflows" => "ワークフロー",
        "Integration" => "統合",
        "API" => "API",
        "Webhook" => "Webhook",
        "Security" => "セキュリティ",
        "Privacy" => "プライバシー",
        "Terms" => "利用規約",
        "License" => "ライセンス",
        "Subscription" => "サブスクリプション",
        "Plan" => "プラン",
        "Plans" => "プラン",
        "Billing" => "請求",
        "Month" => "月",
        "Year" => "年",
        "Day" => "日",
        "Week" => "週",
        "Today" => "今日",
        "Yesterday" => "昨日",
        "Tomorrow" => "明日",
        "This week" => "今週",
        "This month" => "今月",
        "This year" => "今年",
        "Last week" => "先週",
        "Last month" => "先月",
        "Last year" => "昨年",
        "Start Date" => "開始日",
        "End Date" => "終了日",
        "Due Date" => "期限",
        "Created At" => "作成日時",
        "Updated At" => "更新日時",
        "Created By" => "作成者",
        "Updated By" => "更新者",
        "From" => "から",
        "To" => "まで",
        "Min" => "最小",
        "Max" => "最大",
        "Average" => "平均",
        "Count" => "件数",
        "Percentage" => "パーセント",
        "Show" => "表示",
        "Hide" => "非表示",
        "Expand" => "展開",
        "Collapse" => "折りたたむ",
        "Refresh" => "更新",
        "Reset" => "リセット",
        "Clear" => "クリア",
        "Apply" => "適用",
        "Print" => "印刷",
        "Copy" => "コピー",
        "Paste" => "貼り付け",
        "Cut" => "切り取り",
        "Undo" => "元に戻す",
        "Redo" => "やり直し",
        "Duplicate" => "複製",
        "Archive" => "アーカイブ",
        "Unarchive" => "アーカイブ解除",
        "Publish" => "公開",
        "Unpublish" => "非公開",
        "Draft" => "下書き",
        "Drafts" => "下書き",
        "Preview" => "プレビュー",
        "Send" => "送信",
        "Receive" => "受信",
        "Reply" => "返信",
        "Forward" => "転送",
        "Mark as read" => "既読にする",
        "Mark as unread" => "未読にする",
        "Star" => "スター",
        "Unstar" => "スター解除",
        "Pin" => "ピン留め",
        "Unpin" => "ピン留め解除",
        "Lock" => "ロック",
        "Unlock" => "ロック解除",
        "Mute" => "ミュート",
        "Unmute" => "ミュート解除",
        "Block" => "ブロック",
        "Unblock" => "ブロック解除",
        "Follow" => "フォロー",
        "Unfollow" => "フォロー解除",
        "Like" => "いいね",
        "Unlike" => "いいね解除",
        "Share" => "共有",
        "Invite" => "招待",
        "Join" => "参加",
        "Leave" => "退出",
        "Accept" => "承諾",
        "Decline" => "辞退",
        "Ignore" => "無視",
        "Report" => "報告",
        "Flag" => "フラグ",
        "Rate" => "評価",
        "Review" => "レビュー",
        "Reviews" => "レビュー",
        "Feedback" => "フィードバック",
        "Survey" => "アンケート",
        "Surveys" => "アンケート",
        "Question" => "質問",
        "Questions" => "質問",
        "Answer" => "回答",
        "Answers" => "回答",
        "Response" => "レスポンス",
        "Responses" => "レスポンス",
        "Result" => "結果",
        "Results" => "結果",
        "Score" => "スコア",
        "Points" => "ポイント",
        "Badge" => "バッジ",
        "Badges" => "バッジ",
        "Level" => "レベル",
        "Rank" => "ランク",
        "Progress" => "進捗",
        "Complete" => "完了",
        "Completed" => "完了",
        "Incomplete" => "未完了",
        "In Progress" => "進行中",
        "Not Started" => "未着手",
        "On Hold" => "保留",
        "Cancelled" => "キャンセル",
        "Closed" => "クローズ",
        "Open" => "オープン",
        "Resolved" => "解決済み",
        "Unresolved" => "未解決",
        "Priority" => "優先度",
        "High" => "高",
        "Medium" => "中",
        "Low" => "低",
        "Urgent" => "緊急",
        "Normal" => "通常",
        "Critical" => "重大",
        "Severity" => "重要度",
        "Impact" => "影響",
        "Risk" => "リスク",
        "Issue" => "問題",
        "Issues" => "問題",
        "Bug" => "バグ",
        "Bugs" => "バグ",
        "Feature" => "機能",
        "Features" => "機能",
        "Enhancement" => "改善",
        "Improvement" => "改善",
        "Optimization" => "最適化",
        "Performance" => "パフォーマンス",
        "Maintenance" => "メンテナンス",
        "Update" => "更新",
        "Updates" => "更新",
        "Upgrade" => "アップグレード",
        "Downgrade" => "ダウングレード",
        "Install" => "インストール",
        "Uninstall" => "アンインストール",
        "Enable" => "有効化",
        "Disable" => "無効化",
        "Activate" => "アクティベート",
        "Deactivate" => "非アクティブ化",
        "Connect" => "接続",
        "Disconnect" => "切断",
        "Sync" => "同期",
        "Unsync" => "同期解除",
        "Link" => "リンク",
        "Unlink" => "リンク解除",
        "Attach" => "添付",
        "Detach" => "削除",
        "Assign" => "割り当て",
        "Unassign" => "割り当て解除",
        "Move" => "移動",
        "Reorder" => "並べ替え",
        "Sort" => "ソート",
        "Sorted" => "ソート済み",
        "Ascending" => "昇順",
        "Descending" => "降順",
        "Alphabetical" => "アルファベット順",
        "Numerical" => "数値順",
        "Chronological" => "時系列順",
        "Newest" => "最新",
        "Oldest" => "最古",
        "Recent" => "最近",
        "Popular" => "人気",
        "Trending" => "トレンド",
        "Featured" => "注目",
        "Recommended" => "おすすめ",
        "Suggested" => "提案",
        "Related" => "関連",
        "Similar" => "類似",
        "Random" => "ランダム",
        "Custom" => "カスタム",
        "Default" => "デフォルト",
        "Standard" => "標準",
        "Premium" => "プレミアム",
        "Pro" => "プロ",
        "Enterprise" => "エンタープライズ",
        "Free" => "無料",
        "Paid" => "有料",
        "Trial" => "トライアル",
        "Demo" => "デモ",
        "Test" => "テスト",
        "Production" => "本番",
        "Development" => "開発",
        "Staging" => "ステージング",
        "Live" => "ライブ",
        "Draft" => "下書き",
        "Published" => "公開済み",
        "Scheduled" => "スケジュール済み",
        "Expired" => "期限切れ",
        "Valid" => "有効",
        "Invalid" => "無効",
        "True" => "真",
        "False" => "偽",
        "On" => "オン",
        "Off" => "オフ",
        "Online" => "オンライン",
        "Offline" => "オフライン",
        "Available" => "利用可能",
        "Unavailable" => "利用不可",
        "Busy" => "取り込み中",
        "Away" => "離席中",
        "Do Not Disturb" => "応答不可",
        "Visible" => "表示",
        "Hidden" => "非表示",
        "Public" => "公開",
        "Private" => "非公開",
        "Shared" => "共有",
        "Personal" => "個人",
        "Team" => "チーム",
        "Organization" => "組織",
        "Global" => "グローバル",
        "Local" => "ローカル",
        "Internal" => "内部",
        "External" => "外部",
        "Domestic" => "国内",
        "International" => "国際",
        "Primary" => "メイン",
        "Secondary" => "サブ",
        "Tertiary" => "第三",
        "Main" => "メイン",
        "Sub" => "サブ",
        "Parent" => "親",
        "Child" => "子",
        "Root" => "ルート",
        "Branch" => "ブランチ",
        "Leaf" => "リーフ",
        "Node" => "ノード",
        "Tree" => "ツリー",
        "Graph" => "グラフ",
        "Network" => "ネットワーク",
        "Cluster" => "クラスター",
        "Region" => "地域",
        "Zone" => "ゾーン",
        "Area" => "エリア",
        "Sector" => "セクター",
        "Division" => "部門",
        "Unit" => "ユニット",
        "Team" => "チーム",
        "Crew" => "クルー",
        "Staff" => "スタッフ",
        "Member" => "メンバー",
        "Members" => "メンバー",
        "Leader" => "リーダー",
        "Owner" => "オーナー",
        "Creator" => "作成者",
        "Author" => "著者",
        "Editor" => "編集者",
        "Viewer" => "閲覧者",
        "Guest" => "ゲスト",
        "Visitor" => "ビジター",
        "Subscriber" => "購読者",
        "Contributor" => "投稿者",
        "Moderator" => "モデレーター",
        "Administrator" => "管理者",
        "Super Admin" => "スーパー管理者",
        "Read" => "読み取り",
        "Write" => "書き込み",
        "Execute" => "実行",
        "Full Control" => "フルコントロール",
        "No Access" => "アクセス権なし",
        "Limited" => "制限付き",
        "Unlimited" => "無制限",
        "Restricted" => "制限済み",
        "Unrestricted" => "制限なし",
        "Allowed" => "許可",
        "Denied" => "拒否",
        "Granted" => "付与",
        "Revoked" => "取り消し",
        "Inherited" => "継承",
        "Overridden" => "オーバーライド",
        "Merged" => "マージ",
        "Split" => "分割",
        "Combined" => "結合",
        "Separated" => "分離",
        "Grouped" => "グループ化",
        "Ungrouped" => "グループ解除",
        "Filtered" => "フィルター済み",
        "Unfiltered" => "フィルターなし",
        "Sorted" => "ソート済み",
        "Unsorted" => "未ソート",
        "Formatted" => "フォーマット済み",
        "Unformatted" => "未フォーマット",
        "Processed" => "処理済み",
        "Unprocessed" => "未処理",
        "Verified" => "確認済み",
        "Unverified" => "未確認",
        "Confirmed" => "確認済み",
        "Unconfirmed" => "未確認",
        "Validated" => "検証済み",
        "Invalidated" => "無効化済み",
        "Certified" => "認定済み",
        "Uncertified" => "未認定",
        "Licensed" => "ライセンス済み",
        "Unlicensed" => "未ライセンス",
        "Authorized" => "承認済み",
        "Unauthorized" => "未承認",
        "Authenticated" => "認証済み",
        "Unauthenticated" => "未認証",
        "Logged In" => "ログイン中",
        "Logged Out" => "ログアウト",
        "Signed In" => "サインイン中",
        "Signed Out" => "サインアウト",
        "Registered" => "登録済み",
        "Unregistered" => "未登録",
        "Subscribed" => "購読中",
        "Unsubscribed" => "購読解除",
        "Followed" => "フォロー中",
        "Unfollowed" => "フォロー解除",
        "Liked" => "いいね済み",
        "Unliked" => "いいね解除",
        "Bookmarked" => "ブックマーク済み",
        "Unbookmarked" => "ブックマーク解除",
        "Favorited" => "お気に入り登録",
        "Unfavorited" => "お気に入り解除",
        "Starred" => "スター付き",
        "Unstarred" => "スター解除",
        "Pinned" => "ピン留め済み",
        "Unpinned" => "ピン留め解除",
        "Locked" => "ロック済み",
        "Unlocked" => "ロック解除",
        "Encrypted" => "暗号化済み",
        "Decrypted" => "復号化済み",
        "Compressed" => "圧縮済み",
        "Decompressed" => "解凍済み",
        "Uploaded" => "アップロード済み",
        "Downloaded" => "ダウンロード済み",
        "Sent" => "送信済み",
        "Received" => "受信済み",
        "Delivered" => "配信済み",
        "Failed" => "失敗",
        "Retrying" => "再試行中",
        "Queued" => "キュー待ち",
        "Processing" => "処理中",
        "Waiting" => "待機中",
        "Running" => "実行中",
        "Paused" => "一時停止",
        "Stopped" => "停止",
        "Resumed" => "再開",
        "Started" => "開始",
        "Finished" => "終了",
        "Done" => "完了",
        "Ready" => "準備完了",
        "Not Ready" => "未準備",
        "Loading" => "読み込み中",
        "Saving" => "保存中",
        "Deleting" => "削除中",
        "Updating" => "更新中",
        "Creating" => "作成中",
        "Generating" => "生成中",
        "Calculating" => "計算中",
        "Searching" => "検索中",
        "Filtering" => "フィルタリング中",
        "Sorting" => "ソート中",
        "Syncing" => "同期中",
        "Connecting" => "接続中",
        "Disconnecting" => "切断中",
        "Authenticating" => "認証中",
        "Authorizing" => "承認中",
        "Validating" => "検証中",
        "Verifying" => "確認中",
        "Checking" => "チェック中",
        "Testing" => "テスト中",
        "Deploying" => "デプロイ中",
        "Installing" => "インストール中",
        "Uninstalling" => "アンインストール中",
        "Configuring" => "設定中",
        "Initializing" => "初期化中",
        "Finalizing" => "最終処理中",
        "Preparing" => "準備中",
        "Cleaning" => "クリーニング中",
        "Optimizing" => "最適化中",
        "Analyzing" => "分析中",
        "Reviewing" => "レビュー中",
        "Approving" => "承認中",
        "Rejecting" => "却下中",
        "Cancelling" => "キャンセル中",
        "Archiving" => "アーカイブ中",
        "Restoring" => "復元中",
        "Backing up" => "バックアップ中",
        "Migrating" => "移行中",
        "Importing" => "インポート中",
        "Exporting" => "エクスポート中",
        "Printing" => "印刷中",
        "Downloading" => "ダウンロード中",
        "Uploading" => "アップロード中",
    ],
    'ko' => [
        "Dashboard" => "대시보드",
        "Settings" => "설정",
        "Save" => "저장",
        "Save Settings" => "설정 저장",
        "Cancel" => "취소",
        "Delete" => "삭제",
        "Edit" => "편집",
        "Create" => "생성",
        "Update" => "업데이트",
        "View" => "보기",
        "Search" => "검색",
        "Filter" => "필터",
        "Export" => "내보내기",
        "Import" => "가져오기",
        "Download" => "다운로드",
        "Upload" => "업로드",
        "Submit" => "제출",
        "Confirm" => "확인",
        "Yes" => "예",
        "No" => "아니오",
        "OK" => "확인",
        "Close" => "닫기",
        "Back" => "뒤로",
        "Next" => "다음",
        "Previous" => "이전",
        "First" => "첫 번째",
        "Last" => "마지막",
        "Add" => "추가",
        "Remove" => "제거",
        "Select" => "선택",
        "All" => "전체",
        "None" => "없음",
        "Name" => "이름",
        "Title" => "제목",
        "Description" => "설명",
        "Status" => "상태",
        "Date" => "날짜",
        "Time" => "시간",
        "Actions" => "작업",
        "Details" => "세부정보",
        "Information" => "정보",
        "Notes" => "메모",
        "Comments" => "댓글",
        "Active" => "활성",
        "Inactive" => "비활성",
        "Enabled" => "사용",
        "Disabled" => "사용 안 함",
        "Pending" => "대기 중",
        "Approved" => "승인됨",
        "Rejected" => "거부됨",
        "Employee" => "직원",
        "Employees" => "직원들",
        "Department" => "부서",
        "Departments" => "부서들",
        "Company" => "회사",
        "Branch" => "지점",
        "Manager" => "관리자",
        "Admin" => "관리자",
        "User" => "사용자",
        "Users" => "사용자들",
        "Role" => "역할",
        "Roles" => "역할들",
        "Permission" => "권한",
        "Permissions" => "권한들",
        "Email" => "이메일",
        "Phone" => "전화",
        "Address" => "주소",
        "Country" => "국가",
        "City" => "도시",
        "Code" => "코드",
        "Amount" => "금액",
        "Total" => "총계",
        "Price" => "가격",
        "Quantity" => "수량",
        "Report" => "보고서",
        "Reports" => "보고서들",
        "Calendar" => "캘린더",
        "List" => "목록",
        "Table" => "테이블",
        "Chart" => "차트",
        "Overview" => "개요",
        "Summary" => "요약",
        "Configuration" => "구성",
        "General" => "일반",
        "Advanced" => "고급",
        "Basic" => "기본",
        "Required" => "필수",
        "Optional" => "선택",
        "Loading..." => "로딩 중...",
        "Please wait..." => "잠시만 기다려 주세요...",
        "Success" => "성공",
        "Error" => "오류",
        "Warning" => "경고",
        "Info" => "정보",
        "Help" => "도움말",
        "Support" => "지원",
        "Contact" => "연락처",
        "Home" => "홈",
        "Profile" => "프로필",
        "Account" => "계정",
        "Logout" => "로그아웃",
        "Login" => "로그인",
        "Password" => "비밀번호",
        "Username" => "사용자 이름",
    ],
    'ru' => [
        "Dashboard" => "Панель управления",
        "Settings" => "Настройки",
        "Save" => "Сохранить",
        "Save Settings" => "Сохранить настройки",
        "Cancel" => "Отмена",
        "Delete" => "Удалить",
        "Edit" => "Редактировать",
        "Create" => "Создать",
        "Update" => "Обновить",
        "View" => "Просмотр",
        "Search" => "Поиск",
        "Filter" => "Фильтр",
        "Export" => "Экспорт",
        "Import" => "Импорт",
        "Download" => "Скачать",
        "Upload" => "Загрузить",
        "Submit" => "Отправить",
        "Confirm" => "Подтвердить",
        "Yes" => "Да",
        "No" => "Нет",
        "OK" => "ОК",
        "Close" => "Закрыть",
        "Back" => "Назад",
        "Next" => "Далее",
        "Previous" => "Назад",
        "First" => "Первый",
        "Last" => "Последний",
        "Add" => "Добавить",
        "Remove" => "Удалить",
        "Select" => "Выбрать",
        "All" => "Все",
        "None" => "Нет",
        "Name" => "Имя",
        "Title" => "Название",
        "Description" => "Описание",
        "Status" => "Статус",
        "Date" => "Дата",
        "Time" => "Время",
        "Actions" => "Действия",
        "Details" => "Детали",
        "Information" => "Информация",
        "Notes" => "Заметки",
        "Comments" => "Комментарии",
        "Active" => "Активный",
        "Inactive" => "Неактивный",
        "Enabled" => "Включено",
        "Disabled" => "Отключено",
        "Pending" => "Ожидание",
        "Approved" => "Одобрено",
        "Rejected" => "Отклонено",
        "Employee" => "Сотрудник",
        "Employees" => "Сотрудники",
        "Department" => "Отдел",
        "Departments" => "Отделы",
        "Company" => "Компания",
        "Branch" => "Филиал",
        "Manager" => "Менеджер",
        "Admin" => "Администратор",
        "User" => "Пользователь",
        "Users" => "Пользователи",
        "Role" => "Роль",
        "Roles" => "Роли",
        "Permission" => "Разрешение",
        "Permissions" => "Разрешения",
        "Email" => "Email",
        "Phone" => "Телефон",
        "Address" => "Адрес",
        "Country" => "Страна",
        "City" => "Город",
        "Code" => "Код",
        "Amount" => "Сумма",
        "Total" => "Итого",
        "Price" => "Цена",
        "Quantity" => "Количество",
        "Report" => "Отчет",
        "Reports" => "Отчеты",
        "Calendar" => "Календарь",
        "List" => "Список",
        "Table" => "Таблица",
        "Chart" => "Диаграмма",
        "Overview" => "Обзор",
        "Summary" => "Сводка",
        "Configuration" => "Конфигурация",
        "General" => "Общие",
        "Advanced" => "Расширенные",
        "Basic" => "Базовый",
        "Required" => "Обязательно",
        "Optional" => "Необязательно",
        "Loading..." => "Загрузка...",
        "Please wait..." => "Пожалуйста, подождите...",
        "Success" => "Успех",
        "Error" => "Ошибка",
        "Warning" => "Предупреждение",
        "Info" => "Информация",
        "Help" => "Помощь",
        "Support" => "Поддержка",
        "Contact" => "Контакт",
        "Home" => "Главная",
        "Profile" => "Профиль",
        "Account" => "Аккаунт",
        "Logout" => "Выйти",
        "Login" => "Войти",
        "Password" => "Пароль",
        "Username" => "Имя пользователя",
    ],
    'hi' => [
        "Dashboard" => "डैशबोर्ड",
        "Settings" => "सेटिंग्स",
        "Save" => "सहेजें",
        "Save Settings" => "सेटिंग्स सहेजें",
        "Cancel" => "रद्द करें",
        "Delete" => "हटाएं",
        "Edit" => "संपादित करें",
        "Create" => "बनाएं",
        "Update" => "अपडेट करें",
        "View" => "देखें",
        "Search" => "खोजें",
        "Filter" => "फ़िल्टर",
        "Export" => "निर्यात",
        "Import" => "आयात",
        "Download" => "डाउनलोड",
        "Upload" => "अपलोड",
        "Submit" => "सबमिट करें",
        "Confirm" => "पुष्टि करें",
        "Yes" => "हाँ",
        "No" => "नहीं",
        "OK" => "ठीक है",
        "Close" => "बंद करें",
        "Back" => "वापस",
        "Next" => "अगला",
        "Previous" => "पिछला",
        "First" => "पहला",
        "Last" => "आखिरी",
        "Add" => "जोड़ें",
        "Remove" => "हटाएं",
        "Select" => "चुनें",
        "All" => "सभी",
        "None" => "कोई नहीं",
        "Name" => "नाम",
        "Title" => "शीर्षक",
        "Description" => "विवरण",
        "Status" => "स्थिति",
        "Date" => "दिनांक",
        "Time" => "समय",
        "Actions" => "कार्रवाई",
        "Details" => "विवरण",
        "Information" => "जानकारी",
        "Notes" => "नोट्स",
        "Comments" => "टिप्पणियाँ",
        "Active" => "सक्रिय",
        "Inactive" => "निष्क्रिय",
        "Enabled" => "सक्षम",
        "Disabled" => "अक्षम",
        "Pending" => "लंबित",
        "Approved" => "स्वीकृत",
        "Rejected" => "अस्वीकृत",
        "Employee" => "कर्मचारी",
        "Employees" => "कर्मचारी",
        "Department" => "विभाग",
        "Departments" => "विभाग",
        "Company" => "कंपनी",
        "Branch" => "शाखा",
        "Manager" => "प्रबंधक",
        "Admin" => "प्रशासक",
        "User" => "उपयोगकर्ता",
        "Users" => "उपयोगकर्ता",
        "Role" => "भूमिका",
        "Roles" => "भूमिकाएं",
        "Permission" => "अनुमति",
        "Permissions" => "अनुमतियां",
        "Email" => "ईमेल",
        "Phone" => "फोन",
        "Address" => "पता",
        "Country" => "देश",
        "City" => "शहर",
        "Code" => "कोड",
        "Amount" => "राशि",
        "Total" => "कुल",
        "Price" => "मूल्य",
        "Quantity" => "मात्रा",
        "Report" => "रिपोर्ट",
        "Reports" => "रिपोर्ट",
        "Calendar" => "कैलेंडर",
        "List" => "सूची",
        "Table" => "तालिका",
        "Chart" => "चार्ट",
        "Overview" => "अवलोकन",
        "Summary" => "सारांश",
        "Configuration" => "कॉन्फ़िगरेशन",
        "General" => "सामान्य",
        "Advanced" => "उन्नत",
        "Basic" => "मूल",
        "Required" => "आवश्यक",
        "Optional" => "वैकल्पिक",
        "Loading..." => "लोड हो रहा है...",
        "Please wait..." => "कृपया प्रतीक्षा करें...",
        "Success" => "सफलता",
        "Error" => "त्रुटि",
        "Warning" => "चेतावनी",
        "Info" => "जानकारी",
        "Help" => "मदद",
        "Support" => "सहायता",
        "Contact" => "संपर्क",
        "Home" => "होम",
        "Profile" => "प्रोफाइल",
        "Account" => "खाता",
        "Logout" => "लॉगआउट",
        "Login" => "लॉगिन",
        "Password" => "पासवर्ड",
        "Username" => "उपयोगकर्ता नाम",
        "Payroll" => "वेतन",
        "Payroll Management" => "वेतन प्रबंधन",
        "Attendance" => "उपस्थिति",
        "Leave" => "छुट्टी",
        "Leaves" => "छुट्टियां",
        "Shift" => "शिफ्ट",
        "Shifts" => "शिफ्ट",
        "Holiday" => "अवकाश",
        "Holidays" => "अवकाश",
        "Salary" => "वेतन",
        "Bonus" => "बोनस",
        "Deduction" => "कटौती",
        "Deductions" => "कटौती",
        "Tax" => "कर",
        "Taxes" => "कर",
        "Allowance" => "भत्ता",
        "Allowances" => "भत्ते",
        "Benefits" => "लाभ",
        "Bank" => "बैंक",
        "Account Number" => "खाता संख्या",
        "Payment" => "भुगतान",
        "Payments" => "भुगतान",
        "Invoice" => "चालान",
        "Invoices" => "चालान",
        "Order" => "आदेश",
        "Orders" => "आदेश",
        "Product" => "उत्पाद",
        "Products" => "उत्पाद",
        "Customer" => "ग्राहक",
        "Customers" => "ग्राहक",
        "Supplier" => "आपूर्तिकर्ता",
        "Suppliers" => "आपूर्तिकर्ता",
        "Inventory" => "इन्वेंट्री",
        "Stock" => "स्टॉक",
        "Warehouse" => "गोदाम",
        "Warehouses" => "गोदाम",
        "Project" => "परियोजना",
        "Projects" => "परियोजनाएं",
        "Task" => "कार्य",
        "Tasks" => "कार्य",
        "Document" => "दस्तावेज़",
        "Documents" => "दस्तावेज़",
        "File" => "फ़ाइल",
        "Files" => "फ़ाइलें",
        "Notification" => "सूचना",
        "Notifications" => "सूचनाएं",
        "Message" => "संदेश",
        "Messages" => "संदेश",
        "Chat" => "चैट",
        "Meeting" => "बैठक",
        "Meetings" => "बैठकें",
        "Notice" => "सूचना",
        "Notices" => "सूचनाएं",
        "Policy" => "नीति",
        "Policies" => "नीतियां",
        "Request" => "अनुरोध",
        "Requests" => "अनुरोध",
        "Approval" => "अनुमोदन",
        "History" => "इतिहास",
        "Log" => "लॉग",
        "Logs" => "लॉग",
        "Activity" => "गतिविधि",
        "Audit" => "ऑडिट",
        "Backup" => "बैकअप",
        "Restore" => "पुनर्स्थापित",
        "System" => "सिस्टम",
        "Module" => "मॉड्यूल",
        "Modules" => "मॉड्यूल",
    ],
    'ta' => [
        "Dashboard" => "டாஷ்போர்டு",
        "Settings" => "அமைப்புகள்",
        "Save" => "சேமிக்கவும்",
        "Save Settings" => "அமைப்புகளைச் சேமிக்கவும்",
        "Cancel" => "ரத்துசெய்",
        "Delete" => "நீக்கு",
        "Edit" => "திருத்து",
        "Create" => "உருவாக்கு",
        "Update" => "புதுப்பிக்கவும்",
        "View" => "காண்க",
        "Search" => "தேடு",
        "Filter" => "வடிகட்டி",
        "Export" => "ஏற்றுமதி",
        "Import" => "இறக்குமதி",
        "Download" => "பதிவிறக்கம்",
        "Upload" => "பதிவேற்றம்",
        "Submit" => "சமர்ப்பிக்கவும்",
        "Confirm" => "உறுதிப்படுத்து",
        "Yes" => "ஆம்",
        "No" => "இல்லை",
        "OK" => "சரி",
        "Close" => "மூடு",
        "Back" => "பின்செல்",
        "Next" => "அடுத்து",
        "Previous" => "முந்தைய",
        "Name" => "பெயர்",
        "Title" => "தலைப்பு",
        "Description" => "விளக்கம்",
        "Status" => "நிலை",
        "Date" => "தேதி",
        "Time" => "நேரம்",
        "Actions" => "செயல்கள்",
        "Details" => "விவரங்கள்",
        "Employee" => "பணியாளர்",
        "Employees" => "பணியாளர்கள்",
        "Department" => "துறை",
        "Company" => "நிறுவனம்",
        "Manager" => "மேலாளர்",
        "User" => "பயனர்",
        "Users" => "பயனர்கள்",
        "Email" => "மின்னஞ்சல்",
        "Phone" => "தொலைபேசி",
        "Address" => "முகவரி",
        "Country" => "நாடு",
        "City" => "நகரம்",
        "Amount" => "தொகை",
        "Total" => "மொத்தம்",
        "Report" => "அறிக்கை",
        "Reports" => "அறிக்கைகள்",
        "Calendar" => "நாட்காட்டி",
        "Loading..." => "ஏற்றுகிறது...",
        "Success" => "வெற்றி",
        "Error" => "பிழை",
        "Warning" => "எச்சரிக்கை",
        "Home" => "முகப்பு",
        "Profile" => "சுயவிவரம்",
        "Login" => "உள்நுழைவு",
        "Logout" => "வெளியேறு",
        "Password" => "கடவுச்சொல்",
    ],
    'bn' => [
        "Dashboard" => "ড্যাশবোর্ড",
        "Settings" => "সেটিংস",
        "Save" => "সংরক্ষণ করুন",
        "Cancel" => "বাতিল",
        "Delete" => "মুছুন",
        "Edit" => "সম্পাদনা করুন",
        "Create" => "তৈরি করুন",
        "Update" => "আপডেট করুন",
        "View" => "দেখুন",
        "Search" => "অনুসন্ধান করুন",
        "Filter" => "ফিল্টার",
        "Export" => "রপ্তানি",
        "Import" => "আমদানি",
        "Submit" => "জমা দিন",
        "Yes" => "হ্যাঁ",
        "No" => "না",
        "OK" => "ঠিক আছে",
        "Close" => "বন্ধ করুন",
        "Name" => "নাম",
        "Title" => "শিরোনাম",
        "Description" => "বিবরণ",
        "Status" => "স্থিতি",
        "Date" => "তারিখ",
        "Time" => "সময়",
        "Employee" => "কর্মচারী",
        "Employees" => "কর্মচারীরা",
        "Department" => "বিভাগ",
        "Company" => "কোম্পানি",
        "Manager" => "ম্যানেজার",
        "User" => "ব্যবহারকারী",
        "Email" => "ইমেইল",
        "Phone" => "ফোন",
        "Address" => "ঠিকানা",
        "Amount" => "পরিমাণ",
        "Total" => "মোট",
        "Report" => "প্রতিবেদন",
        "Loading..." => "লোড হচ্ছে...",
        "Success" => "সফল",
        "Error" => "ত্রুটি",
        "Home" => "হোম",
        "Login" => "লগইন",
        "Logout" => "লগআউট",
        "Password" => "পাসওয়ার্ড",
    ],
    'te' => [
        "Dashboard" => "డాష్‌బోర్డ్",
        "Settings" => "సెట్టింగ్‌లు",
        "Save" => "సేవ్ చేయండి",
        "Cancel" => "రద్దు చేయండి",
        "Delete" => "తొలగించు",
        "Edit" => "సవరించు",
        "Create" => "సృష్టించు",
        "Update" => "అప్‌డేట్ చేయండి",
        "View" => "చూడండి",
        "Search" => "వెతకండి",
        "Filter" => "ఫిల్టర్",
        "Export" => "ఎగుమతి",
        "Import" => "దిగుమతి",
        "Submit" => "సమర్పించండి",
        "Yes" => "అవును",
        "No" => "కాదు",
        "OK" => "సరే",
        "Close" => "మూసివేయండి",
        "Name" => "పేరు",
        "Title" => "శీర్షిక",
        "Description" => "వివరణ",
        "Status" => "స్థితి",
        "Date" => "తేదీ",
        "Time" => "సమయం",
        "Employee" => "ఉద్యోగి",
        "Employees" => "ఉద్యోగులు",
        "Department" => "విభాగం",
        "Company" => "కంపెనీ",
        "Manager" => "మేనేజర్",
        "User" => "వినియోగదారు",
        "Email" => "ఇమెయిల్",
        "Phone" => "ఫోన్",
        "Address" => "చిరునామా",
        "Amount" => "మొత్తం",
        "Total" => "మొత్తం",
        "Report" => "నివేదిక",
        "Loading..." => "లోడ్ అవుతోంది...",
        "Success" => "విజయం",
        "Error" => "లోపం",
        "Home" => "హోమ్",
        "Login" => "లాగిన్",
        "Logout" => "లాగౌట్",
        "Password" => "పాస్‌వర్డ్",
    ],
    'th' => [
        "Dashboard" => "แดชบอร์ด",
        "Settings" => "การตั้งค่า",
        "Save" => "บันทึก",
        "Cancel" => "ยกเลิก",
        "Delete" => "ลบ",
        "Edit" => "แก้ไข",
        "Create" => "สร้าง",
        "Update" => "อัปเดต",
        "View" => "ดู",
        "Search" => "ค้นหา",
        "Filter" => "กรอง",
        "Export" => "ส่งออก",
        "Import" => "นำเข้า",
        "Submit" => "ส่ง",
        "Yes" => "ใช่",
        "No" => "ไม่",
        "OK" => "ตกลง",
        "Close" => "ปิด",
        "Name" => "ชื่อ",
        "Title" => "หัวข้อ",
        "Description" => "คำอธิบาย",
        "Status" => "สถานะ",
        "Date" => "วันที่",
        "Time" => "เวลา",
        "Employee" => "พนักงาน",
        "Employees" => "พนักงาน",
        "Department" => "แผนก",
        "Company" => "บริษัท",
        "Manager" => "ผู้จัดการ",
        "User" => "ผู้ใช้",
        "Email" => "อีเมล",
        "Phone" => "โทรศัพท์",
        "Address" => "ที่อยู่",
        "Amount" => "จำนวน",
        "Total" => "รวม",
        "Report" => "รายงาน",
        "Loading..." => "กำลังโหลด...",
        "Success" => "สำเร็จ",
        "Error" => "ข้อผิดพลาด",
        "Home" => "หน้าแรก",
        "Login" => "เข้าสู่ระบบ",
        "Logout" => "ออกจากระบบ",
        "Password" => "รหัสผ่าน",
    ],
    'vi' => [
        "Dashboard" => "Bảng điều khiển",
        "Settings" => "Cài đặt",
        "Save" => "Lưu",
        "Cancel" => "Hủy",
        "Delete" => "Xóa",
        "Edit" => "Chỉnh sửa",
        "Create" => "Tạo",
        "Update" => "Cập nhật",
        "View" => "Xem",
        "Search" => "Tìm kiếm",
        "Filter" => "Lọc",
        "Export" => "Xuất",
        "Import" => "Nhập",
        "Submit" => "Gửi",
        "Yes" => "Có",
        "No" => "Không",
        "OK" => "OK",
        "Close" => "Đóng",
        "Name" => "Tên",
        "Title" => "Tiêu đề",
        "Description" => "Mô tả",
        "Status" => "Trạng thái",
        "Date" => "Ngày",
        "Time" => "Thời gian",
        "Employee" => "Nhân viên",
        "Employees" => "Nhân viên",
        "Department" => "Phòng ban",
        "Company" => "Công ty",
        "Manager" => "Quản lý",
        "User" => "Người dùng",
        "Email" => "Email",
        "Phone" => "Điện thoại",
        "Address" => "Địa chỉ",
        "Amount" => "Số lượng",
        "Total" => "Tổng",
        "Report" => "Báo cáo",
        "Loading..." => "Đang tải...",
        "Success" => "Thành công",
        "Error" => "Lỗi",
        "Home" => "Trang chủ",
        "Login" => "Đăng nhập",
        "Logout" => "Đăng xuất",
        "Password" => "Mật khẩu",
    ],
    'id' => [
        "Dashboard" => "Dasbor",
        "Settings" => "Pengaturan",
        "Save" => "Simpan",
        "Cancel" => "Batal",
        "Delete" => "Hapus",
        "Edit" => "Edit",
        "Create" => "Buat",
        "Update" => "Perbarui",
        "View" => "Lihat",
        "Search" => "Cari",
        "Filter" => "Filter",
        "Export" => "Ekspor",
        "Import" => "Impor",
        "Submit" => "Kirim",
        "Yes" => "Ya",
        "No" => "Tidak",
        "OK" => "OK",
        "Close" => "Tutup",
        "Name" => "Nama",
        "Title" => "Judul",
        "Description" => "Deskripsi",
        "Status" => "Status",
        "Date" => "Tanggal",
        "Time" => "Waktu",
        "Employee" => "Karyawan",
        "Employees" => "Karyawan",
        "Department" => "Departemen",
        "Company" => "Perusahaan",
        "Manager" => "Manajer",
        "User" => "Pengguna",
        "Email" => "Email",
        "Phone" => "Telepon",
        "Address" => "Alamat",
        "Amount" => "Jumlah",
        "Total" => "Total",
        "Report" => "Laporan",
        "Loading..." => "Memuat...",
        "Success" => "Berhasil",
        "Error" => "Error",
        "Home" => "Beranda",
        "Login" => "Masuk",
        "Logout" => "Keluar",
        "Password" => "Kata sandi",
    ],
];

// Find all modules
$modulesDir = __DIR__ . '/../Modules';
$modules = [];

foreach (scandir($modulesDir) as $dir) {
    if ($dir === '.' || $dir === '..') continue;
    $langDir = "$modulesDir/$dir/resources/lang";
    if (is_dir($langDir)) {
        $modules[$dir] = $langDir;
    }
}

echo "Found " . count($modules) . " modules with lang directories\n\n";

// Process each module
foreach ($modules as $moduleName => $langDir) {
    $enFile = "$langDir/en.json";
    if (!file_exists($enFile)) {
        echo "SKIP: $moduleName - no en.json\n";
        continue;
    }

    $englishContent = json_decode(file_get_contents($enFile), true);
    if (!$englishContent) {
        echo "ERROR: $moduleName - invalid en.json\n";
        continue;
    }

    $keyCount = count($englishContent);
    echo "Processing $moduleName ($keyCount keys)...\n";

    // Process each target language
    foreach ($translations as $lang => $dict) {
        $targetFile = "$langDir/$lang.json";

        // Read existing translations if any
        $existing = [];
        if (file_exists($targetFile)) {
            $existing = json_decode(file_get_contents($targetFile), true) ?? [];
        }

        // Apply translations
        $output = [];
        $translated = 0;

        foreach ($englishContent as $key => $value) {
            // Check if already translated (value differs from key)
            if (isset($existing[$key]) && $existing[$key] !== $key && $existing[$key] !== $value) {
                $output[$key] = $existing[$key];
                $translated++;
            }
            // Check dictionary for exact match
            elseif (isset($dict[$key])) {
                $output[$key] = $dict[$key];
                $translated++;
            }
            // Check dictionary for value match
            elseif (isset($dict[$value])) {
                $output[$key] = $dict[$value];
                $translated++;
            }
            else {
                // Keep original
                $output[$key] = $value;
            }
        }

        // Write output
        $json = json_encode($output, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
        file_put_contents($targetFile, $json . "\n");
    }
}

echo "\nDone!\n";
