From a768a5606dcb1b2b4565db0f5e03e32f6bd58e53 Mon Sep 17 00:00:00 2001 From: Artanias <43622365+Artanias@users.noreply.github.com> Date: Sun, 5 Jul 2026 11:47:07 +0300 Subject: [PATCH] refactor: converts templates extension to j2 and updates translations. - Rename template files from .templ to .j2 extension; - Update babel.cfg to match new template extension; - Update version to 0.6.3 in pyproject.toml and all translation files; - Fix minor typos in English translation strings (missing spaces); - Update line references in translation files due to code changes. --- Makefile | 4 +- locales/babel.cfg | 2 +- locales/codeplag.pot | 76 +++++++++--------- .../translations/en/LC_MESSAGES/codeplag.po | 78 +++++++++---------- .../translations/ru/LC_MESSAGES/codeplag.po | 74 +++++++++--------- pyproject.toml | 2 +- src/codeplag/consts.tmp.py | 4 +- src/templates/{general.templ => general.j2} | 0 src/templates/{sources.templ => sources.j2} | 0 9 files changed, 120 insertions(+), 120 deletions(-) rename src/templates/{general.templ => general.j2} (100%) rename src/templates/{sources.templ => sources.j2} (100%) diff --git a/Makefile b/Makefile index 213fbb19..5edd648b 100644 --- a/Makefile +++ b/Makefile @@ -96,8 +96,8 @@ install: substitute-sources man translate-compile install -D -m 0666 /dev/null $(DESTDIR)/$(CODEPLAG_LOG_PATH) install -D -d -m 0755 $(DESTDIR)/$(LIB_PATH) - install -D -m 0666 src/templates/general.templ $(DESTDIR)/$(LIB_PATH)/general.templ - install -D -m 0666 src/templates/sources.templ $(DESTDIR)/$(LIB_PATH)/sources.templ + install -D -m 0666 src/templates/general.j2 $(DESTDIR)/$(LIB_PATH)/general.j2 + install -D -m 0666 src/templates/sources.j2 $(DESTDIR)/$(LIB_PATH)/sources.j2 cp --recursive locales/translations/ $(DESTDIR)/$(LIB_PATH)/ find "$(DESTDIR)/$(LIB_PATH)/translations/" -type f -name '*.po' -exec rm --force '{}' + diff --git a/locales/babel.cfg b/locales/babel.cfg index 20259cb4..6babfef9 100644 --- a/locales/babel.cfg +++ b/locales/babel.cfg @@ -1,2 +1,2 @@ [python: src/**.py] -[jinja2: src/templates/*.templ] +[jinja2: src/templates/*.j2] diff --git a/locales/codeplag.pot b/locales/codeplag.pot index a3021782..3860344b 100644 --- a/locales/codeplag.pot +++ b/locales/codeplag.pot @@ -5,8 +5,8 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: codeplag 0.6.2\n" -"POT-Creation-Date: 2026-03-23 19:20+0300\n" +"Project-Id-Version: codeplag 0.6.3\n" +"POT-Creation-Date: 2026-07-05 11:17+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Artyom Semidolin\n" "Language-Team: LANGUAGE \n" @@ -251,140 +251,140 @@ msgid "" "user', or 'github-urls' options." msgstr "" -#: src/codeplag/codeplagcli.py:460 src/codeplag/handlers/report.py:444 +#: src/codeplag/codeplagcli.py:460 src/codeplag/handlers/report.py:441 msgid "All paths must be provided." msgstr "" -#: src/codeplag/handlers/report.py:441 +#: src/codeplag/handlers/report.py:438 msgid "Invalid report type." msgstr "" -#: src/templates/general.templ:5 src/templates/sources.templ:5 +#: src/templates/general.j2:5 src/templates/sources.j2:5 msgid "Comparative report" msgstr "" -#: src/templates/general.templ:40 +#: src/templates/general.j2:40 msgid "Check results" msgstr "" -#: src/templates/general.templ:44 src/templates/sources.templ:46 +#: src/templates/general.j2:44 src/templates/sources.j2:46 msgid "Summary information" msgstr "" -#: src/templates/general.templ:46 src/templates/general.templ:65 -#: src/templates/sources.templ:48 +#: src/templates/general.j2:46 src/templates/general.j2:65 +#: src/templates/sources.j2:48 msgid "Path" msgstr "" -#: src/templates/general.templ:47 src/templates/sources.templ:49 +#: src/templates/general.j2:47 src/templates/sources.j2:49 msgid "Total similarity" msgstr "" -#: src/templates/general.templ:63 src/templates/sources.templ:65 +#: src/templates/general.j2:63 src/templates/sources.j2:65 msgid "General information" msgstr "" -#: src/templates/general.templ:66 +#: src/templates/general.j2:66 msgid "Last modification date" msgstr "" -#: src/templates/general.templ:67 +#: src/templates/general.j2:67 msgid "Check date" msgstr "" -#: src/templates/general.templ:80 +#: src/templates/general.j2:80 msgid "Metrics information" msgstr "" -#: src/templates/general.templ:82 +#: src/templates/general.j2:82 msgid "Type of compare" msgstr "" -#: src/templates/general.templ:83 +#: src/templates/general.j2:83 msgid "Metric" msgstr "" -#: src/templates/general.templ:84 +#: src/templates/general.j2:84 msgid "Value" msgstr "" -#: src/templates/general.templ:87 +#: src/templates/general.j2:87 msgid "Fast" msgstr "" -#: src/templates/general.templ:88 +#: src/templates/general.j2:88 msgid "Jaccard Coefficient" msgstr "" -#: src/templates/general.templ:92 +#: src/templates/general.j2:92 msgid "Similarity of operators" msgstr "" -#: src/templates/general.templ:96 +#: src/templates/general.j2:96 msgid "Similarity of keywords" msgstr "" -#: src/templates/general.templ:100 +#: src/templates/general.j2:100 msgid "Similarity of literals" msgstr "" -#: src/templates/general.templ:103 +#: src/templates/general.j2:103 msgid "Weighted average by fast metrics" msgstr "" -#: src/templates/general.templ:106 +#: src/templates/general.j2:106 msgid "Structure" msgstr "" -#: src/templates/general.templ:107 +#: src/templates/general.j2:107 msgid "Similarity of structures" msgstr "" -#: src/templates/general.templ:113 +#: src/templates/general.j2:113 msgid "Similar parts of the second program relative to the first" msgstr "" -#: src/templates/general.templ:115 src/templates/general.templ:149 +#: src/templates/general.j2:115 src/templates/general.j2:149 msgid "Part of the first program" msgstr "" -#: src/templates/general.templ:116 src/templates/general.templ:148 +#: src/templates/general.j2:116 src/templates/general.j2:148 msgid "Part of the second program" msgstr "" -#: src/templates/general.templ:117 src/templates/general.templ:150 -#: src/templates/sources.templ:88 +#: src/templates/general.j2:117 src/templates/general.j2:150 +#: src/templates/sources.j2:88 msgid "Similarity" msgstr "" -#: src/templates/general.templ:146 +#: src/templates/general.j2:146 msgid "Similar parts of the first program relative to the second" msgstr "" -#: src/templates/sources.templ:42 +#: src/templates/sources.j2:42 msgid "Verification results" msgstr "" -#: src/templates/sources.templ:67 +#: src/templates/sources.j2:67 msgid "The path to the file being checked" msgstr "" -#: src/templates/sources.templ:68 +#: src/templates/sources.j2:68 msgid "Total maximum compliance, %" msgstr "" -#: src/templates/sources.templ:83 +#: src/templates/sources.j2:83 msgid "Similar parts of the programs" msgstr "" -#: src/templates/sources.templ:85 +#: src/templates/sources.j2:85 msgid "The name of a similar file" msgstr "" -#: src/templates/sources.templ:86 +#: src/templates/sources.j2:86 msgid "Part of the file that is being checked" msgstr "" -#: src/templates/sources.templ:87 +#: src/templates/sources.j2:87 msgid "Part of a similar file" msgstr "" diff --git a/locales/translations/en/LC_MESSAGES/codeplag.po b/locales/translations/en/LC_MESSAGES/codeplag.po index 1af80df9..c023c192 100644 --- a/locales/translations/en/LC_MESSAGES/codeplag.po +++ b/locales/translations/en/LC_MESSAGES/codeplag.po @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: codeplag 0.6.2\n" +"Project-Id-Version: codeplag 0.6.3\n" "POT-Creation-Date: 2024-05-21 09:28+0300\n" "PO-Revision-Date: 2026-03-23 19:21+0300\n" "Last-Translator: Artyom Semidolin\n" @@ -275,151 +275,151 @@ msgid "There is nothing to modify; please provide at least one argument." msgstr "There is nothing to modify; please provide at least one argument." #: src/codeplag/codeplagcli.py:443 -msgid "The'repo-regexp' option requires the provided 'github-user' option." +msgid "The 'repo-regexp' option requires the provided 'github-user' option." msgstr "The'repo-regexp' option requires the provided 'github-user' option." #: src/codeplag/codeplagcli.py:450 msgid "" -"The'path-regexp' option requires the provided 'directories', 'github-" +"The 'path-regexp' option requires the provided 'directories', 'github-" "user', or 'github-urls' options." msgstr "" "The'path-regexp' option requires the provided 'directories', 'github-" "user', or 'github-urls' options." -#: src/codeplag/codeplagcli.py:460 src/codeplag/handlers/report.py:444 +#: src/codeplag/codeplagcli.py:460 src/codeplag/handlers/report.py:441 msgid "All paths must be provided." msgstr "All or none of the root paths must be specified." -#: src/codeplag/handlers/report.py:441 +#: src/codeplag/handlers/report.py:438 msgid "Invalid report type." msgstr "Invalid report type." -#: src/templates/general.templ:5 src/templates/sources.templ:5 +#: src/templates/general.j2:5 src/templates/sources.j2:5 msgid "Comparative report" msgstr "Comparative report" -#: src/templates/general.templ:40 +#: src/templates/general.j2:40 msgid "Check results" msgstr "Check results" -#: src/templates/general.templ:44 src/templates/sources.templ:46 +#: src/templates/general.j2:44 src/templates/sources.j2:46 msgid "Summary information" msgstr "Summary information" -#: src/templates/general.templ:46 src/templates/general.templ:65 -#: src/templates/sources.templ:48 +#: src/templates/general.j2:46 src/templates/general.j2:65 +#: src/templates/sources.j2:48 msgid "Path" msgstr "Path" -#: src/templates/general.templ:47 src/templates/sources.templ:49 +#: src/templates/general.j2:47 src/templates/sources.j2:49 msgid "Total similarity" msgstr "Total similarity, %" -#: src/templates/general.templ:63 src/templates/sources.templ:65 +#: src/templates/general.j2:63 src/templates/sources.j2:65 msgid "General information" msgstr "General information" -#: src/templates/general.templ:66 +#: src/templates/general.j2:66 msgid "Last modification date" msgstr "Last modification date" -#: src/templates/general.templ:67 +#: src/templates/general.j2:67 msgid "Check date" msgstr "Check date" -#: src/templates/general.templ:80 +#: src/templates/general.j2:80 msgid "Metrics information" msgstr "Metrics information" -#: src/templates/general.templ:82 +#: src/templates/general.j2:82 msgid "Type of compare" msgstr "Type of compare" -#: src/templates/general.templ:83 +#: src/templates/general.j2:83 msgid "Metric" msgstr "Metric" -#: src/templates/general.templ:84 +#: src/templates/general.j2:84 msgid "Value" msgstr "Value" -#: src/templates/general.templ:87 +#: src/templates/general.j2:87 msgid "Fast" msgstr "Fast" -#: src/templates/general.templ:88 +#: src/templates/general.j2:88 msgid "Jaccard Coefficient" msgstr "Jaccard Coefficient" -#: src/templates/general.templ:92 +#: src/templates/general.j2:92 msgid "Similarity of operators" msgstr "Similarity of operators" -#: src/templates/general.templ:96 +#: src/templates/general.j2:96 msgid "Similarity of keywords" msgstr "Similarity of keywords" -#: src/templates/general.templ:100 +#: src/templates/general.j2:100 msgid "Similarity of literals" msgstr "Similarity of literals" -#: src/templates/general.templ:103 +#: src/templates/general.j2:103 msgid "Weighted average by fast metrics" msgstr "Weighted average by fast metrics" -#: src/templates/general.templ:106 +#: src/templates/general.j2:106 msgid "Structure" msgstr "Structure" -#: src/templates/general.templ:107 +#: src/templates/general.j2:107 msgid "Similarity of structures" msgstr "Similarity of structures" -#: src/templates/general.templ:113 +#: src/templates/general.j2:113 msgid "Similar parts of the second program relative to the first" msgstr "Similar parts of the second program relative to the first" -#: src/templates/general.templ:115 src/templates/general.templ:149 +#: src/templates/general.j2:115 src/templates/general.j2:149 msgid "Part of the first program" msgstr "Part of the first program" -#: src/templates/general.templ:116 src/templates/general.templ:148 +#: src/templates/general.j2:116 src/templates/general.j2:148 msgid "Part of the second program" msgstr "Part of the second program" -#: src/templates/general.templ:117 src/templates/general.templ:150 -#: src/templates/sources.templ:88 +#: src/templates/general.j2:117 src/templates/general.j2:150 +#: src/templates/sources.j2:88 msgid "Similarity" msgstr "Similarity" -#: src/templates/general.templ:146 +#: src/templates/general.j2:146 msgid "Similar parts of the first program relative to the second" msgstr "Similar parts of the first program relative to the second" -#: src/templates/sources.templ:42 +#: src/templates/sources.j2:42 msgid "Verification results" msgstr "Verification results" -#: src/templates/sources.templ:67 +#: src/templates/sources.j2:67 msgid "The path to the file being checked" msgstr "The path to the file being checked" -#: src/templates/sources.templ:68 +#: src/templates/sources.j2:68 msgid "Total maximum compliance, %" msgstr "Total maximum compliance, %" -#: src/templates/sources.templ:83 +#: src/templates/sources.j2:83 msgid "Similar parts of the programs" msgstr "Similar parts of the programs" -#: src/templates/sources.templ:85 +#: src/templates/sources.j2:85 msgid "The name of a similar file" msgstr "The name of a similar file" -#: src/templates/sources.templ:86 +#: src/templates/sources.j2:86 msgid "Part of the file that is being checked" msgstr "Part of the file that is being checked" -#: src/templates/sources.templ:87 +#: src/templates/sources.j2:87 msgid "Part of a similar file" msgstr "Part of a similar file" diff --git a/locales/translations/ru/LC_MESSAGES/codeplag.po b/locales/translations/ru/LC_MESSAGES/codeplag.po index 5fdebb89..20893954 100644 --- a/locales/translations/ru/LC_MESSAGES/codeplag.po +++ b/locales/translations/ru/LC_MESSAGES/codeplag.po @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: codeplag 0.6.2\n" +"Project-Id-Version: codeplag 0.6.3\n" "POT-Creation-Date: 2024-05-21 09:28+0300\n" "PO-Revision-Date: 2025-03-28 12:05+0300\n" "Last-Translator: Artyom Semidolin\n" @@ -299,140 +299,140 @@ msgstr "" "Аргумент 'path-regexp' требует заданного параметра 'directories', " "'github-user' или 'github-urls'." -#: src/codeplag/codeplagcli.py:460 src/codeplag/handlers/report.py:444 +#: src/codeplag/codeplagcli.py:460 src/codeplag/handlers/report.py:441 msgid "All paths must be provided." msgstr "Необходимо указать все корневые пути или не указывать ни одного." -#: src/codeplag/handlers/report.py:441 +#: src/codeplag/handlers/report.py:438 msgid "Invalid report type." msgstr "Некорректный тип отчёта." -#: src/templates/general.templ:5 src/templates/sources.templ:5 +#: src/templates/general.j2:5 src/templates/sources.j2:5 msgid "Comparative report" msgstr "Сравнительный отчёт" -#: src/templates/general.templ:40 +#: src/templates/general.j2:40 msgid "Check results" msgstr "Результаты проверки" -#: src/templates/general.templ:44 src/templates/sources.templ:46 +#: src/templates/general.j2:44 src/templates/sources.j2:46 msgid "Summary information" msgstr "Сводка по работам" -#: src/templates/general.templ:46 src/templates/general.templ:65 -#: src/templates/sources.templ:48 +#: src/templates/general.j2:46 src/templates/general.j2:65 +#: src/templates/sources.j2:48 msgid "Path" msgstr "Путь" -#: src/templates/general.templ:47 src/templates/sources.templ:49 +#: src/templates/general.j2:47 src/templates/sources.j2:49 msgid "Total similarity" msgstr "Общая схожесть, %" -#: src/templates/general.templ:63 src/templates/sources.templ:65 +#: src/templates/general.j2:63 src/templates/sources.j2:65 msgid "General information" msgstr "Общая информация" -#: src/templates/general.templ:66 +#: src/templates/general.j2:66 msgid "Last modification date" msgstr "Дата последней модификации" -#: src/templates/general.templ:67 +#: src/templates/general.j2:67 msgid "Check date" msgstr "Дата проверки" -#: src/templates/general.templ:80 +#: src/templates/general.j2:80 msgid "Metrics information" msgstr "Информация по метрикам" -#: src/templates/general.templ:82 +#: src/templates/general.j2:82 msgid "Type of compare" msgstr "Тип сравнения" -#: src/templates/general.templ:83 +#: src/templates/general.j2:83 msgid "Metric" msgstr "Метрика" -#: src/templates/general.templ:84 +#: src/templates/general.j2:84 msgid "Value" msgstr "Значение" -#: src/templates/general.templ:87 +#: src/templates/general.j2:87 msgid "Fast" msgstr "Быстрый" -#: src/templates/general.templ:88 +#: src/templates/general.j2:88 msgid "Jaccard Coefficient" msgstr "Коэффициент Жаккара" -#: src/templates/general.templ:92 +#: src/templates/general.j2:92 msgid "Similarity of operators" msgstr "Схожесть операторов" -#: src/templates/general.templ:96 +#: src/templates/general.j2:96 msgid "Similarity of keywords" msgstr "Схожесть ключевых слов" -#: src/templates/general.templ:100 +#: src/templates/general.j2:100 msgid "Similarity of literals" msgstr "Схожеcть литералов" -#: src/templates/general.templ:103 +#: src/templates/general.j2:103 msgid "Weighted average by fast metrics" msgstr "Средневзвешенное по быстрым метрикам" -#: src/templates/general.templ:106 +#: src/templates/general.j2:106 msgid "Structure" msgstr "Структурный" -#: src/templates/general.templ:107 +#: src/templates/general.j2:107 msgid "Similarity of structures" msgstr "Схожесть структур" -#: src/templates/general.templ:113 +#: src/templates/general.j2:113 msgid "Similar parts of the second program relative to the first" msgstr "Схожие части второй программы относительно первой" -#: src/templates/general.templ:115 src/templates/general.templ:149 +#: src/templates/general.j2:115 src/templates/general.j2:149 msgid "Part of the first program" msgstr "Часть первой программ" -#: src/templates/general.templ:116 src/templates/general.templ:148 +#: src/templates/general.j2:116 src/templates/general.j2:148 msgid "Part of the second program" msgstr "Часть второй программы" -#: src/templates/general.templ:117 src/templates/general.templ:150 -#: src/templates/sources.templ:88 +#: src/templates/general.j2:117 src/templates/general.j2:150 +#: src/templates/sources.j2:88 msgid "Similarity" msgstr "Схожесть" -#: src/templates/general.templ:146 +#: src/templates/general.j2:146 msgid "Similar parts of the first program relative to the second" msgstr "Схожие части первой программы относительно второй" -#: src/templates/sources.templ:42 +#: src/templates/sources.j2:42 msgid "Verification results" msgstr "Результаты проверки" -#: src/templates/sources.templ:67 +#: src/templates/sources.j2:67 msgid "The path to the file being checked" msgstr "Путь до проверяемого файла" -#: src/templates/sources.templ:68 +#: src/templates/sources.j2:68 msgid "Total maximum compliance, %" msgstr "Суммарное максимальное соответствие, %" -#: src/templates/sources.templ:83 +#: src/templates/sources.j2:83 msgid "Similar parts of the programs" msgstr "Схожие части программ" -#: src/templates/sources.templ:85 +#: src/templates/sources.j2:85 msgid "The name of a similar file" msgstr "Имя схожего файла" -#: src/templates/sources.templ:86 +#: src/templates/sources.j2:86 msgid "Part of the file that is being checked" msgstr "Часть проверяемого файла" -#: src/templates/sources.templ:87 +#: src/templates/sources.j2:87 msgid "Part of a similar file" msgstr "Часть схожего файла" diff --git a/pyproject.toml b/pyproject.toml index 55a2d75b..935f70f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "codeplag" -version = "0.6.2" +version = "0.6.3" description = "Code plagiarism searching package." authors = [ { name = "Artyom Semidolin, Dmitry Nikolaev, Alexander Evsikov" } diff --git a/src/codeplag/consts.tmp.py b/src/codeplag/consts.tmp.py index 0bea6e47..c30078a6 100644 --- a/src/codeplag/consts.tmp.py +++ b/src/codeplag/consts.tmp.py @@ -23,8 +23,8 @@ CONFIG_PATH: Final[Path] = Path("@CONFIG_PATH@") LOG_PATH: Final[Path] = Path("@CODEPLAG_LOG_PATH@") LIB_PATH: Final[Path] = Path("@LIB_PATH@") -GENERAL_TEMPLATE_PATH: Final[Path] = LIB_PATH / "general.templ" -SOURCES_TEMPLATE_PATH: Final[Path] = LIB_PATH / "sources.templ" +GENERAL_TEMPLATE_PATH: Final[Path] = LIB_PATH / "general.j2" +SOURCES_TEMPLATE_PATH: Final[Path] = LIB_PATH / "sources.j2" TRANSLATIONS_PATH: Final[Path] = LIB_PATH / "translations" # ===== diff --git a/src/templates/general.templ b/src/templates/general.j2 similarity index 100% rename from src/templates/general.templ rename to src/templates/general.j2 diff --git a/src/templates/sources.templ b/src/templates/sources.j2 similarity index 100% rename from src/templates/sources.templ rename to src/templates/sources.j2