Skip to content

Commit 0849e9b

Browse files
author
Roman Miroshnychenko
committed
Fix sync_addon_info_translations.py
1 parent 855e725 commit 0849e9b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

plugin.video.external.library/resources/language/resource.language.uk_ua/strings.po

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,8 @@ msgstr "Почалося оновлення віддаленої медіате
145145

146146
msgctxt "addon.xml:summary"
147147
msgid "Kodi external video library client"
148+
msgstr ""
149+
150+
msgctxt "addon.xml:description"
151+
msgid "A plugin that allows to browse and play items from a video library on an external Kodi instance."
148152
msgstr ""

scripts/sync_addon_info_translations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def update_po_file(po_file, en_strings, lang_strings, is_en=False):
120120

121121
# Replace existing translation segment
122122
updated_content = re.sub(
123-
r'msgctxt "addon\.xml:summary"\s*\nmsgid ".*"\s*\nmsgstr ".*"',
123+
r'msgctxt "addon\.xml:summary"\s*?\nmsgid "[^"]*"\s*?\nmsgstr "[^"]*"',
124124
f'msgctxt "addon.xml:summary"\nmsgid "{en_summary}"\nmsgstr "{msgstr}"',
125125
updated_content,
126126
flags=re.DOTALL
@@ -143,7 +143,7 @@ def update_po_file(po_file, en_strings, lang_strings, is_en=False):
143143

144144
# Replace existing translation segment
145145
updated_content = re.sub(
146-
r'msgctxt "addon\.xml:description"\s*\nmsgid ".*"\s*\nmsgstr ".*"',
146+
r'msgctxt "addon\.xml:description"\s*?\nmsgid "[^"]*"\s*?\nmsgstr "[^"]*"',
147147
f'msgctxt "addon.xml:description"\nmsgid "{en_description}"\nmsgstr "{msgstr}"',
148148
updated_content,
149149
flags=re.DOTALL
@@ -291,7 +291,7 @@ def main():
291291
epilog="""
292292
Examples:
293293
python sync_addon_info_translations.py -d <addon directory>
294-
python sync_addon_info_translations.py --load-translations s<addon directory>
294+
python sync_addon_info_translations.py --load-translations <addon directory>
295295
"""
296296
)
297297

0 commit comments

Comments
 (0)