示例#1
0
def setup_localization():
    """Setup localization messages."""

    #  English translation.
    _l10n_reg.register_message_tree(
        _l10n_msgtree.EnglishMessageTree({
            "logic": {
                "common": {
                    "error": {
                        "header": "A logic error occurred (Code: $1):",
                        "description": "Description:"
                    }
                }
            }
        }))

    #  Chinese-simplified translation.
    _l10n_reg.register_message_tree(
        _l10n_msgtree.ChineseSimplifiedMessageTree({
            "logic": {
                "common": {
                    "error": {
                        "header": "逻辑错误 (错误代码: $1):",
                        "description": "错取解释:"
                    }
                }
            }
        }))
示例#2
0
def setup_localization():
    """Setup localization messages."""

    #  English translation.
    _l10n_reg.register_message_tree(
        _l10n_msgtree.EnglishMessageTree({
            "parser": {
                "common": {
                    "error": {
                        "header": "A parser error occurred (Code: $1):",
                        "description": "Description:",
                        "traceback": "Traceback:"
                    }
                }
            }
        }))

    #  Chinese-simplified translation.
    _l10n_reg.register_message_tree(
        _l10n_msgtree.ChineseSimplifiedMessageTree({
            "parser": {
                "common": {
                    "error": {
                        "header": "解释表达式发生错误 (错误代码: $1):",
                        "description": "错取解释:",
                        "traceback": "错误追踪:"
                    }
                }
            }
        }))
示例#3
0
def setup_localization():
    """Setup localization messages."""

    #  English translation.
    _l10n_reg.register_message_tree(
        _l10n_msgtree.EnglishMessageTree({
            "logic": {
                "balancer": {
                    "error": {
                        "side_eliminated": {
                            "all":
                            "All molecules in the chemical equation was eliminated.",
                            "left":
                            "All molecules on the left side of the chemical equation was eliminated.",
                            "right":
                            "All molecules on the right side of the chemical equation was eliminated."
                        },
                        "auto_arrange_with_multiple_answers": {
                            "description":
                            "Can't balance chemical equations (with auto-correction form) that have "
                            + "multiple answers."
                        },
                        "feature_disabled": {
                            "auto_arranging":
                            "Auto-arranging feature has been disabled.",
                            "error_correction":
                            "An correctable balancing error was found. But the error-correction "
                            + "feature has been disabled."
                        }
                    }
                }
            }
        }))

    #  Chinese-simplified translation.
    _l10n_reg.register_message_tree(
        _l10n_msgtree.ChineseSimplifiedMessageTree({
            "logic": {
                "balancer": {
                    "error": {
                        "side_eliminated": {
                            "all": "该化学方程式中的所有分子都已被消去。",
                            "left": "该化学方程式中的等号左侧的所有分子都已被消去。",
                            "right": "该化学方程式中的等号右侧的所有分子都已被消去。"
                        },
                        "auto_arrange_with_multiple_answers": {
                            "description": "无法配平自动分界形式且包含多组解的化学方程式。"
                        },
                        "feature_disabled": {
                            "auto_arranging": "自动分界特性已被禁用。",
                            "error_correction": "发生了一个可纠正的配平错误,但纠错特性已被禁用。"
                        }
                    }
                }
            }
        }))
