
TRANSLATIONS = {
    "main": {
        "en": {
            "title": "GSEA GUI Toolkit",
            "description": "Please select a tool:",
            "enrichment_btn": "GSEA Analysis",
            "vis_btn": "GSEA Visualization",
            "gmt_btn": "GMT Generator",
            "github_btn": "Project Homepage",
            "version": "Version {version}",
            "window_title": "GSEA GUI Toolkit"
        },
        "zh": {
            "title": "GSEA GUI工具集",
            "description": "请选择要使用的工具：",
            "enrichment_btn": "基因集富集分析",
            "vis_btn": "GSEA结果可视化",
            "gmt_btn": "GMT文件生成器",
            "github_btn": "项目主页",
            "version": "版本 {version}",
            "window_title": "GSEA GUI工具集"
        }
    },
    "ploter": {
        "en": {
            "window_title": "GSEA Result Ploter",
            "file_load_group": "File Loading",
            "load_file_btn": "Load File (TSV/PKL)",
            "no_file": "No file loaded",
            "plot_type_group": "Plot Type",
            "basic_param_group": "Basic Parameters",
            "column": "Column:",
            "x_group": "X/Group:",
            "x_value_filter_btn": "Filter...",
            "x_value_filter_dialog_title": "Filter values for: {}",
            "x_value_filter_search": "Search...",
            "x_value_filter_status_all": "Selected all ({} values)",
            "x_value_filter_status_some": "Selected {}/{} values",
            "x_value_filter_status_empty": "No values",
            "select_all": "Select All",
            "deselect_all": "Deselect All",
            "invert_selection": "Invert",
            "hue": "Hue:",
            "threshold": "Threshold:",
            "top_term": "Top Term:",
            "img_size": "Image Size:",
            "title": "Title:",
            "x_axis_fontsize": "X Axis Font Size:",
            "y_axis_fontsize": "Y Axis Font Size:",
            "mpl_style": "Matplotlib Style:",
            "dot_param_group": "Dot Plot Parameters",
            "dot_scale": "Dot Scale:",
            "marker_shape": "Marker Shape:",
            "colormap": "Colormap:",
            "show_ring": "Show Ring",
            "label_rot": "Label Rotation:",
            "legend_fontsize": "Legend Font Size:",
            "bar_param_group": "Bar Plot Parameters",
            "add_color": "Add Color",
            "remove_color": "Remove Color",
            "legend_pos": "Legend Position:",
            "plot_btn": "Plot Chart",
            "term_select_group": "Term Selection",
            "show_ranking": "Show Ranking",
            "gsea_param_group": "Plot Parameters",
            "label_fontsize": "Label Font Size:",
            "legend_outside": "Legend Outside:",
            "plot_gsea_btn": "Plot GSEA Chart",
            "tab_tsv": "TSV Plot",
            "tab_gsea": "GSEA Plot",
            "msg_unsupported_type": "Unsupported file type",
            "msg_select_tsv_pkl": "Please select TSV or PKL file",
            "msg_load_success": "Loaded successfully",
            "msg_load_fail": "Load failed",
            "msg_tsv_loaded": "Successfully loaded TSV file with {} rows",
            "msg_pkl_loaded": "Successfully loaded GSEA result with {} Terms",
            "msg_error": "Error",
            "msg_load_tsv_first": "Please load TSV file first",
            "msg_plot_error": "Plotting Error",
            "msg_load_pkl_first": "Please load GSEA result file (PKL) first",
            "msg_select_term": "Please select at least one Term",
            "msg_all_colors_added": "Colors added for all values",
            "msg_no_x_values_selected": "No X/Group values selected. Please select at least one.",
            "msg_style_apply_fail": "Failed to apply matplotlib style: {}",
            "context_select_all": "Select All",
            "context_deselect_all": "Deselect All",
            "context_invert_selection": "Invert Selection"
        },
        "zh": {
            "window_title": "GSEA Result Ploter",
            "file_load_group": "文件加载",
            "load_file_btn": "加载文件 (TSV/PKL)",
            "no_file": "未加载文件",
            "plot_type_group": "绘图类型",
            "basic_param_group": "基本参数",
            "column": "Column:",
            "x_group": "X/Group:",
            "x_value_filter_btn": "筛选...",
            "x_value_filter_dialog_title": "筛选列取值：{}",
            "x_value_filter_search": "搜索...",
            "x_value_filter_status_all": "已全选（{}个）",
            "x_value_filter_status_some": "已选择 {}/{} 个",
            "x_value_filter_status_empty": "无可用取值",
            "select_all": "全选",
            "deselect_all": "全不选",
            "invert_selection": "反选",
            "hue": "Hue:",
            "threshold": "阈值:",
            "top_term": "Top Term:",
            "img_size": "图像尺寸:",
            "title": "标题:",
            "x_axis_fontsize": "X轴标签字体大小:",
            "y_axis_fontsize": "Y轴标签字体大小:",
            "mpl_style": "Matplotlib主题:",
            "dot_param_group": "Dot Plot参数",
            "dot_scale": "点大小缩放:",
            "marker_shape": "标记形状:",
            "colormap": "颜色映射:",
            "show_ring": "显示外环",
            "label_rot": "标签旋转:",
            "legend_fontsize": "图例字体大小:",
            "bar_param_group": "Bar Plot参数",
            "add_color": "添加颜色",
            "remove_color": "移除颜色",
            "legend_pos": "图例位置:",
            "plot_btn": "绘制图形",
            "term_select_group": "Term选择",
            "show_ranking": "显示排名",
            "gsea_param_group": "绘图参数",
            "label_fontsize": "标签字体大小:",
            "legend_outside": "图例在图外:",
            "plot_gsea_btn": "绘制GSEA图形",
            "tab_tsv": "TSV绘图",
            "tab_gsea": "GSEA绘图",
            "msg_unsupported_type": "不支持的文件类型",
            "msg_select_tsv_pkl": "请选择TSV或PKL文件",
            "msg_load_success": "加载成功",
            "msg_load_fail": "加载失败",
            "msg_tsv_loaded": "成功加载TSV文件，包含{}行数据",
            "msg_pkl_loaded": "成功加载GSEA结果，包含{}个Term",
            "msg_error": "错误",
            "msg_load_tsv_first": "请先加载TSV文件",
            "msg_plot_error": "绘图错误",
            "msg_load_pkl_first": "请先加载GSEA结果文件（PKL）",
            "msg_select_term": "请至少选择一个Term",
            "msg_all_colors_added": "已为所有值添加了颜色",
            "msg_no_x_values_selected": "未选择任何X/Group取值，请至少选择一个。",
            "msg_style_apply_fail": "应用Matplotlib主题失败: {}",
            "context_select_all": "全选",
            "context_deselect_all": "全不选",
            "context_invert_selection": "反选"
        }
    },
    "gmt": {
        "en": {
            "window_title": "GMT File Generator",
            "input_group": "Input Settings",
            "select_anno_btn": "Select Annotation File",
            "no_file": "No file selected",
            "id_col": "ID Column:",
            "anno_col": "Annotation Column:",
            "process_group": "Annotation Processing Settings",
            "enable_split": "Enable Annotation Split",
            "separator": "Separator:",
            "min_genes": "Min Genes:",
            "invalid_values": "Invalid Values (comma separated):",
            "output_group": "Output Settings",
            "output_dir": "Output Directory:",
            "select_btn": "Select...",
            "log_group": "Processing Log",
            "generate_btn": "Generate GMT File",
            "status_ready": "Ready",
            "msg_loading": "Loading annotation file: {}...",
            "msg_load_success": "Successfully loaded annotation file:",
            "msg_load_fail": "Failed to load file: {}",
            "msg_select_anno_first": "Please load annotation file first",
            "msg_start_gen": "\nStarting GMT file generation...",
            "msg_settings": "Using settings:",
            "msg_create_dir": "Creating output directory: {}",
            "msg_progress": "Processing progress: {}/{}",
            "msg_complete": "\nProcessing complete!",
            "msg_stats": "Statistics:",
            "msg_gene_counts": "\nPathway gene count statistics:",
            "msg_gen_complete": "GMT file generation complete!",
            "msg_gen_error": "Error during generation: {}",
            "warning": "Warning",
            "error": "Error",
            "complete": "Complete"
        },
        "zh": {
            "window_title": "GMT File Generator",
            "input_group": "输入设置",
            "select_anno_btn": "选择注释文件",
            "no_file": "未选择文件",
            "id_col": "ID列:",
            "anno_col": "注释列:",
            "process_group": "注释处理设置",
            "enable_split": "启用注释分割",
            "separator": "分隔符:",
            "min_genes": "最小基因数:",
            "invalid_values": "无效值 (用逗号分隔):",
            "output_group": "输出设置",
            "output_dir": "输出目录:",
            "select_btn": "选择...",
            "log_group": "处理日志",
            "generate_btn": "生成GMT文件",
            "status_ready": "就绪",
            "msg_loading": "正在加载注释文件: {}...",
            "msg_load_success": "成功加载注释文件:",
            "msg_load_fail": "无法加载文件: {}",
            "msg_select_anno_first": "请先加载注释文件",
            "msg_start_gen": "\n开始生成GMT文件...",
            "msg_settings": "使用设置:",
            "msg_create_dir": "创建输出目录: {}",
            "msg_progress": "处理进度: {}/{}",
            "msg_complete": "\n处理完成!",
            "msg_stats": "统计信息:",
            "msg_gene_counts": "\n通路基因数量统计:",
            "msg_gen_complete": "GMT文件生成完成！",
            "msg_gen_error": "生成过程中出错: {}",
            "warning": "警告",
            "error": "错误",
            "complete": "完成"
        }
    },
    "runner": {
        "en": {
            "window_title": "Gene Set Enrichment Analyzer",
            "tab_anno_process": "Annotation Processing",
            "tab_enrichment": "Enrichment Analysis",
            "anno_file_group": "Annotation File Settings",
            "tab_anno_file": "Annotation File",
            "tab_gmt_file": "GMT File",
            "select_anno_btn": "Select Annotation File",
            "no_file": "No file selected",
            "gene_col": "Gene/Protein Column:",
            "anno_col": "Annotation Column:",
            "enable_split": "Enable Annotation Split",
            "separator": "Separator:",
            "exclude_values": "Exclude Values (comma separated):",
            "create_gmt_btn": "Create Gene Sets",
            "select_gmt_btn": "Select GMT File",
            "input_group": "Gene List Input",
            "radio_file": "Input from File",
            "radio_text": "Direct Input",
            "select_gene_file_btn": "Select Gene List File",
            "gene_col_file": "Gene Column:",
            "rank_col": "Rank Column:",
            "group_col_1": "Group Column 1:",
            "group_col_2": "Group Column 2:",
            "group_col_3": "Group Column 3:",
            "input_placeholder": "Enter gene list (Optional: \"GeneID\\tRank\" per line):",
            "method_group": "Analysis Method",
            "radio_hyper": "Hypergeometric",
            "radio_gsea": "GSEA",
            "min_size": "Min Gene Set Size:",
            "max_size": "Max Gene Set Size:",
            "output_group": "Output Settings",
            "output_dir": "Output Directory:",
            "select_btn": "Select...",
            "output_prefix": "Output Filename Prefix:",
            "save_pickle": "Save GSEA result as pickle file",
            "run_btn": "Run Enrichment Analysis",
            "results_group": "Analysis Results",
            "progress_group": "Processing Progress",
            "status_ready": "Ready",
            "msg_anno_loaded": "Annotation file loaded successfully",
            "msg_load_fail": "Failed to load file: {}",
            "msg_gene_loaded": "Gene list file loaded successfully",
            "msg_select_anno_first": "Please load annotation file first",
            "msg_gmt_created": "Gene sets created successfully",
            "msg_gmt_fail": "Failed to create gene sets",
            "msg_gmt_error": "Error creating gene sets: {}",
            "msg_gmt_loaded": "GMT file loaded successfully",
            "msg_create_gmt_first": "Please create gene sets first",
            "msg_create_out_dir": "Creating output directory: {}",
            "msg_select_gene_file": "Please select gene list file",
            "msg_reading_file": "Reading file: {}",
            "msg_gsea_needs_rank": "GSEA method requires rank column",
            "msg_duplicate_genes": "Duplicate genes found in list, continue?",
            "msg_hyper_analysis": "Using Hypergeometric distribution for enrichment analysis...",
            "msg_gsea_analysis": "Using GSEA for enrichment analysis...",
            "msg_analyzing_group": "Analyzing group: {}",
            "msg_enter_genes": "Please enter gene list",
            "msg_parsing_input": "Parsing input gene list",
            "msg_analysis_complete": "Analysis complete, results saved to: {}",
            "msg_analysis_fail": "Analysis failed",
            "msg_analysis_error": "Error during analysis:\n{}\n\nFull traceback:\n{}",
            "warning": "Warning",
            "error": "Error",
            "success": "Success",
            "progress_title": "Progress",
            "progress_msg": "Running enrichment analysis..."
        },
        "zh": {
            "window_title": "Gene Set Enrichment Analyzer",
            "tab_anno_process": "注释处理",
            "tab_enrichment": "富集分析",
            "anno_file_group": "注释文件设置",
            "tab_anno_file": "注释文件",
            "tab_gmt_file": "GMT文件",
            "select_anno_btn": "选择注释文件",
            "no_file": "未选择文件",
            "gene_col": "基因/蛋白列:",
            "anno_col": "注释列:",
            "enable_split": "启用注释分割",
            "separator": "分隔符:",
            "exclude_values": "排除值 (用逗号分隔):",
            "create_gmt_btn": "创建基因集",
            "select_gmt_btn": "选择GMT文件",
            "input_group": "基因列表输入",
            "radio_file": "从文件输入",
            "radio_text": "直接输入",
            "select_gene_file_btn": "选择基因列表文件",
            "gene_col_file": "基因列:",
            "rank_col": "排序值列:",
            "group_col_1": "分组列_1:",
            "group_col_2": "分组列_2:",
            "group_col_3": "分组列_3:",
            "input_placeholder": "输入基因列表 (可选：每行\"基因ID\\t排序值\")：",
            "method_group": "分析方法",
            "radio_hyper": "超几何分布",
            "radio_gsea": "GSEA",
            "min_size": "最小基因集大小:",
            "max_size": "最大基因集大小:",
            "output_group": "输出设置",
            "output_dir": "输出目录:",
            "select_btn": "选择...",
            "output_prefix": "输出文件名前缀:",
            "save_pickle": "保存GSEA结果为pickle文件",
            "run_btn": "运行富集分析",
            "results_group": "分析结果",
            "progress_group": "处理进度",
            "status_ready": "就绪",
            "msg_anno_loaded": "注释文件加载成功",
            "msg_load_fail": "无法加载文件: {}",
            "msg_gene_loaded": "基因列表文件加载成功",
            "msg_select_anno_first": "请先加载注释文件",
            "msg_gmt_created": "基因集创建成功",
            "msg_gmt_fail": "基因集创建失败",
            "msg_gmt_error": "创建基因集时出错: {}",
            "msg_gmt_loaded": "GMT文件加载成功",
            "msg_create_gmt_first": "请先创建基因集",
            "msg_create_out_dir": "创建输出目录: {}",
            "msg_select_gene_file": "请选择基因列表文件",
            "msg_reading_file": "正在读取文件: {}",
            "msg_gsea_needs_rank": "GSEA方法需要排序值列",
            "msg_duplicate_genes": "基因列表中存在重复基因，是否继续？",
            "msg_hyper_analysis": "使用超几何分布进行富集分析...",
            "msg_gsea_analysis": "使用GSEA进行富集分析...",
            "msg_analyzing_group": "正在分析组: {}",
            "msg_enter_genes": "请输入基因列表",
            "msg_parsing_input": "正在解析输入的基因列表",
            "msg_analysis_complete": "分析完成，结果已保存到: {}",
            "msg_analysis_fail": "分析失败",
            "msg_analysis_error": "分析过程中出错:\n{}\n\n完整错误追踪:\n{}",
            "warning": "警告",
            "error": "错误",
            "success": "成功",
            "progress_title": "进度",
            "progress_msg": "正在运行富集分析..."
        }
    }
}
