Skip to content

Commit

Permalink
update pre-translation with backquoted strings
Browse files Browse the repository at this point in the history
With more and more man-pages converting to the new formatting rules,
we will have more keywords running with backquotes. Get this format
recognized.

Signed-off-by: Jean-Noël Avila <[email protected]>
  • Loading branch information
jnavila committed Jul 28, 2024
1 parent 449b18e commit dcd9c84
Show file tree
Hide file tree
Showing 25 changed files with 15,415 additions and 15,072 deletions.
1,248 changes: 624 additions & 624 deletions po/documentation.de.po

Large diffs are not rendered by default.

1,341 changes: 701 additions & 640 deletions po/documentation.es.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.es_MX.po

Large diffs are not rendered by default.

1,582 changes: 915 additions & 667 deletions po/documentation.fr.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.hu.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.id.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.is.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.it.po

Large diffs are not rendered by default.

1,252 changes: 626 additions & 626 deletions po/documentation.ja.po

Large diffs are not rendered by default.

1,252 changes: 626 additions & 626 deletions po/documentation.ko.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.mr.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.nb_NO.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.nl.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.pl.po

Large diffs are not rendered by default.

1,279 changes: 641 additions & 638 deletions po/documentation.pt_BR.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.pt_PT.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.ro.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.ru.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.sk.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.tr.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.uk.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.vi.po

Large diffs are not rendered by default.

1,290 changes: 658 additions & 632 deletions po/documentation.zh_HANS-CN.po

Large diffs are not rendered by default.

1,248 changes: 624 additions & 624 deletions po/documentation.zh_HANT.po

Large diffs are not rendered by default.

27 changes: 16 additions & 11 deletions scripts/pre-translate-po
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,48 @@
import polib
import re
import sys

from typing import List, Optional

LINKGIT_REGEX = re.compile(r'linkgit:([^\[]+)\[([^\]]+)\]' +
r'|' +
r'\$?\{[-a-zA-Z0-9_]+\}' +
r'`?\$?\{[-a-zA-Z0-9_]+\}`?' +
r'|' +
r'<<[a-zA-Z0-9_]+(>>|,)' +
r'|' +
r'\$[a-zA-Z][a-zA-Z0-9_]+' +
r'`?\$[a-zA-Z][a-zA-Z0-9_]+(/[a-z0-9-/]+)?`?' +
r'|' +
r'\$\([a-zA-Z][a-zA-Z0-9_]+\)' +
r'`?\$\([a-zA-Z][a-zA-Z0-9_]+\)`?' +
r'|' +
r'\b`?([a-zA-Z]+\.)+[a-z][a-zA-Z]+`?\b'
r'|' +
r'\b[a-zA-Z0-9_]+_[a-zA-Z0-9]+\b' +
r'\b`?[a-zA-Z0-9_]+_[a-zA-Z0-9]+`?\b' +
r'|' +
r'\bgit-[a-z-]+'
r'\b`?git-[a-z-]+`?'
r'|' +
r'\bgit [a-z]+-[a-z-]+' +
r'\b`?git [a-z]+-[a-z-]+`?' +
r'|' +
r'\b[a-z-]+--[a-z-]+' +
r'|' +
r'([\[`]|\+\+)?--[a-zA-Z0-9-]+(=(\+\+)?[\[\]()\|a-zA-Z0-9+-]*)?(`?\[=[\[\]()\|a-zA-Z0-9-]+\])?[\]`]?' +
r'|' +
r'`-[a-zA-Z]`' +
r'|' +
r'`--[a-z-]+`' +
r'|' +
r'%%\(.*?\)'
r'|' +
r'HEAD'
r'`?HEAD(@\{[0-9a-z.]+\})?``?'
r'|' +
r'\[\[.*?\]\]\]?'
r'|' +
r'\.git(/[A-Z_]+|attributes|ignore|/info/exclude)'
r'`?\.git(/[A-Z_]+|attributes|ignore|/info/exclude)`?'
r'|' +
r'(https?://|\blink:)[^\s[]+\[')

FALSE_POSITIVES = re.compile('example\\.(com|org)|git-(related|foo|branch|rev-list-args|repository|dir|upload-archive|stdin)|i\\.e|section\\.subsection|my_script|object--potentially|executable--these|file\\.bundle|full\\.bundle|\\$newbranch|\\$(name|command|rev_name)|repository--the|(repo|project)\\.git|host\\.xz|section\\.key|project_cvs_checkout|TAG_FIXUP|refspecs--they|A_PATH_TO|filename-as-in--w|(sample|file)\\.txt|omitted--such|ORIG_PATH|num_lines|HEAD_name|host_or_ipaddr|(dir|module)_name|notes_ref|email.address|--listen=hostname|--user-path=path|upstream_branch|hook_command_pathname|key_id|my\\.pack|chapter_1|socket_type|pond\\.org|foo\\.example|SOME_ENVIRONMENT_VARIABLE|figure_1|--list-cmds=group|\\{Nth\\}')
FALSE_POSITIVES = re.compile('example\\.(com|org)|git-(related|foo|branch|rev-list-args|repository|dir|upload-archive|stdin|repo)|i\\.e|section\\.subsection|my_script|object--potentially|executable--these|file\\.bundle|full\\.bundle|\\$newbranch|\\$(name|command|rev_name)|repository--the|(repo|project)\\.git|host\\.xz|section\\.key|project_cvs_checkout|TAG_FIXUP|refspecs--they|A_PATH_TO|filename-as-in--w|(sample|file)\\.txt|omitted--such|ORIG_PATH|num_lines|HEAD_name|host_or_ipaddr|(dir|module)_name|notes_ref|email.address|--listen=hostname|--user-path=path|upstream_branch|hook_command_pathname|key_id|my\\.pack|chapter_1|socket_type|pond\\.org|foo\\.example|SOME_ENVIRONMENT_VARIABLE|figure_1|--list-cmds=group|\\{Nth\\}|to/group')

def main (f, d=None):
def main (f: str, d:Optional[str]=None):
po = polib.pofile(f, wrapwidth=0)
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| )?)+\.?')
Expand Down Expand Up @@ -71,7 +76,7 @@ def main (f, d=None):
flags.discard("fuzzy")
entry.previous_msgid = None
else:
placeholders = []
placeholders = [] # type: List[str]
for matched in LINKGIT_REGEX.finditer(entry.msgid):
g = matched.group(0)
# if the string is present, tag it as a placeholder for weblate
Expand Down

0 comments on commit dcd9c84

Please sign in to comment.