示例#4
0
def setup_localization():
    """Setup localization messages."""

    #  English translation.
    _l10n_reg.register_message_tree(
        _l10n_msgtree.EnglishMessageTree({
            "shell": {
                "console": {
                    "error": {
                        "invalid_character": {
                            "description":
                            "Found invalid character(s) in the expression."
                        },
                        "invalid_unknown_header": {
                            "description": "Invalid unknown header."
                        },
                        "file_reading_error": {
                            "description": "Can't read file \"$1\"."
                        },
                        "file_corrupted": {
                            "description": "Corrupted file \"$1\"."
                        }
                    },
                    "command": {
                        "header": "BCE - Chemical Equation Balancer",
                        "output_mathml": "Show output in MathML format.",
                        "disable_banner": "Disable the start-up banner.",
                        "disable_bundled_abbreviations":
                        "Disable bundled abbreviations.",
                        "disable_error_correction":
                        "Disable the error-correction feature.",
                        "disable_auto_arranging":
                        "Disable the auto-arranging feature.",
                        "service_mode": "Start in service mode.",
                        "unknown_header": "Set the header of unknown symbols.",
                        "load_abbreviations_file":
                        "Load extra abbreviations from specified file.",
                        "language": "Set the software language." +
                        "(Available: \"en_US\" [English(US)], \"zh_CN\", \"zh_Hans\" [Simplified Chinese])",
                        "show_version": "Show the software version."
                    },
                    "application": {
                        "banner": "BCE V$1.$2.$3",
                        "copyright":
                        "Copyright (C) 2014 - 2018 The BCE Authors. All rights reserved.",
                        "version": "bce-$1.$2.$3"
                    }
                }
            }
        }))

    #  Chinese-simplified translation.
    _l10n_reg.register_message_tree(
        _l10n_msgtree.ChineseSimplifiedMessageTree({
            "shell": {
                "console": {
                    "error": {
                        "invalid_character": {
                            "description": "表达式中存在无效字符。"
                        },
                        "invalid_unknown_header": {
                            "description": "无效的未知量符号前缀。"
                        },
                        "file_reading_error": {
                            "description": "无法读取文件 \"$1\"。"
                        },
                        "file_corrupted": {
                            "description": "文件 \"$1\" 已损坏。"
                        }
                    },
                    "command": {
                        "header": "BCE - 化学方程式配平程序",
                        "output_mathml": "将结果显示为 MathML 格式。",
                        "disable_banner": "禁用启动时标语。",
                        "disable_bundled_abbreviations": "禁用自带的各种缩写符号。",
                        "disable_error_correction": "禁用自动纠错特性。",
                        "disable_auto_arranging": "禁用自动分界特性。",
                        "service_mode": "从服务模式启动。",
                        "unknown_header": "设置系统未知量符号前缀。",
                        "load_abbreviations_file": "从指定文件中读取额外(非自带的)的缩写符号。",
                        "language": "设置软件语言。" +
                        "(可用选项: \"en_US\" [英语(美国)], \"zh_CN\", \"zh_Hans\" [中文(简体)])",
                        "version": "显示软件版本。"
                    },
                    "application": {
                        "banner": "BCE V$1.$2.$3",
                        "copyright": "版权所有 (C) 2014 - 2018 BCE 的作者,保留所有权利。",
                        "version": "bce-$1.$2.$3"
                    }
                }
            }
        }))
示例#5
0
def setup_localization():
    """Setup localization messages."""

    #  English translation.
    _l10n_reg.register_message_tree(_l10n_msgtree.EnglishMessageTree({
        "parser": {
            "mexp": {
                "error": {
                    "duplicated_decimal_dot": {
                        "description": "Duplicated decimal dot.",
                        "previous_dot": "Here's the previous decimal dot.",
                        "duplicated_dot": "Here's the duplicated decimal dot."
                    },
                    "protected_header": {
                        "description": "Used protected header.",
                        "message": "This symbol begins with the protected symbol header '$1'."
                    },
                    "unrecognized_token": {
                        "description": "Unrecognized token.",
                        "message": "This token can't be recognized."
                    },
                    "missing_operand": {
                        "description": "Missing operand.",
                        "left": "This operator has no left operand.",
                        "right": "This operator has no right operand."
                    },
                    "missing_operator": {
                        "description": "Missing operator.",
                        "multiply_before": "Missing a multiply operator before this token."
                    },
                    "unsupported_function": {
                        "description": "Unsupported function.",
                        "message": "The function '$1' hasn't been supported yet."
                    },
                    "no_content": {
                        "description": "No content.",
                        "in_parentheses": "There is no content between these parentheses.",
                        "in_argument": "This argument has no content."
                    },
                    "parenthesis_mismatch": {
                        "description": "Parenthesis mismatch.",
                        "left": "Missing left parenthesis matches with this parenthesis.",
                        "right": "Missing right parenthesis matches with this parenthesis.",
                        "incorrect": "Incorrect parenthesis, this parenthesis should be changed to '$1'."
                    },
                    "argument_count_mismatch": {
                        "description": "Argument count mismatch.",
                        "message": "This function requires $1 argument(s), but $2 argument(s) was/were provided."
                    },
                    "illegal_separator": {
                        "description": "Illegal argument separator.",
                        "message": "This argument separator was misplaced."
                    },
                    "divide_zero": {
                        "description": "Divide zero.",
                        "message": "The division is zero."
                    },
                    "domain_out_of_range": {
                        "description": "Domain is out of range.",
                        "message": "The value of the $1(st/nd/th) argument is out of its domain range."
                    }
                }
            }
        }
    }))

    #  Chinese-simplified translation.
    _l10n_reg.register_message_tree(_l10n_msgtree.ChineseSimplifiedMessageTree({
        "parser": {
            "mexp": {
                "error": {
                    "duplicated_decimal_dot": {
                        "description": "重复的小数点。",
                        "previous_dot": "这是上一个小数点。",
                        "duplicated_dot": "这是重复的小数点。"
                    },
                    "protected_header": {
                        "description": "使用了受保护的符号头.",
                        "message": "该符号使用了受保护的符号头 '$1'。"
                    },
                    "unrecognized_token": {
                        "description": "无法识别的记号。",
                        "message": "该记号无法被识别。"
                    },
                    "missing_operand": {
                        "description": "缺少操作数。",
                        "left": "该运算符没有左操作数。",
                        "right": "该运算符没有右操作数。"
                    },
                    "missing_operator": {
                        "description": "缺少操作符。",
                        "multiply_before": "该记号前面缺少一个乘号 (*)。"
                    },
                    "unsupported_function": {
                        "description": "不支持的函数。",
                        "message": "函数 '$1' 不被支持。"
                    },
                    "no_content": {
                        "description": "缺少内容。",
                        "in_parentheses": "该对括号内没有内容。",
                        "in_argument": "该参数缺少内容。"
                    },
                    "parenthesis_mismatch": {
                        "description": "括号不匹配。",
                        "left": "缺少与此括号相匹配的左括号。",
                        "right": "缺少与此括号相匹配的右括号。",
                        "incorrect": "不正确的括号,该括号应该为 '$1'。"
                    },
                    "argument_count_mismatch": {
                        "description": "参数个数不匹配。",
                        "message": "该函数需要 $1 个参数,但仅指定了 $2 个。"
                    },
                    "illegal_separator": {
                        "description": "非法的分隔符。",
                        "message": "该参数分隔符位于非法的位置。"
                    },
                    "divide_zero": {
                        "description": "除数为零。",
                        "message": "该除法的除数为零。"
                    },
                    "domain_out_of_range": {
                        "description": "定义域错误。",
                        "message": "第 $1 个参数的值超出了它的定义域。"
                    }
                }
            }
        }
    }))
