From 72477b49d7b7077eb78a836b0e4b01ced2339c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 15 Apr 2023 11:09:59 +0200 Subject: [PATCH] api: add optional argument with version in info "version_number" --- ChangeLog.adoc | 1 + po/cs.po | 6 +++++- po/de.po | 6 +++++- po/es.po | 6 +++++- po/fr.po | 10 ++++++++-- po/hu.po | 6 +++++- po/it.po | 6 +++++- po/ja.po | 6 +++++- po/pl.po | 6 +++++- po/pt.po | 6 +++++- po/pt_BR.po | 6 +++++- po/ru.po | 6 +++++- po/sr.po | 6 +++++- po/tr.po | 6 +++++- po/weechat.pot | 6 +++++- src/plugins/plugin-api-info.c | 10 +++++++--- 16 files changed, 81 insertions(+), 18 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index ab14f281a..57f8b4b9d 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -35,6 +35,7 @@ New features:: * core, plugins: make many identifiers case sensitive (issue #1872, issue #398, bug #32213) * core: add item "mouse_status" in default status bar, change default color to lightgreen * api: add function config_set_version (issue #1238) + * api: add optional argument with version in info "version_number" * alias: use lower case for default aliases, rename all aliases to lower case on upgrade (issue #1872) * irc: rename "ssl" options to "tls", connect with TLS and port 6697 by default * irc: add command `/rules` (issue #1864) diff --git a/po/cs.po b/po/cs.po index ccef36f43..52e9a1623 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -10989,6 +10989,10 @@ msgstr "verze WeeChat" msgid "WeeChat version (as number)" msgstr "verze WeeChat (jako číslo)" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/po/de.po b/po/de.po index 074e8ca8e..cda396aef 100644 --- a/po/de.po +++ b/po/de.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" "PO-Revision-Date: 2023-04-13 20:09+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German - Germany \n" @@ -13341,6 +13341,10 @@ msgstr "WeeChat-Version" msgid "WeeChat version (as number)" msgstr "WeeChat-Version (als Zahl)" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/po/es.po b/po/es.po index c2e8b7e27..8385ce916 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -11723,6 +11723,10 @@ msgstr "versión de WeeChat" msgid "WeeChat version (as number)" msgstr "versión de WeeChat (como un número)" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/po/fr.po b/po/fr.po index a767904f6..afbc2d3ea 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" -"PO-Revision-Date: 2023-04-13 20:08+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" +"PO-Revision-Date: 2023-04-15 11:04+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -13074,6 +13074,12 @@ msgstr "version de WeeChat" msgid "WeeChat version (as number)" msgstr "version de WeeChat (sous forme de nombre)" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" +"version (optionnelle, par défaut la version du WeeChat en cours d'exécution " +"est retournée)" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/po/hu.po b/po/hu.po index 98f12dbb0..38343a63d 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -10390,6 +10390,10 @@ msgstr "WeeChat szlogen" msgid "WeeChat version (as number)" msgstr "WeeChat szlogen" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/po/it.po b/po/it.po index 212598ed6..ba8c0ce10 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -11443,6 +11443,10 @@ msgstr "versione di WeeChat" msgid "WeeChat version (as number)" msgstr "versione di WeeChat (come numero)" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/po/ja.po b/po/ja.po index 169896184..e6e574b71 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: Polish \n" @@ -13589,6 +13589,10 @@ msgstr "Wersja WeeChat" msgid "WeeChat version (as number)" msgstr "Wersja WeeChat (jako liczba)" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/po/pt.po b/po/pt.po index 9f4cc3ca4..86662ca71 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -12403,6 +12403,10 @@ msgstr "versão do WeeChat" msgid "WeeChat version (as number)" msgstr "versão do WeeChat (forma numérica)" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/po/pt_BR.po b/po/pt_BR.po index d6e0279c8..8282a5834 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -10930,6 +10930,10 @@ msgstr "versão do WeeChat" msgid "WeeChat version (as number)" msgstr "versão do WeeChat (como um número)" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/po/ru.po b/po/ru.po index ebfff8560..1888a4a00 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -10428,6 +10428,10 @@ msgstr "слоган WeeChat" msgid "WeeChat version (as number)" msgstr "слоган WeeChat" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/po/sr.po b/po/sr.po index 42905b503..991f89d7d 100644 --- a/po/sr.po +++ b/po/sr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" "PO-Revision-Date: 2023-04-13 20:10+0200\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -13279,6 +13279,10 @@ msgstr "верзија програма WeeChat" msgid "WeeChat version (as number)" msgstr "верзија програма WeeChat (као број)" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/po/tr.po b/po/tr.po index a58360f21..4114ab9ac 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -13541,6 +13541,10 @@ msgstr "WeeChat sürümü" msgid "WeeChat version (as number)" msgstr "WeeChat sürümü (sayı olarak)" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/po/weechat.pot b/po/weechat.pot index e0bb5b81d..508169df3 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-13 13:49+0200\n" +"POT-Creation-Date: 2023-04-15 11:04+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -9390,6 +9390,10 @@ msgstr "" msgid "WeeChat version (as number)" msgstr "" +msgid "" +"version (optional, by default the version of the running WeeChat is returned)" +msgstr "" + msgid "" "WeeChat git version (output of command \"git describe\" for a development " "version only, empty for a stable release)" diff --git a/src/plugins/plugin-api-info.c b/src/plugins/plugin-api-info.c index ec7bfdb41..a476a015e 100644 --- a/src/plugins/plugin-api-info.c +++ b/src/plugins/plugin-api-info.c @@ -96,8 +96,10 @@ plugin_api_info_version_number_cb (const void *pointer, void *data, (void) info_name; (void) arguments; - snprintf (version_number, sizeof (version_number), "%d", - util_version_number (version_get_version ())); + snprintf ( + version_number, sizeof (version_number), "%d", + util_version_number ( + (arguments && arguments[0]) ? arguments : version_get_version ())); return strdup (version_number); } @@ -1880,7 +1882,9 @@ plugin_api_info_init () NULL, &plugin_api_info_version_cb, NULL, NULL); hook_info (NULL, "version_number", N_("WeeChat version (as number)"), - NULL, &plugin_api_info_version_number_cb, NULL, NULL); + N_("version (optional, by default the version of the running " + "WeeChat is returned)"), + &plugin_api_info_version_number_cb, NULL, NULL); hook_info (NULL, "version_git", N_("WeeChat git version (output of command \"git describe\" " "for a development version only, empty for a stable "