Example #1
0
def setup_sieve (p):

    p.set_desc(_("@info sieve discription",
    "Check language of translation using LanguageTool."
    "\n\n"
    "LanguageTool (http://www.languagetool.org) is an open source "
    "language checker, which may be used as a standalone application, "
    "or in server-client mode. "
    "This sieve runs in client-server mode, so make sure Language Tool "
    "is running before this sieve is run."
    ))

    add_param_lang(p)
    add_param_accel(p)
    add_param_markup(p)
    add_param_filter(p,
        intro=_("@info sieve parameter discription",
        "The F1A or F3A/C hook through which to filter the translation "
        "before passing it to grammar checking."
        ))
    p.add_param("host", str, defval="localhost",
                metavar=_("@info sieve parameter value placeholder", "NAME"),
                desc=_("@info sieve parameter discription",
    "Name of the host where the server is running."
    ))
    p.add_param("port", str, defval="8081",
                metavar=_("@info sieve parameter value placeholder", "NUMBER"),
                desc=_("@info sieve parameter discription",
    "TCP port on the host which server uses to listen for queries."
    ))
                
    add_param_poeditors(p)
Example #2
0
def setup_sieve (p):

    p.set_desc(_("@info sieve discription",
    "Check validity of messages in catalogs within KDE Translation Project."
    ))
    p.add_param("strict", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Check translations strictly: report problems in translation regardless "
    "of whether original itself is valid (default is to check translation "
    "only if original passes checks)."
    ))
    chnames = _known_checks.keys()
    chnames.sort()
    p.add_param("check", unicode, seplist=True,
                metavar=_("@info sieve parameter value placeholder",
                          "KEYWORD,..."),
                desc=_("@info sieve parameter discription",
    "Run only this check instead of all (currently available: %(chklist)s). "
    "Several checks can be specified as a comma-separated list.",
    chklist=format_item_list(chnames)
    ))
    p.add_param("showmsg", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Also show the full message that had some problems."
    ))
    add_param_poeditors(p)
Example #3
0
def setup_sieve (p):

    p.set_desc(_("@info sieve discription",
    "Check catalogs covering Docbook 4.x documents for various problems."
    ))

    p.add_param("showmsg", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Also show the full message which has a problem."
    ))
    add_param_poeditors(p)
Example #4
0
def setup_sieve(p):

    p.set_desc(
        _("@info sieve discription",
          "Check native KDE4 PO files for various problems."))
    p.add_param(
        "strict",
        bool,
        defval=False,
        desc=_(
            "@info sieve parameter discription",
            "Check for problems in translation regardless of whether the original "
            "itself is free of problems (default is to check translation only if "
            "the original has no problems)."))
    add_param_poeditors(p)
Example #5
0
def setup_sieve (p):

    p.set_desc(_("@info sieve discription",
    "Check validity of messages in catalogs of The Battle for Wesnoth."
    ))
    chnames = _known_checks.keys()
    chnames.sort()
    p.add_param("check", unicode, seplist=True,
                metavar=_("@info sieve parameter value placeholder",
                          "KEYWORD,..."),
                desc=_("@info sieve parameter discription",
    "Run only this check instead of all (currently available: %(chklist)s). "
    "Several checks can be specified as a comma-separated list.",
    chklist=format_item_list(chnames)
    ))
    p.add_param("showmsg", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Also show the full message that had some problems."
    ))
    add_param_poeditors(p)
Example #6
0
def setup_sieve (p):

    p.set_desc(_("@info sieve discription",
    "Unfuzzy messages which got fuzzy only due to changed context."
    "\n\n"
    "Possible only if catalogs were merged with --previous option."
    "\n\n"
    "By default, unfuzzied messages will get a translator comment with "
    "the string '%(str)s', so that they can be reviewed later.",
    str="unreviewed-context"
    ))

    p.add_param("noreview", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Do not add translator comment indicating unreviewed context."
    ))
    p.add_param("eqmsgid", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Do not unfuzzy messages which have same msgid as another message, "
    "and report them together with all other messages with the same msgid."
    ))
    add_param_poeditors(p)