示例#6
0
def setup_localization():
    """Setup localization messages."""

    #  English translation.
    _l10n_reg.register_message_tree(
        _l10n_msgtree.EnglishMessageTree({
            "parser": {
                "molecule": {
                    "error": {
                        "parenthesis_mismatch": {
                            "description":
                            "Parenthesis mismatch.",
                            "left":
                            "Missing left parenthesis matches with this parenthesis.",
                            "right":
                            "Missing right parenthesis matches with this parenthesis.",
                            "incorrect":
                            "Incorrect parenthesis, this parenthesis should be changed to '$1'."
                        },
                        "no_content": {
                            "description": "No content.",
                            "before":
                            "There is no content before this position.",
                            "after":
                            "There is no content after this position.",
                            "inside": "There is no content inside."
                        },
                        "parsing_mexp": {
                            "message":
                            "An error occurred when parsing and evaluating this math expression."
                        },
                        "parsing_abbreviation": {
                            "origin":
                            "An error occurred when parsing the abbreviation.",
                            "expand":
                            "An error occurred when parsing the expanded expression."
                        },
                        "unrecognized_token": {
                            "description": "Unrecognized token.",
                            "message": "This token is unexpected."
                        },
                        "unexpected_token": {
                            "description":
                            "Unexpected token.",
                            "electronic_suffix":
                            "Expect positivity descriptor(e+/e-) or an integer here.",
                            "electronic_end":
                            "Expect a '>' here.",
                            "electronic_misplaced":
                            "Misplaced status descriptor. It should be put at the end of the "
                            + "molecule.",
                            "other":
                            "This token is unexpected."
                        },
                        "domain_error": {
                            "description":
                            "Domain error.",
                            "prefix":
                            "The prefix operand shouldn't be less than or equal to zero.",
                            "electronic_charge":
                            "The electronic charge shouldn't be less than or equal to zero.",
                            "suffix":
                            "The suffix operand shouldn't be less than or equal to zero."
                        },
                        "exceed_operand": {
                            "description":
                            "Exceed operand.",
                            "prefix":
                            "The prefix operand is exceed and it should be removed.",
                            "electronic_charge":
                            "The charge is exceed and it should be removed.",
                            "suffix":
                            "The suffix operand is exceed and it should be removed."
                        },
                        "element_eliminated": {
                            "description": "Element eliminated.",
                            "message": "Element '$1' was eliminated."
                        },
                        "unsupported_abbreviation": {
                            "description": "Unsupported abbreviation.",
                            "message": "The abbreviation is unsupported."
                        }
                    }
                }
            }
        }))

    #  Chinese-simplified translation.
    _l10n_reg.register_message_tree(
        _l10n_msgtree.ChineseSimplifiedMessageTree({
            "parser": {
                "molecule": {
                    "error": {
                        "parenthesis_mismatch": {
                            "description": "括号不匹配。",
                            "left": "缺少与此括号相匹配的左括号。",
                            "right": "缺少与此括号相匹配的右括号。",
                            "incorrect": "不正确的括号,该括号应该为 '$1'。"
                        },
                        "no_content": {
                            "description": "缺少内容。",
                            "before": "该位置之前缺少内容。",
                            "after": "该位置之后缺少内容。",
                            "inside": "缺少内部内容。"
                        },
                        "parsing_mexp": {
                            "message": "在解析该数学表达式时发生错误。"
                        },
                        "parsing_abbreviation": {
                            "origin": "在解析该缩写时发生错误。",
                            "expand": "在解析该展开式时发生错误。"
                        },
                        "unrecognized_token": {
                            "description": "无法识别的记号。",
                            "message": "该记号无法被识别。"
                        },
                        "unexpected_token": {
                            "description": "未期望的记号。",
                            "electronic_suffix":
                            "这里被期望是一个电荷正负性描述符 (e+/e-) 或一个整数。",
                            "electronic_end": "这里被期望是一个 '>'。",
                            "electronic_misplaced":
                            "状态描述符位置不正确。它应该被放到分子表达式的最后。",
                            "other": "该符号未被期望。"
                        },
                        "domain_error": {
                            "description": "定义域错误。",
                            "prefix": "该前缀数不应该小于等于零。",
                            "electronic_charge": "该电量描述符的数值不应该小于等于零。",
                            "suffix": "该后缀数不应该小于等于零。"
                        },
                        "exceed_operand": {
                            "description": "多余的操作数",
                            "prefix": "该前缀操作数是多余的,它应当被删除。",
                            "electronic_charge": "该电量描述符是多余的,它应当被删除。",
                            "suffix": "该后缀操作数是多余的,它应当被删除。"
                        },
                        "element_eliminated": {
                            "description": "元素被消去。",
                            "message": "元素 '$1' 被消去。"
                        },
                        "unsupported_abbreviation": {
                            "description": "不支持的缩写。",
                            "message": "该所写不被支持。"
                        }
                    }
                }
            }
        }))
