Skip to content

Commit

Permalink
pre-translate: manage backquoted constant strings
Browse files Browse the repository at this point in the history
With the new rules for formatting, the terms of the description lists
are now backquoted.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
  • Loading branch information
jnavila committed May 10, 2024
1 parent 94ffbca commit 026597b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/pre-translate-po
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LINKGIT_REGEX = re.compile(r'linkgit:([^\[]+)\[([^\]]+)\]' +
r'|' +
r'\$\([a-zA-Z][a-zA-Z0-9_]+\)' +
r'|' +
r'\b([a-zA-Z]+\.)+[a-z][a-zA-Z]+\b'
r'\b`?([a-zA-Z]+\.)+[a-z][a-zA-Z]+`?\b'
r'|' +
r'\b[a-zA-Z0-9_]+_[a-zA-Z0-9]+\b' +
r'|' +
Expand All @@ -23,7 +23,7 @@ LINKGIT_REGEX = re.compile(r'linkgit:([^\[]+)\[([^\]]+)\]' +
r'|' +
r'\b[a-z-]+--[a-z-]+' +
r'|' +
r'[\[`]?--[a-zA-Z0-9-]+(=[\[\]()\|a-zA-Z0-9+-]*)?(\[=[\[\]()\|a-zA-Z0-9-]+\])?[\]`]?' +
r'([\[`]|\+\+)?--[a-zA-Z0-9-]+(=(\+\+)?[\[\]()\|a-zA-Z0-9+-]*)?(`?\[=[\[\]()\|a-zA-Z0-9-]+\])?[\]`]?' +
r'|' +
r'`-[a-zA-Z]`' +
r'|' +
Expand All @@ -41,7 +41,7 @@ FALSE_POSITIVES = re.compile('example\\.(com|org)|git-(related|foo|branch|rev-li

def main (f, d=None):
po = polib.pofile(f, wrapwidth=0)
option_re = re.compile(r'([\[`]?-[-a-zA-Z0-9]+(=[\[\]()\|a-zA-Z0-9+-]*)?(\[=[\[\]()\|a-zA-Z0-9-]+\])?[\]`]?)|--exec=<git-upload-archive>|--\[no-\][-a-zA-Z0-9]+')
option_re = re.compile(r'([\[`]?-(\-[no-\])?[-a-zA-Z0-9]+(=[\[\]()\|a-zA-Z0-9+-]*)?(\[=[\[\]()\|a-zA-Z0-9-]+\])?[\]`]?)|--exec=<git-upload-archive>')
linkgit_re = re.compile(r'((linkgit:)?(git[-a-z0-9[\]]+|mail)(\[[157]\]|\([157]\))(,|;)?(\n| )?)+\.?')
quoted_re = re.compile(r'\'?%[a-zA-Z]+\'?|(`[a-zA-Z-_]+`(, )?)+|\'(oneline|short|medium|full(er)?|email|raw|(un)?set|unspecified|init|fetch|clone|rebase|dcommit|branch|tag|log|blame|find-rev|set-tree|(create|show)-ignore|mkdirs|commit-diff)\'|(user|transfer|submodule|stash|status|splitIndex|showbranch|sendemail|repack|remote|receive|push|merge(tool)?|mailinfo|log|interactive|instaweb|i18n|help|gui|gitweb|fastimport|format|fetch|diff(tool)?|credential|commit|column|core|branch|apply|color|git-p4)\.[a-zA-Z_.]+|araxis|bc[34]?|codecompare|deltawalker|guiffy|meld|diff(use|merge)|(exam|[gn]?vim|t?k|open|xx)?diff[123]?|(ec?|p4|s|tortoise|win)merge|update|create|delete|verify|option|resolve|recursive|octopus|ours|subtree|theirs|patience|diff-algorithm=\[[a-z\|]+\]|ignore-(space-change|all-space|(cr|space)-at-eol)|(no-)?renormalize|no-renames|no|default|plain|blocks|(dimmed-)?zebra|allow-indentation-change|color|porcelain|none|list|(un)?lock|(re)?move|prune|die|usage|set_reflog_action|git_editor|cd_to_toplevel|require_work_tree(_exists)?|get_author_ident_from_commit|create_virtual_base|add|copy|append|edit|show|merge|get-ref')
env_var_re = re.compile(r'`?GIT_[A-Z_\d]+`?')
Expand Down

0 comments on commit 026597b

Please sign in to comment.