Example #7
0
def setup_sieve (p):

    p.set_desc(_("@info sieve discription",
    "Apply rules to messages and report those that do not pass."
    ))

    add_param_lang(p, appx=_("@info sieve parameter discription",
        "If the language is left undefined for a given catalog, "
        "it will be skipped and a warning may be output."
        ))
    add_param_env(p, appx=_("@info sieve parameter discription",
        "If the environment is left undefined for a given catalog, "
        "only environment-agnostic rules will be applied."
        ))
    p.add_param("stat", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Output statistics on application of rules."
    ))
    p.add_param("envonly", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Load only rules explicitly belonging to environment given by '%(par)s'.",
    par="env"
    ))
    p.add_param("accel", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "CHAR"),
                desc=_("@info sieve parameter discription",
    "Character which is used as UI accelerator marker in text fields. "
    "If a catalog defines accelerator marker in the header, "
    "this value overrides it."
    ))
    p.add_param("markup", unicode, seplist=True,
                metavar=_("@info sieve parameter value placeholder", "KEYWORD"),
                desc=_("@info sieve parameter discription",
    "Markup that can be expected in text fields, as special keyword "
    "(see documentation to pology.catalog, Catalog.set_markup(), "
    "for markup keywords currently known to Pology). "
    "If a catalog defines markup type in the header, "
    "this value overrides it."
    "Several markups can be given as comma-separated list."
    ))
    p.add_param("rfile", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "PATH"),
                desc=_("@info sieve parameter discription",
    "Load rules from a file, rather than internal Pology rules. "
    "Several rule files can be given by repeating the parameter."
    ))
    p.add_param("rdir", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "DIRPATH"),
                desc=_("@info sieve parameter discription",
    "Load rules from a directory, rather than internal Pology rules."
    "Several rule directories can be given by repeating the parameter."
    ))
    p.add_param("showfmsg", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Show filtered message too when reporting message failed by a rule."
    ))
    p.add_param("nomsg", bool, attrname="showmsg", defval=True,
                desc=_("@info sieve parameter discription",
    "Do not show message content at all when reporting failures."
    ))
    p.add_param("rule", unicode, seplist=True,
                metavar=_("@info sieve parameter value placeholder", "RULEID"),
                desc=_("@info sieve parameter discription",
    "Apply only the rule given by this identifier. "
    "Several identifiers can be given as comma-separated list."
    ))
    p.add_param("rulerx", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "REGEX"),
                desc=_("@info sieve parameter discription",
    "Apply only the rules with identifiers matching this regular expression. "
    "Several patterns can be given by repeating the parameter."
    ))
    p.add_param("norule", unicode, seplist=True,
                metavar=_("@info sieve parameter value placeholder", "RULEID"),
                desc=_("@info sieve parameter discription",
    "Do not apply rule given by this identifier. "
    "Several identifiers can be given as comma-separated list."
    ))
    p.add_param("norulerx", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "REGEX"),
                desc=_("@info sieve parameter discription",
    "Do not apply the rules with identifiers matching this regular expression. "
    "Several patterns can be given by repeating the parameter."
    ))
    p.add_param("branch", unicode, seplist=True,
                metavar=_("@info sieve parameter value placeholder", "BRANCH"),
                desc=_("@info sieve parameter discription",
    "In summit catalogs, consider only messages belonging to given branch. "
    "Several branches can be given as comma-separated list."
    ))
    p.add_param("xml", unicode,
                metavar=_("@info sieve parameter value placeholder", "PATH"),
                desc=_("@info sieve parameter discription",
    "Write rule failures into an XML file instead of stdout."
    ))
    p.add_param("mark", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Add '%(flag)s' flag to each message failed by a rule.",
    flag=_flag_mark
    ))
    p.add_param("byrule", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Output failed messages ordered by sorted rule identifiers."
    ))
    p.add_param("ruleinfo", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Show information on loading of rules during sieving."
    ))
    add_param_poeditors(p)