示例#7
0
def setup_localization():
    """Setup localization messages."""

    #  English translation.
    _l10n_reg.register_message_tree(
        _l10n_msgtree.EnglishMessageTree({
            "parser": {
                "cexp": {
                    "error": {
                        "parenthesis_mismatch": {
                            "description":
                            "Parenthesis mismatch.",
                            "left":
                            "Missing left parenthesis matches with this parenthesis.",
                            "right":
                            "Missing right parenthesis matches with this parenthesis."
                        },
                        "mixed_form": {
                            "description":
                            "Mixed form.",
                            "message":
                            "The chemical equation mixed normal form and auto-arranging form."
                        },
                        "empty_expression": {
                            "description": "Empty expression."
                        },
                        "no_content": {
                            "description":
                            "No content.",
                            "operator_between":
                            "There is no content between these two operators.",
                            "operator_before":
                            "There is no content before this operator.",
                            "operator_after":
                            "There is no content after this operator."
                        },
                        "parsing_molecule": {
                            "message":
                            "An error occurred when parsing the molecule."
                        },
                        "duplicated_equal_sign": {
                            "description": "Duplicated equal sign.",
                            "previous": "Here's the previous equal sign.",
                            "duplicated": "Here's the duplicated one."
                        },
                        "only_one_molecule": {
                            "description":
                            "Only one molecule.",
                            "message":
                            "There is only one molecule in the chemical equation."
                        },
                        "no_equal_sign": {
                            "description":
                            "No equal sign.",
                            "message":
                            "There is no equal sign in this chemical equation."
                        }
                    }
                }
            }
        }))

    #  Chinese-simplified translation.
    _l10n_reg.register_message_tree(
        _l10n_msgtree.ChineseSimplifiedMessageTree({
            "parser": {
                "cexp": {
                    "error": {
                        "parenthesis_mismatch": {
                            "description": "括号不匹配。",
                            "left": "缺少与此括号相匹配的左括号。",
                            "right": "缺少与此括号相匹配的右括号。",
                        },
                        "mixed_form": {
                            "description": "混合形式。",
                            "message": "该化学方程式同时包含了一般形式和自动分界形式。"
                        },
                        "empty_expression": {
                            "description": "空表达式。"
                        },
                        "no_content": {
                            "description": "缺少内容。",
                            "operator_between": "这两个操作符之间缺少内容。",
                            "operator_before": "该操作符之前缺少内容。",
                            "operator_after": "该操作符之后缺少内容。"
                        },
                        "parsing_molecule": {
                            "message": "在解析该分子式时发生错误。"
                        },
                        "duplicated_equal_sign": {
                            "description": "重复的等号。",
                            "previous": "这是上一个等号。",
                            "duplicated": "这是重复的等号。"
                        },
                        "only_one_molecule": {
                            "description": "单分子方程。",
                            "message": "该化学方程式中仅包含一个分子。"
                        },
                        "no_equal_sign": {
                            "description": "无等号。",
                            "message": "该化学方程式中无等号。"
                        }
                    }
                }
            }
        }))