Example #8
0
def setup_sieve (p):

    p.set_desc(_("@info sieve discription",
    "Find messages in catalogs."
    "\n\n"
    "Each message is matched according to one or several criteria, "
    "and if it matches as whole, it is displayed to standard output, "
    "along with the catalog path and referent line and entry number."
    "\n\n"
    "When several matching parameters are given, by default a message "
    "is matched if all of them match (AND-relation). "
    "This can be changed to OR-relation for matching in text fields "
    "(%(fieldlist)s) using the '%(par)s' parameter. "
    "Any matching parameter can be repeated when it makes sense "
    "(e.g. two matches on msgid).",
    fieldlist=format_item_list(["msgctxt", "msgid", "msgstr", "comment"]),
    par="or"
    ))

    # NOTE: Do not add default values for matchers,
    # we need None to see if they were issued or not.
    p.add_param("msgid", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "REGEX"),
                desc=_("@info sieve parameter discription",
    "Matches if the '%(field)s' field matches the regular expression.",
    field="msgid"
    ))
    p.add_param("nmsgid", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "REGEX"),
                desc=_("@info sieve parameter discription",
    "Matches if the '%(field)s' field does not match the regular expression.",
    field="msgid"
    ))
    p.add_param("msgstr", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "REGEX"),
                desc=_("@info sieve parameter discription",
    "Matches if the '%(field)s' field matches the regular expression.",
    field="msgstr"
    ))
    p.add_param("nmsgstr", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "REGEX"),
                desc=_("@info sieve parameter discription",
    "Matches if the '%(field)s' field does not match the regular expression.",
    field="msgstr"
    ))
    p.add_param("msgctxt", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "REGEX"),
                desc=_("@info sieve parameter discription",
    "Matches if the '%(field)s' field matches the regular expression.",
    field="msgctxt"
    ))
    p.add_param("nmsgctxt", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "REGEX"),
                desc=_("@info sieve parameter discription",
    "Matches if the '%(field)s' field does not match the regular expression.",
    field="msgctxt"
    ))
    p.add_param("comment", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "REGEX"),
                desc=_("@info sieve parameter discription",
    "Matches if a comment line (extracted or translator) "
    "matches the regular expression."
    ))
    p.add_param("ncomment", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "REGEX"),
                desc=_("@info sieve parameter discription",
    "Matches if a comment line (extracted or translator) "
    "does not match the regular expression."
    ))
    p.add_param("transl", bool,
                desc=_("@info sieve parameter discription",
    "Matches if the message is translated."
    ))
    p.add_param("ntransl", bool,
                desc=_("@info sieve parameter discription",
    "Matches if the message is not translated."
    ))
    p.add_param("obsol", bool,
                desc=_("@info sieve parameter discription",
    "Matches if the message is obsolete."
    ))
    p.add_param("nobsol", bool,
                desc=_("@info sieve parameter discription",
    "Matches if the message is not obsolete."
    ))
    p.add_param("active", bool,
                desc=_("@info sieve parameter discription",
    "Matches if the message is active (translated and not obsolete)."
    ))
    p.add_param("nactive", bool,
                desc=_("@info sieve parameter discription",
    "Matches if the message is not active (not translated or obsolete)."
    ))
    p.add_param("flag", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "REGEX"),
                desc=_("@info sieve parameter discription",
    "Matches if one of the flags matches the regular expression."
    ))
    p.add_param("nflag", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "REGEX"),
                desc=_("@info sieve parameter discription",
    "Matches if none of the flags matches the regular expression."
    ))
    p.add_param("plural", bool,
                desc=_("@info sieve parameter discription",
    "Matches if the message is plural."
    ))
    p.add_param("nplural", bool,
                desc=_("@info sieve parameter discription",
    "Matches if the message is not plural."
    ))
    p.add_param("maxchar", int,
                metavar=_("@info sieve parameter value placeholder", "NUM"),
                desc=_("@info sieve parameter discription",
    "Matches if both the '%(field1)s' and '%(field2)s' field "
    "have at most this many characters "
    "(0 or less means any number of characters).",
    field1="msgid", field2="msgstr"
    ))
    p.add_param("nmaxchar", int,
                metavar=_("@info sieve parameter value placeholder", "NUM"),
                desc=_("@info sieve parameter discription",
    "Matches if either the '%(field1)s' or '%(field2)s' field "
    "have more than this many characters "
    "(0 or less means any number of characters).",
    field1="msgid", field2="msgstr"
    ))
    p.add_param("lspan", unicode,
                metavar=_("@info sieve parameter value placeholder",
                          "START:END"),
                desc=_("@info sieve parameter discription",
    "Matches if the message line number is in the given range "
    "(including starting line, excluding ending line)."
    ))
    p.add_param("nlspan", unicode,
                metavar=_("@info sieve parameter value placeholder",
                          "START:END"),
                desc=_("@info sieve parameter discription",
    "Matches if the message line number is not in the given range "
    "(including starting line, excluding ending line)."
    ))
    p.add_param("espan", unicode,
                metavar=_("@info sieve parameter value placeholder",
                          "START:END"),
                desc=_("@info sieve parameter discription",
    "Matches if the message entry number is in the given range "
    "(including starting entry, excluding ending entry)."
    ))
    p.add_param("nespan", unicode,
                metavar=_("@info sieve parameter value placeholder",
                          "START:END"),
                desc=_("@info sieve parameter discription",
    "Matches if the message entry number is not in the given range "
    "(including starting entry, excluding ending entry)."
    ))
    p.add_param("branch", unicode, seplist=True,
                metavar=_("@info sieve parameter value placeholder", "BRANCH"),
                desc=_("@info sieve parameter discription",
    "In summit catalogs, match only messages belonging to given branch. "
    "Several branches can be given as comma-separated list."
    ))
    p.add_param("nbranch", unicode, seplist=True,
                metavar=_("@info sieve parameter value placeholder", "BRANCH"),
                desc=_("@info sieve parameter discription",
    "Match only messages not belonging to given branch."
    ))
    p.add_param("fexpr", unicode,
                metavar=_("@info sieve parameter value placeholder",
                          "EXPRESSION"),
                desc=_("@info sieve parameter discription",
    "Matches if the logical expression matches. "
    "The expression is composed of direct matchers (not starting with n*), "
    "explicitly linked with AND, OR, and NOT operators, and parenthesis. "
    "Base matchers taking parameters are given as MATCHER/VALUE/, "
    "where slash can be replaced consistently with any other character. "
    "Global matching modifiers can be overriden using MATCHER/VALUE/MODS, or "
    "MATCHER/MODS for parameterless matchers "
    "(currently available: c/i for case-sensitive/insensitive). "
    "Examples:"
    "\n\n"
    "fexpr:'(msgctxt/foo/ or comment/foo/) and msgid/bar/'"
    "\n\n"
    "fexpr:'msgid/quuk/ and msgstr/Qaak/c'"
    ))
    p.add_param("nfexpr", unicode,
                metavar=_("@info sieve parameter value placeholder",
                          "EXPRESSION"),
                desc=_("@info sieve parameter discription",
    "Matches if the logical expression does not match."
    ))
    p.add_param("or", bool, defval=False, attrname="or_match",
                desc=_("@info sieve parameter discription",
    "Use OR-relation for matching text fields: if any of "
    "the patterns matches, the message is matched as whole."
    ))
    p.add_param("invert", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Invert the condition: report messages which do not match."
    ))
    p.add_param("case", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Case-sensitive text matching."
    ))
    p.add_param("accel", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "CHAR"),
                desc=_("@info sieve parameter discription",
    "Character which is used as UI accelerator marker in text fields, "
    "to ignore it on matching. "
    "If a catalog defines accelerator marker in the header, "
    "this value overrides it."
    ))
    p.add_param("mark", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Add '%(flag)s' flag to each matched message.",
    flag=_flag_mark
    ))
    p.add_param("filter", unicode, multival=True,
                metavar=_("@info sieve parameter value placeholder", "HOOK"),
                desc=_("@info sieve parameter discription",
    "F1A hook specification, to filter the msgstr fields through "
    "before matching them. "
    "Several hooks can be specified by repeating the parameter."
    ))
    p.add_param("replace", unicode,
                metavar=_("@info sieve parameter value placeholder",
                          "REPLSTR"),
                desc=_("@info sieve parameter discription",
    "Replace all substrings matched by msgstr pattern with REPLSTR. "
    "It can include back-references to matched groups (\\1, \\2, etc.)"
    ))
    p.add_param("nomsg", bool, defval=False,
                desc=_("@info sieve parameter discription",
    "Do not report message to standard output "
    "(when only the number of matches is wanted)."
    ))
    add_param_poeditors(p)