diff --git a/ChangeLog.adoc b/ChangeLog.adoc index dada09d62..64d1baddd 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -15,6 +15,7 @@ For a list of important changes that require manual actions, please look at rele New features:: + * core: store microseconds in buffer lines (issue #649) * core: evaluate expressions even when the suffix is missing ("}" by default) (issue #2042, issue #1714) * core: add syntax highlighting in evaluation of expressions with `raw_hl:string` and `hl:string`, add option weechat.color.eval_syntax_colors (issue #2042) * core: add option `search_history` in command `/input`, add key kbd:[Ctrl+r] to search in commands history, add key context "histsearch" (issue #2040) @@ -26,6 +27,8 @@ New features:: * core: display only version with command `/version`, add options `-o` and `-ol` in command `/upgrade` * core: add number of processes in command `/sys waitpid` * core, alias, trigger: allow wildcard in commands `/bar`, `/item`, `/proxy`, `/alias` and `/trigger` (issue #1956) + * api: add functions util_strftimeval, printf_datetime_tags, printf_y_datetime_tags (issue #649) + * api: add argument "date_usec" in hook_print callback (issue #649) * api: add property "type" in function buffer_get_string * api: add info "mouse" * buflist: jump to previous/next buffer displayed in buflist item with ctrl+wheel up/down on a buflist item (issue #1473) @@ -37,6 +40,7 @@ New features:: * irc: add tags "nick_xxx" and "host_xxx" in all messages, including self and server messages * irc: add option irc.look.ignore_tag_messages (issue #989) * relay: change default value of option relay.network.tls_priorities to `NORMAL` + * trigger: change format of variables `${tg_date}` from "%Y-%m-%d %H:%M:%S" to "%FT%T.%f" (issue #649) * trigger: rename local variable "trigger_filter" to "filter" on monitor buffer (issue #2037) Bug fixes:: diff --git a/ReleaseNotes.adoc b/ReleaseNotes.adoc index 74bf912db..2cfefd5d7 100644 --- a/ReleaseNotes.adoc +++ b/ReleaseNotes.adoc @@ -14,6 +14,20 @@ For a complete list of changes, please look at ChangeLog. [[v4.2.0]] == Version 4.2.0 (under dev) +[[v4.2.0_lines_microseconds]] +=== Microseconds in buffer lines + +Microseconds have been added in buffer lines (for both date and printed date). + +Here are the changes that could affect plugins and scripts: + +* hook_print: the C callback receives a new argument "date_usec" (microseconds + of date), after the argument "date" (scripting API is unchanged: the + microseconds are not available) +* trigger of types "print" and "timer": the format of variable `${tg_date}` is + changed from `%Y-%m-%d %H:%M:%S` to `%FT%T.%f` (where `%f` is the number of + microseconds on 6 digits) + [[v4.2.0_irc_anti_flood]] === IRC anti-flood diff --git a/doc/de/weechat_scripting.de.adoc b/doc/de/weechat_scripting.de.adoc index f25dadd7a..2b7fe85a3 100644 --- a/doc/de/weechat_scripting.de.adoc +++ b/doc/de/weechat_scripting.de.adoc @@ -664,8 +664,10 @@ Liste der Skript API Funktionen: color + print (für Python: prnt) + print_date_tags (für Python: prnt_date_tags) + + print_datetime_tags (für Python: prnt_datetime_tags) + print_y (für Python: prnt_y) + print_y_date_tags (für Python: prnt_y_date_tags) + + print_y_datetime_tags (für Python: prnt_y_datetime_tags) + log_print | Hooks diff --git a/doc/de/weechat_user.de.adoc b/doc/de/weechat_user.de.adoc index 15ccaee8c..8e69183bd 100644 --- a/doc/de/weechat_user.de.adoc +++ b/doc/de/weechat_user.de.adoc @@ -5284,7 +5284,7 @@ Wenn _var_ nicht angegeben ist, wird die Standardvariable verwendet, sie hängt | signal | tg_signal_data | | hsignal | | | modifier | tg_string | tg_string -| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message +| line | message | buffer, buffer_name, y, date, date_usec, date_printed, date_usec_printed, str_time, tags, notify_level, highlight, prefix, message | print | tg_message | | command | tg_argv_eol1 | | command_run | tg_command | @@ -5447,7 +5447,11 @@ Der Callback von "line" legt folgende Variablen in der Hashtable an: | buffer_type | string | Buffertyp ("formatted" oder "free"). | y | string | Zeilennummer bei einem Buffer mit freier Einteilung (≥ 0), -1 für einen Buffer mit formatiertem Inhalt. | date | string | Datum der Zeile (Zeitstempel). +// TRANSLATION MISSING +| date_usec | string | Microseconds of line date. | date_printed | string | Datum wann die Zeile dargestellt wurde (Zeitstempel). +// TRANSLATION MISSING +| date_usec_printed | string | Microseconds of date when line was displayed. | str_time | string | Datum für Darstellung. Kann Farbkodierungen erhalten. | tags | string | Tags einer Nachricht (Komma wird automatisch zu Beginn und Ende den Tags hinzugefügt). | displayed | string | "1" wenn Zeile dargestellt wird, "0" wenn Zeile gefiltert wird. @@ -5486,7 +5490,8 @@ Der Callback von "print" legt folgende Variablen in der Hashtable an: |=== | Variable | Typ | Beschreibung | buffer | pointer | Buffer. -| tg_date | string | Datum/Uhrzeit der Nachricht (Format: `YYYY-MM-DD hh:mm:ss`). +// TRANSLATION MISSING +| tg_date | string | Datum/Uhrzeit der Nachricht (Format: `%FT%T.%f`, see link:weechat_plugin_api.en.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]). | tg_displayed | string | "1" wenn Nachricht dargestellt wird, "0" falls Nachricht gefiltert wird. | tg_highlight | string | "1" falls es sich um eine Highlight-Nachricht handelt, andernfalls "0". | tg_prefix | string | Präfix. @@ -5551,7 +5556,8 @@ Der Callback von "timer" legt folgende Variablen in der Hashtable an: |=== | Variable | Typ | Beschreibung | tg_remaining_calls | string | Anzahl der noch ausstehenden Aufrufe. -| tg_date | string | aktuelles Datum und Uhrzeit (Format: `YYYY-MM-DD hh:mm:ss`). +// TRANSLATION MISSING +| tg_date | string | aktuelles Datum und Uhrzeit (Format: `%FT%T.%f`, see link:weechat_plugin_api.en.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]). |=== [[trigger_data_config]] diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index 0744a58f9..403f9b8d6 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -4696,6 +4696,47 @@ weechat_printf (NULL, "date: %s", [NOTE] This function is not available in scripting API. +==== util_strftimeval + +_WeeChat ≥ 4.2.0._ + +Format date and time like function `strftime` in C library, using `struct timeval` +as input, and supporting extra specifiers for microseconds. + +Prototype: + +[source,c] +---- +int weechat_util_strftimeval (char *string, int max, const char *format, struct timeval *tv); +---- + +Arguments: + +* _string_: buffer where the formatted string is stored +* _max_: string size +* _format_: format, the same as _strftime_ function, with these extra specifiers: +** `%.N` where `N` is between 1 and 6: zero-padded microseconds on N digits + (for example `%.3` for milliseconds) +** `%f`: alias of `%.6` + +Return value: + +* number of bytes put in _string_ (value returned from _strftime_ function) + +C example: + +[source,c] +---- +char time[256]; +struct timeval tv; +gettimeofday (&tv, NULL); +weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv); +/* result: 2023-12-26T18:10:04.460509 */ +---- + +[NOTE] +This function is not available in scripting API. + ==== util_version_number _WeeChat ≥ 0.3.9._ @@ -9270,13 +9311,13 @@ Prototype: void weechat_printf (struct t_gui_buffer *buffer, const char *message, ...); ---- -This function is a shortcut for function printf_date_tags. These two calls give -exactly same result: +This function is a shortcut for function printf_datetime_tags. + +These two calls give exactly same result: [source,c] ---- weechat_printf (buffer, "message"); -weechat_printf_date_tags (buffer, 0, NULL, "message"); +weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message"); ---- Arguments: @@ -9338,6 +9379,15 @@ void weechat_printf_date_tags (struct t_gui_buffer *buffer, time_t date, const char *tags, const char *message, ...); ---- +This function is a shortcut for function printf_datetime_tags. + +These two calls give exactly same result: + +[source,c] +---- +weechat_printf_date_tags (buffer, 0, NULL, "message"); +weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message"); +---- + Arguments: * _buffer_: buffer pointer, if NULL, message is displayed on WeeChat buffer @@ -9372,6 +9422,62 @@ weechat.prnt_date_tags("", time - 120, "notify_message", [NOTE] Function is called "print_date_tags" in scripts ("prnt_date_tags" in Python). +==== printf_datetime_tags + +_WeeChat ≥ 4.2.0._ + +Display a message on a buffer, using a custom date/time (with microseconds) +and tags. + +Prototype: + +[source,c] +---- +void weechat_printf_datetime_tags (struct t_gui_buffer *buffer, time_t date, + int date_usec, const char *tags, const char *message, ...); +---- + +Arguments: + +* _buffer_: buffer pointer, if NULL, message is displayed on WeeChat buffer +* _date_: date for message (0 means current date/time) +* _date_usec_: microseconds of date (between 0 and 999999) +* _tags_: comma separated list of tags (NULL means no tags) +* _message_: message to display + +See the link:weechat_user.en.html#lines_tags[WeeChat user's guide / Lines tags ^↗^^] +for a list of commonly used tags in WeeChat. + +C example: + +[source,c] +---- +struct timeval tv_now; + +gettimeofday (&tv_now, NULL); +weechat_printf_datetime_tags (NULL, tv_now.tv_sec - 120, tv_now.tv_usec, + "notify_message", + "Message 2 minutes ago, with a tag 'notify_message'"); +---- + +Script (Python): + +[source,python] +---- +# prototype +def prnt_datetime_tags(buffer: str, date: int, date_usec: int, tags: str, message: str) -> int: ... + +# example +now = time.time() +time_sec = int(now) +time_usec = int((now * 1000000) % 1000000) +weechat.prnt_datetime_tags("", time_sec - 120, time_usec, "notify_message", + "Message 2 minutes ago, with a tag 'notify_message'") +---- + +[NOTE] +Function is called "print_datetime_tags" in scripts ("prnt_datetime_tags" in Python). + ==== printf_y Display a message on a line of a buffer with free content. @@ -9380,8 +9486,16 @@ Prototype: [source,c] ---- -void weechat_printf_y (struct t_gui_buffer *buffer, int y, - const char *message, ...); +void weechat_printf_y (struct t_gui_buffer *buffer, int y, const char *message, ...); +---- + +This function is a shortcut for function printf_y_datetime_tags. + +These two calls give exactly same result: + +[source,c] +---- +weechat_printf_y (buffer, 0, "message"); +weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message"); ---- Arguments: @@ -9429,6 +9543,15 @@ void weechat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date const char *tags, const char *message, ...); ---- +This function is a shortcut for function printf_y_datetime_tags. + +These two calls give exactly same result: + +[source,c] +---- +weechat_printf_y_date_tags (buffer, 0, 0, NULL, "message"); +weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message"); +---- + Arguments: * _buffer_: buffer pointer @@ -9460,6 +9583,53 @@ weechat.prnt_y_date_tags("", 2, 0, "my_tag", "My message on third line with a ta [NOTE] Function is called "print_y_date_tags" in scripts ("prnt_y_date_tags" in Python). +==== printf_y_datetime_tags + +_WeeChat ≥ 4.2.0._ + +Display a message on a line of a buffer with free content, using a custom +date/time (with microseconds) and tags. + +Prototype: + +[source,c] +---- +void weechat_printf_y_datetime_tags (struct t_gui_buffer *buffer, int y, time_t date, + int date_usec, const char *tags, const char *message, ...); +---- + +Arguments: + +* _buffer_: buffer pointer +* _y_: line number (first line is 0); a negative value adds a line after last + line displayed: absolute value of _y_ is the number of lines after last line + (for example -1 is immediately after last line, -2 is 2 lines after last line) +* _date_: date for message (0 means current date/time) +* _date_usec_: microseconds of date (between 0 and 999999) +* _tags_: comma separated list of tags (NULL means no tags) +* _message_: message to display + +C example: + +[source,c] +---- +weechat_printf_y_datetime_tags (buffer, 2, 0, 0, "my_tag", "My message on third line with a tag"); +---- + +Script (Python): + +[source,python] +---- +# prototype +def prnt_y_datetime_tags(buffer: str, y: int, date: int, date_usec: int, tags: str, message: str) -> int: ... + +# example +weechat.prnt_y_datetime_tags("", 2, 0, 0, "my_tag", "My message on third line with a tag") +---- + +[NOTE] +Function is called "print_y_datetime_tags" in scripts ("prnt_y_datetime_tags" in Python). + ==== log_printf Write a message in WeeChat log file (weechat.log). @@ -10823,7 +10993,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "", ==== hook_line -_WeeChat ≥ 2.3, updated in 3.7._ +_WeeChat ≥ 2.3, updated in 4.2.0._ Hook a line to be printed in a buffer. @@ -10922,11 +11092,21 @@ Line data sent to the callback is a hashtable, with following values | N/A ("0"). | `+1533792000+` +| date_usec +| Microseconds of line date (between 0 and 999999). +| N/A ("0"). +| `+123456+` + | date_printed | Date when line was displayed (timestamp). | N/A ("0"). | `+1533792012+` +| date_usec_printed +| Microseconds of date when line was displayed (between 0 and 999999). +| N/A ("0"). +| `+654321+` + | str_time | Date for display (possible color codes inside). | N/A (empty string). @@ -11013,11 +11193,22 @@ in this hashtable): | The date is set to this value. + The value of `+str_time+` is updated accordingly. +| date_usec +| Integer ("0" to "999999"). +| N/A. +| The microseconds of line date is set to this value. + + The value of `+str_time+` is updated accordingly. + | date_printed | Timestamp. | N/A. | The printed date is set to this timestamp (not displayed). +| date_usec_printed +| Integer ("0" to "999999"). +| N/A. +| The microseconds of printed date is set to this value. + | str_time | String. | N/A. @@ -11098,7 +11289,7 @@ hook = weechat.hook_line("", "", "irc_join", "my_line_cb", "") ==== hook_print -_Updated in 0.4.3, 1.0, 1.5._ +_Updated in 0.4.3, 1.0, 1.5, 4.2.0._ Hook a message printed. It is called when a line has been added in a buffer with formatted content. @@ -11118,6 +11309,7 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer, void *data, struct t_gui_buffer *buffer, time_t date, + int date_usec, int tags_count, const char **tags, int displayed, @@ -11147,6 +11339,7 @@ Arguments: ** _void *data_: pointer ** _struct t_gui_buffer *buffer_: buffer pointer ** _time_t date_: date +** _int date_usec_: microseconds of date ** _int tags_count_: number of tags for line ** _const char **tags_: array with tags for line ** _int displayed_: 1 if line is displayed, 0 if it is filtered (hidden) @@ -11177,7 +11370,7 @@ C example: ---- int my_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer, - time_t date, int tags_count, const char **tags, + time_t date, int date_usec, int tags_count, const char **tags, int displayed, int highlight, const char *prefix, const char *message) { @@ -13292,9 +13485,15 @@ Content of hashtable sent to callback (keys and values are of type "string"): | _chat_line_date | Line date/time. | "1313237175" | "0" +| _chat_line_date_usec | Microseconds of line date/time. +| "123456" | "0" + | _chat_line_date_printed | Line date/time ^(4)^. | "1313237175" | "0" +| _chat_line_date_usec_printed | Microseconds of line printed date/time ^(4)^. +| "123456" | "0" + | _chat_line_time | Time displayed. | "14:06:15" | "" diff --git a/doc/en/weechat_relay_protocol.en.adoc b/doc/en/weechat_relay_protocol.en.adoc index 864953760..4a85c5517 100644 --- a/doc/en/weechat_relay_protocol.en.adoc +++ b/doc/en/weechat_relay_protocol.en.adoc @@ -488,7 +488,9 @@ hda: 'buffer': 'ptr', 'y': 'int', 'date': 'tim', + 'date_usec': 'int', 'date_printed': 'tim', + 'date_usec_printed': 'int', 'str_time': 'str', 'tags_count': 'int', 'tags_array': 'arr', @@ -506,7 +508,9 @@ hda: buffer: '0x558d61ea3e60' y: -1 date: 1588404926 + date_usec: 118712 date_printed: 1588404926 + date_usec_printed: 118712 str_time: 'F@0025209F@0024535F@0024026' tags_count: 0 tags_array: [] @@ -522,7 +526,9 @@ hda: buffer: '0x558d61ea3e60' y: -1 date: 1588404930 + date_usec: 25 date_printed: 1588404930 + date_usec_printed: 25 str_time: 'F@0025209F@0024535F@0024030' tags_count: 0 tags_array: [] @@ -2050,16 +2056,18 @@ Data sent as hdata: [width="100%",cols="3m,2,10",options="header"] |=== -| Name | Type | Description -| buffer | pointer | Buffer pointer. -| date | time | Date of message. -| date_printed | time | Date when WeeChat displayed message. -| displayed | char | 1 if message is displayed, 0 if message is filtered (hidden). -| notify_level | char | Notify level: -1 = notify disabled, 0 = low, 1 = message, 2 = private, 3 = highlight. -| highlight | char | 1 if line has a highlight, otherwise 0. -| tags_array | array of strings | List of tags for line. -| prefix | string | Prefix. -| message | string | Message. +| Name | Type | Description +| buffer | pointer | Buffer pointer. +| date | time | Date of message. +| date_usec | integer | Microseconds of date. +| date_printed | time | Date when WeeChat displayed message. +| date_usec_printed | integer | Microseconds of date when WeeChat displayed message. +| displayed | char | 1 if message is displayed, 0 if message is filtered (hidden). +| notify_level | char | Notify level: -1 = notify disabled, 0 = low, 1 = message, 2 = private, 3 = highlight. +| highlight | char | 1 if line has a highlight, otherwise 0. +| tags_array | array of strings | List of tags for line. +| prefix | string | Prefix. +| message | string | Message. |=== Example: new message _hello!_ from nick _FlashCode_ on buffer _irc.libera.#weechat_: @@ -2071,7 +2079,9 @@ hda: keys: { 'buffer': 'ptr', 'date': 'tim', + 'date_usec': 'int', 'date_printed': 'tim', + 'date_usec_printed': 'int', 'displayed': 'chr', 'notify_level': 'chr', 'highlight': 'chr', @@ -2084,7 +2094,9 @@ hda: __path: ['0x4a49600'] buffer: '0x4a715d0' date: 1362728993 + date_usec: 902765 date_printed: 1362728993 + date_usec_printed: 902765 displayed: 1 notify_level: 1 highlight: 0 diff --git a/doc/en/weechat_scripting.en.adoc b/doc/en/weechat_scripting.en.adoc index 824cb4dd0..b26da4780 100644 --- a/doc/en/weechat_scripting.en.adoc +++ b/doc/en/weechat_scripting.en.adoc @@ -649,8 +649,10 @@ List of functions in script API: color + print (for python: prnt) + print_date_tags (for python: prnt_date_tags) + + print_datetime_tags (for python: prnt_datetime_tags) + print_y (for python: prnt_y) + print_y_date_tags (for python: prnt_y_date_tags) + + print_y_datetime_tags (for python: prnt_y_datetime_tags) + log_print | hooks diff --git a/doc/en/weechat_user.en.adoc b/doc/en/weechat_user.en.adoc index a7b65d710..63aa02fb5 100644 --- a/doc/en/weechat_user.en.adoc +++ b/doc/en/weechat_user.en.adoc @@ -5178,7 +5178,7 @@ type: | signal | tg_signal_data | | hsignal | | | modifier | tg_string | tg_string -| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message +| line | message | buffer, buffer_name, y, date, date_usec, date_printed, date_usec_printed, str_time, tags, notify_level, highlight, prefix, message | print | tg_message | | command | tg_argv_eol1 | | command_run | tg_command | @@ -5337,7 +5337,9 @@ The "line" callback sets following variables in hashtable: | buffer_type | string | Buffer type ("formatted" or "free"). | y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content. | date | string | Line date (timestamp). +| date_usec | string | Microseconds of line date. | date_printed | string | Date when line was displayed (timestamp). +| date_usec_printed | string | Microseconds of date when line was displayed. | str_time | string | Date for display. It may contain color codes. | tags | string | Tags of message (with comma added at beginning/end of string). | displayed | string | "1" if displayed, "0" if line filtered. @@ -5376,7 +5378,7 @@ The "print" callback sets following variables in hashtable: |=== | Variable | Type | Description | buffer | pointer | Buffer. -| tg_date | string | Message date/time (format: `YYYY-MM-DD hh:mm:ss`). +| tg_date | string | Message date/time (format: `%FT%T.%f`, see link:weechat_plugin_api.en.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]). | tg_displayed | string | "1" if displayed, "0" if line filtered. | tg_highlight | string | "1" if highlight, otherwise "0". | tg_prefix | string | Prefix. @@ -5441,7 +5443,7 @@ The "timer" callback sets following variables in hashtable: |=== | Variable | Type | Description | tg_remaining_calls | string | Number of remaining calls. -| tg_date | string | Current date/time (format: `YYYY-MM-DD hh:mm:ss`). +| tg_date | string | Current date/time (format: `%FT%T.%f`, see link:weechat_plugin_api.en.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]). |=== [[trigger_data_config]] diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc index 1b6165551..83553bef1 100644 --- a/doc/fr/weechat_plugin_api.fr.adoc +++ b/doc/fr/weechat_plugin_api.fr.adoc @@ -4775,6 +4775,49 @@ weechat_printf (NULL, "date : %s", [NOTE] Cette fonction n'est pas disponible dans l'API script. +==== util_strftimeval + +_WeeChat ≥ 4.2.0._ + +Formatter la date et l'heure comme la fonction `strftime` de la bibliothèque C, +en utilisant un `struct timeval` en entrée et en supportant des caractères de +conversion pour les microsecondes. + +Prototype : + +[source,c] +---- +int weechat_util_strftimeval (char *string, int max, const char *format, struct timeval *tv); +---- + +Paramètres : + +* _string_ : tampon où stocker la chaîne formattée +* _max_ : taille de la chaîne +* _format_ : format, le même que celui de la fonction _strftime_, avec des + caractères de conversion supplémentaires : +** `%.N` où `N` est entre 1 and 6: microsecondes remplies avec des zéros sur + N chiffres (par exemple `%.3` pour les millisecondes) +** `%f` : alias de `%.6` + +Valeur de retour : + +* nombre d'octets placés dans _string_ (valeur retournée par la fonction _strftime_). + +Exemple en C : + +[source,c] +---- +char time[256]; +struct timeval tv; +gettimeofday (&tv, NULL); +weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv); +/* résultat : 2023-12-26T18:10:04.460509 */ +---- + +[NOTE] +Cette fonction n'est pas disponible dans l'API script. + ==== util_version_number _WeeChat ≥ 0.3.9._ @@ -9419,13 +9462,13 @@ Prototype : void weechat_printf (struct t_gui_buffer *buffer, const char *message, ...); ---- -Cette fonction est un raccourci vers la fonction printf_date_tags. Ces deux appels -donnent exactement le même résultat : +Cette fonction est un raccourci vers la fonction printf_datetime_tags. + +Ces deux appels donnent exactement le même résultat : [source,c] ---- weechat_printf (buffer, "message"); -weechat_printf_date_tags (buffer, 0, NULL, "message"); +weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message"); ---- Paramètres : @@ -9490,6 +9533,15 @@ void weechat_printf_date_tags (struct t_gui_buffer *buffer, time_t date, const char *tags, const char *message, ...); ---- +Cette fonction est un raccourci vers la fonction printf_datetime_tags. + +Ces deux appels donnent exactement le même résultat : + +[source,c] +---- +weechat_printf_date_tags (buffer, 0, NULL, "message"); +weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message"); +---- + Paramètres : * _buffer_ : pointeur vers le tampon, si NULL, le message est affiché sur le @@ -9527,6 +9579,65 @@ weechat.prnt_date_tags("", time - 120, "notify_message", La fonction s'appelle "print_date_tags" dans les scripts ("prnt_date_tags" en Python). +==== printf_datetime_tags + +_WeeChat ≥ 4.2.0._ + +Afficher un message sur un tampon, en utilisant une date/heure (avec microsecondes) +et des étiquettes personnalisées. + +Prototype : + +[source,c] +---- +void weechat_printf_datetime_tags (struct t_gui_buffer *buffer, time_t date, + int date_usec, const char *tags, const char *message, ...); +---- + +Paramètres : + +* _buffer_ : pointeur vers le tampon, si NULL, le message est affiché sur le + tampon WeeChat +* _date_ : date pour le message (0 signifie la date/heure courante) +* _date_usec_ : microsecondes de la date (entre 0 et 999999) +* _tags_ : liste d'étiquettes séparées par des virgules (NULL signifie aucune + étiquette) +* _message_ : message à afficher + +Voir le link:weechat_user.fr.html#lines_tags[Guide utilisateur WeeChat / Étiquettes des lignes ^↗^^] +pour une liste des étiquettes couramment utilisées dans WeeChat. + +Exemple en C : + +[source,c] +---- +struct timeval tv_now; + +gettimeofday (&tv_now, NULL); +weechat_printf_datetime_tags (NULL, tv_now.tv_sec - 120, tv_now.tv_usec, + "notify_message", + "Message il y a 2 minutes avec une étiquette 'notify_message'"); +---- + +Script (Python) : + +[source,python] +---- +# prototype +def prnt_datetime_tags(buffer: str, date: int, date_usec: int, tags: str, message: str) -> int: ... + +# exemple +now = time.time() +time_sec = int(now) +time_usec = int((now * 1000000) % 1000000) +weechat.prnt_datetime_tags("", time_sec - 120, time_usec, "notify_message", + "Message il y a 2 minutes avec une étiquette 'notify_message'") +---- + +[NOTE] +La fonction s'appelle "print_datetime_tags" dans les scripts ("prnt_datetime_tags" +en Python). + ==== printf_y Afficher un message sur une ligne d'un tampon avec contenu libre. @@ -9535,8 +9646,16 @@ Prototype : [source,c] ---- -void weechat_printf_y (struct t_gui_buffer *buffer, int y, - const char *message, ...); +void weechat_printf_y (struct t_gui_buffer *buffer, int y, const char *message, ...); +---- + +Cette fonction est un raccourci vers la fonction printf_y_datetime_tags. + +Ces deux appels donnent exactement le même résultat : + +[source,c] +---- +weechat_printf_y (buffer, 0, "message"); +weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message"); ---- Paramètres : @@ -9585,6 +9704,15 @@ void weechat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date const char *tags, const char *message, ...); ---- +Cette fonction est un raccourci vers la fonction printf_y_datetime_tags. + +Ces deux appels donnent exactement le même résultat : + +[source,c] +---- +weechat_printf_y_date_tags (buffer, 0, 0, NULL, "message"); +weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message"); +---- + Paramètres : * _buffer_ : pointeur vers le tampon @@ -9619,6 +9747,56 @@ weechat.prnt_y_date_tags("", 2, 0, "mon_etiquette", "Mon message sur la 3ème li La fonction s'appelle "print_y_date_tags" dans les scripts ("prnt_y_date_tags" en Python). +==== printf_y_datetime_tags + +_WeeChat ≥ 4.2.0._ + +Afficher un message sur une ligne d'un tampon avec contenu libre, en utilisant +une date/heure (avec microsecondes) et des étiquettes personnalisées. + +Prototype : + +[source,c] +---- +void weechat_printf_y_datetime_tags (struct t_gui_buffer *buffer, int y, time_t date, + int date_usec, const char *tags, const char *message, ...); +---- + +Paramètres : + +* _buffer_ : pointeur vers le tampon +* _y_ : numéro de ligne (la première ligne est 0); une valeur négative affiche + une ligne après la dernière ligne affichée : la valeur absolue de _y_ est le + nombre de lignes après la dernière ligne (par exemple -1 est immédiatement + après la dernière ligne, -2 est 2 lignes après la dernière ligne) +* _date_ : date pour le message (0 signifie la date/heure courante) +* _date_usec_ : microsecondes de la date (entre 0 et 999999) +* _tags_ : liste d'étiquettes séparées par des virgules (NULL signifie aucune + étiquette) +* _message_ : message à afficher + +Exemple en C : + +[source,c] +---- +weechat_printf_y_datetime_tags (buffer, 2, 0, 0, "mon_etiquette", "Mon message sur la 3ème ligne avec une étiquette"); +---- + +Script (Python) : + +[source,python] +---- +# prototype +def prnt_y_datetime_tags(buffer: str, y: int, date: int, date_usec: int, tags: str, message: str) -> int: ... + +# exemple +weechat.prnt_y_datetime_tags("", 2, 0, 0, "mon_etiquette", "Mon message sur la 3ème ligne avec une étiquette") +---- + +[NOTE] +La fonction s'appelle "print_y_datetime_tags" dans les scripts +("prnt_y_datetime_tags" en Python). + ==== log_printf Écrire un message dans le fichier de log WeeChat (weechat.log). @@ -11033,7 +11211,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "", ==== hook_line -_WeeChat ≥ 2.3, mis à jour dans la 3.7._ +_WeeChat ≥ 2.3, mis à jour dans la 4.2.0._ Intercepter une ligne sur le point d'être affichée dans un tampon. @@ -11139,11 +11317,21 @@ de hachage, avec les valeurs suivantes (les clés et valeurs sont des chaînes) | N/A ("0"). | `+1533792000+` +| date_usec +| Microsecondes de la date de la ligne (entre 0 et 999999). +| N/A ("0"). +| `+123456+` + | date_printed | Date d'affichage de la ligne (horodatage). | N/A ("0"). | `+1533792012+` +| date_usec_printed +| Microsecondes de la date d'affichage de la ligne (entre 0 et 999999). +| N/A ("0"). +| `+654321+` + | str_time | Date pour l'affichage (elle peut contenir des codes couleur). | N/A (chaîne vide). @@ -11232,11 +11420,22 @@ valeurs sont des chaînes dans cette table de hachage) : | La date est positionnée à cet horodatage. + La valeur de `+str_time+` est mise à jour en conséquence. +| date_usec +| Entier ("0" à "999999"). +| N/A. +| Les microsecondes de la date sont positionnées à cette valeur. + + La valeur de `+str_time+` est mise à jour en conséquence. + | date_printed | Horodatage. | N/A. | La date d'affichage est positionnée à cet horodatage (non affichée). +| date_usec_printed +| Entier ("0" à "999999"). +| N/A. +| Les microsecondes de la date d'affichage sont positionnées à cette valeur. + | str_time | Chaîne. | N/A. @@ -11320,7 +11519,7 @@ hook = weechat.hook_line("", "", "irc_join", "my_line_cb", "") ==== hook_print -_Mis à jour dans la 0.4.3, 1.0, 1.5._ +_Mis à jour dans la 0.4.3, 1.0, 1.5, 4.2.0._ Intercepter un message affiché. Il est appelée quand une ligne a été ajoutée dans un tampon avec contenu formaté. @@ -11340,6 +11539,7 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer, void *data, struct t_gui_buffer *buffer, time_t date, + int date_usec, int tags_count, const char **tags, int displayed, @@ -11371,6 +11571,7 @@ Paramètres : ** _void *data_ : pointeur ** _struct t_gui_buffer *buffer_ : pointeur vers le tampon ** _time_t date_ : date +** _int date_usec_ : microsecondes de la date ** _int tags_count_ : nombre d'étiquettes de la ligne ** _const char **tags_ : tableau avec les étiquettes de la ligne ** _int displayed_ : 1 si la ligne est affichée, 0 si elle est filtrée (cachée) @@ -11405,7 +11606,7 @@ Exemple en C : ---- int my_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer, - time_t date, int tags_count, const char **tags, + time_t date, int date_usec, int tags_count, const char **tags, int displayed, int highlight, const char *prefix, const char *message) { @@ -13594,9 +13795,15 @@ valeurs sont de type "string") : | _chat_line_date | Date/heure de la ligne. | "1313237175" | "0" +| _chat_line_date_usec | Microsecondes de la date/heure de la ligne. +| "123456" | "0" + | _chat_line_date_printed | Date/heure de la ligne ^(4)^. | "1313237175" | "0" +| _chat_line_date_usec_printed | Microsecondes de la date/heure de la ligne ^(4)^. +| "123456" | "0" + | _chat_line_time | Heure affichée. | "14:06:15" | "" diff --git a/doc/fr/weechat_relay_protocol.fr.adoc b/doc/fr/weechat_relay_protocol.fr.adoc index a1d7e0faf..208bac06c 100644 --- a/doc/fr/weechat_relay_protocol.fr.adoc +++ b/doc/fr/weechat_relay_protocol.fr.adoc @@ -503,7 +503,9 @@ hda: 'buffer': 'ptr', 'y': 'int', 'date': 'tim', + 'date_usec': 'int', 'date_printed': 'tim', + 'date_usec_printed': 'int', 'str_time': 'str', 'tags_count': 'int', 'tags_array': 'arr', @@ -521,7 +523,9 @@ hda: buffer: '0x558d61ea3e60' y: -1 date: 1588404926 + date_usec: 118712 date_printed: 1588404926 + date_usec_printed: 118712 str_time: 'F@0025209F@0024535F@0024026' tags_count: 0 tags_array: [] @@ -537,7 +541,9 @@ hda: buffer: '0x558d61ea3e60' y: -1 date: 1588404930 + date_usec: 25 date_printed: 1588404930 + date_usec_printed: 25 str_time: 'F@0025209F@0024535F@0024030' tags_count: 0 tags_array: [] @@ -2078,16 +2084,18 @@ Données envoyées dans le hdata : [width="100%",cols="3m,2,10",options="header"] |=== -| Nom | Type | Description -| buffer | pointeur | Pointeur vers le tampon. -| date | date/heure | Date du message. -| date_printed | date/heure | Date d'affichage du message. -| displayed | caractère | 1 si le message est affiché, 0 si le message est filtré (caché). -| notify_level | caractère | Niveau de notification : -1 = notification désactivée, 0 = bas, 1 = message, 2 = privé, 3 = highlight. -| highlight | caractère | 1 si la ligne a un highlight, sinon 0. -| tags_array | tableau de chaînes | Liste des étiquettes de la ligne. -| prefix | chaîne | Préfixe. -| message | chaîne | Message. +| Nom | Type | Description +| buffer | pointeur | Pointeur vers le tampon. +| date | date/heure | Date du message. +| date_usec | entier | Microsecondes de la date. +| date_printed | date/heure | Date d'affichage du message. +| date_usec_printed | entier | Microsecondes de la date d'affichage du message. +| displayed | caractère | 1 si le message est affiché, 0 si le message est filtré (caché). +| notify_level | caractère | Niveau de notification : -1 = notification désactivée, 0 = bas, 1 = message, 2 = privé, 3 = highlight. +| highlight | caractère | 1 si la ligne a un highlight, sinon 0. +| tags_array | tableau de chaînes | Liste des étiquettes de la ligne. +| prefix | chaîne | Préfixe. +| message | chaîne | Message. |=== Exemple : nouveau message _hello!_ du pseudo _FlashCode_ sur le tampon @@ -2100,7 +2108,9 @@ hda: keys: { 'buffer': 'ptr', 'date': 'tim', + 'date_usec': 'int', 'date_printed': 'tim', + 'date_usec_printed': 'int', 'displayed': 'chr', 'notify_level': 'chr', 'highlight': 'chr', @@ -2113,7 +2123,9 @@ hda: __path: ['0x4a49600'] buffer: '0x4a715d0' date: 1362728993 + date_usec: 902765 date_printed: 1362728993 + date_usec_printed: 902765 displayed: 1 notify_level: 1 highlight: 0 diff --git a/doc/fr/weechat_scripting.fr.adoc b/doc/fr/weechat_scripting.fr.adoc index 7157a9bad..0b5f6dae3 100644 --- a/doc/fr/weechat_scripting.fr.adoc +++ b/doc/fr/weechat_scripting.fr.adoc @@ -670,8 +670,10 @@ Liste des fonctions de l'API script : color + print (pour python : prnt) + print_date_tags (pour python : prnt_date_tags) + + print_datetime_tags (pour python : prnt_datetime_tags) + print_y (pour python : prnt_y) + print_y_date_tags (pour python : prnt_y_date_tags) + + print_y_datetime_tags (pour python : prnt_y_datetime_tags) + log_print | hooks diff --git a/doc/fr/weechat_user.fr.adoc b/doc/fr/weechat_user.fr.adoc index e6d4c83d8..70b83427b 100644 --- a/doc/fr/weechat_user.fr.adoc +++ b/doc/fr/weechat_user.fr.adoc @@ -5334,7 +5334,7 @@ du type de hook : | signal | tg_signal_data | | hsignal | | | modifier | tg_string | tg_string -| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message +| line | message | buffer, buffer_name, y, date, date_usec, date_printed, date_usec_printed, str_time, tags, notify_level, highlight, prefix, message | print | tg_message | | command | tg_argv_eol1 | | command_run | tg_command | @@ -5505,7 +5505,9 @@ de hachage : | buffer_type | chaîne | Type de tampon ("formatted" ou "free"). | y | chaîne | Numéro de ligne pour un tampon avec contenu libre (≥ 0), -1 pour un tampon avec contenu formaté. | date | chaîne | Date de la ligne (horodatage). +| date_usec | chaîne | Microsecondes de la date de la ligne. | date_printed | chaîne | Date d'affichage de la ligne (horodatage). +| date_usec_printed | chaîne | Microsecondes de la date d'affichage de la ligne. | str_time | chaîne | Date pour l'affichage. Elle peut contenir des codes couleur. | tags | chaîne | Étiquettes du message (avec une virgule en début/fin de chaîne). | displayed | chaîne | "1" si affichée, "0" si la ligne est filtrée. @@ -5546,7 +5548,7 @@ hachage : |=== | Variable | Type | Description | buffer | pointeur | Tampon. -| tg_date | chaîne | Date/heure du message (format : `YYYY-MM-DD hh:mm:ss`). +| tg_date | chaîne | Date/heure du message (format : `%FT%T.%f`, voir la link:weechat_plugin_api.fr.html#_util_strftimeval[Référence API extension WeeChat / util_strftimeval ^↗^^]). | tg_displayed | chaîne | "1" si affiché, "0" si ligne filtrée. | tg_highlight | chaîne | "1" si highlight, sinon "0". | tg_prefix | chaîne | Préfixe. @@ -5615,7 +5617,7 @@ hachage : |=== | Variable | Type | Description | tg_remaining_calls | chaîne | Nombre d'appels restants. -| tg_date | chaîne | Date/heure courante (format : `YYYY-MM-DD hh:mm:ss`). +| tg_date | chaîne | Date/heure courante (format : `%FT%T.%f`, voir la link:weechat_plugin_api.fr.html#_util_strftimeval[Référence API extension WeeChat / util_strftimeval ^↗^^]). |=== [[trigger_data_config]] diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index f6016d4b0..0646e16f2 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -4913,6 +4913,48 @@ weechat_printf (NULL, "date: %s", [NOTE] Questa funzione non è disponibile nelle API per lo scripting. +// TRANSLATION MISSING +==== util_strftimeval + +_WeeChat ≥ 4.2.0._ + +Format date and time like function `strftime` in C library, using `struct timeval` +as input, and supporting extra specifiers for microseconds. + +Prototype: + +[source,c] +---- +int weechat_util_strftimeval (char *string, int max, const char *format, struct timeval *tv); +---- + +Arguments: + +* _string_: buffer where the formatted string is stored +* _max_: string size +* _format_: format, the same as _strftime_ function, with these extra specifiers: +** `%.N` where `N` is between 1 and 6: zero-padded microseconds on N digits + (for example `%.3` for milliseconds) +** `%f`: alias of `%.6` + +Return value: + +* number of bytes put in _string_ (value returned from _strftime_ function) + +C example: + +[source,c] +---- +char time[256]; +struct timeval tv; +gettimeofday (&tv, NULL); +weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv); +/* result: 2023-12-26T18:10:04.460509 */ +---- + +[NOTE] +Questa funzione non è disponibile nelle API per lo scripting. + ==== util_version_number _WeeChat ≥ 0.3.9._ @@ -9611,13 +9653,13 @@ void weechat_printf (struct t_gui_buffer *buffer, const char *message, ...); ---- // TRANSLATION MISSING -This function is a shortcut for function printf_date_tags. These two calls give -exactly same result: +This function is a shortcut for function printf_datetime_tags. + +These two calls give exactly same result: [source,c] ---- weechat_printf (buffer, "message"); -weechat_printf_date_tags (buffer, 0, NULL, "message"); +weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message"); ---- Argomenti: @@ -9683,6 +9725,16 @@ void weechat_printf_date_tags (struct t_gui_buffer *buffer, time_t date, const char *tags, const char *message, ...); ---- +// TRANSLATION MISSING +This function is a shortcut for function printf_datetime_tags. + +These two calls give exactly same result: + +[source,c] +---- +weechat_printf_date_tags (buffer, 0, NULL, "message"); +weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message"); +---- + Argomenti: * _buffer_: puntatore al buffer, se NULL il messaggio viene visualizzato @@ -9720,6 +9772,67 @@ weechat.prnt_date_tags("", time - 120, "notify_message", [NOTE] La funzione è chiamata "print_date_tags" negli script ("prnt_date_tags" in Python). +==== printf_datetime_tags + +_WeeChat ≥ 4.2.0._ + +// TRANSLATION MISSING +Display a message on a buffer, using a custom date/time (with microseconds) +and tags. + +Prototipo: + +[source,c] +---- +void weechat_printf_datetime_tags (struct t_gui_buffer *buffer, time_t date, + int date_usec, const char *tags, const char *message, ...); +---- + +Argomenti: + +* _buffer_: puntatore al buffer, se NULL il messaggio viene visualizzato + sul buffer di WeeChat +* _date_: data per il messaggio (0 indica data/ora corrente) +// TRANSLATION MISSING +* _date_usec_: microseconds of date (between 0 and 999999) +// TRANSLATION MISSING +* _tags_: lista di tag separati da virgole (NULL means no tags) +* _message_: messaggio da visualizzare + +// TRANSLATION MISSING +See the link:weechat_user.it.html#lines_tags[WeeChat user's guide / Lines tags ^↗^^] +for a list of commonly used tags in WeeChat. + +Esempio in C: + +[source,c] +---- +struct timeval tv_now; + +gettimeofday (&tv_now, NULL); +weechat_printf_datetime_tags (NULL, tv_now.tv_sec - 120, tv_now.tv_usec, + "notify_message", + "Messaggio 2 minuti fa, con tag 'notify_message'"); +---- + +Script (Python): + +[source,python] +---- +# prototipo +def prnt_datetime_tags(buffer: str, date: int, date_usec: int, tags: str, message: str) -> int: ... + +# esempio +now = time.time() +time_sec = int(now) +time_usec = int((now * 1000000) % 1000000) +weechat.prnt_datetime_tags("", time_sec - 120, time_usec, "notify_message", + "Messaggio 2 minuti fa, con tag 'notify_message'") +---- + +[NOTE] +La funzione è chiamata "print_datetime_tags" negli script ("prnt_datetime_tags" in Python). + ==== printf_y Visualizza un messaggio sulla riga di un buffer con contenuto libero. @@ -9728,8 +9841,17 @@ Prototipo: [source,c] ---- -void weechat_printf_y (struct t_gui_buffer *buffer, int y, - const char *message, ...); +void weechat_printf_y (struct t_gui_buffer *buffer, int y, const char *message, ...); +---- + +// TRANSLATION MISSING +This function is a shortcut for function printf_y_datetime_tags. + +These two calls give exactly same result: + +[source,c] +---- +weechat_printf_y (buffer, 0, "message"); +weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message"); ---- Argomenti: @@ -9779,6 +9901,16 @@ void weechat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date const char *tags, const char *message, ...); ---- +// TRANSLATION MISSING +This function is a shortcut for function printf_y_datetime_tags. + +These two calls give exactly same result: + +[source,c] +---- +weechat_printf_y_date_tags (buffer, 0, 0, NULL, "message"); +weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message"); +---- + Argomenti: * _buffer_: puntatore al buffer @@ -9813,6 +9945,58 @@ weechat.prnt_y_date_tags("", 2, 0, "my_tag", "My message on third line with a ta [NOTE] La funzione è chiamata "print_y_date_tags" negli script ("prnt_y_date_tags in Python). +==== printf_y_datetime_tags + +_WeeChat ≥ 4.2.0._ + +// TRANSLATION MISSING +Display a message on a line of a buffer with free content, using a custom +date/time (with microseconds) and tags. + +Prototipo: + +[source,c] +---- +void weechat_printf_y_datetime_tags (struct t_gui_buffer *buffer, int y, time_t date, + int date_usec, const char *tags, const char *message, ...); +---- + +Argomenti: + +* _buffer_: puntatore al buffer +// TRANSLATION MISSING +* _y_: numero di riga (la prima riga è 0); a negative value adds a line after + last line displayed: absolute value of _y_ is the number of lines after last + line (for example -1 is immediately after last line, -2 is 2 lines after last + line) +* _date_: data per il messaggio (0 indica data/ora corrente) +// TRANSLATION MISSING +* _date_usec_: microseconds of date (between 0 and 999999) +// TRANSLATION MISSING +* _tags_: lista di tag separati da virgole (NULL means no tags) +* _message_: messaggio da visualizzare + +Esempio in C: + +[source,c] +---- +weechat_printf_y_datetime_tags (buffer, 2, 0, 0, "my_tag", "My message on third line with a tag"); +---- + +Script (Python): + +[source,python] +---- +# prototipo +def prnt_y_datetime_tags(buffer: str, y: int, date: int, date_usec: int, tags: str, message: str) -> int: ... + +# esempio +weechat.prnt_y_datetime_tags("", 2, 0, 0, "my_tag", "My message on third line with a tag") +---- + +[NOTE] +La funzione è chiamata "print_y_datetime_tags" negli script ("prnt_y_datetime_tags in Python). + ==== log_printf Scrive un messaggio nel file di log di WeeChat (weechat.log). @@ -11218,7 +11402,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "", // TRANSLATION MISSING ==== hook_line -_WeeChat ≥ 2.3, updated in 3.7._ +_WeeChat ≥ 2.3, updated in 4.2.0._ Hook a line to be printed in a buffer. @@ -11317,11 +11501,21 @@ Line data sent to the callback is a hashtable, with following values | N/A ("0"). | `+1533792000+` +| date_usec +| Microseconds of line date (between 0 and 999999). +| N/A ("0"). +| `+123456+` + | date_printed | Date when line was displayed (timestamp). | N/A ("0"). | `+1533792012+` +| date_usec_printed +| Microseconds of date when line was displayed (between 0 and 999999). +| N/A ("0"). +| `+654321+` + | str_time | Date for display (possible color codes inside). | N/A (empty string). @@ -11408,11 +11602,22 @@ in this hashtable): | The date is set to this value. + The value of `+str_time+` is updated accordingly. +| date_usec +| Integer ("0" to "999999"). +| N/A. +| The microseconds of line date is set to this value. + + The value of `+str_time+` is updated accordingly. + | date_printed | Timestamp. | N/A. | The printed date is set to this timestamp (not displayed). +| date_usec_printed +| Integer ("0" to "999999"). +| N/A. +| The microseconds of printed date is set to this value. + | str_time | String. | N/A. @@ -11494,7 +11699,7 @@ hook = weechat.hook_line("", "", "irc_join", "my_line_cb", "") ==== hook_print // TRANSLATION MISSING -_Updated in 0.4.3, 1.0, 1.5._ +_Updated in 0.4.3, 1.0, 1.5, 4.2.0._ // TRANSLATION MISSING Hook su un messaggio stampato. It is called when a line has been added in @@ -11516,6 +11721,7 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer, void *data, struct t_gui_buffer *buffer, time_t date, + int date_usec, int tags_count, const char **tags, int displayed, @@ -11549,6 +11755,8 @@ Argomenti: ** _void *data_: puntatore ** _struct t_gui_buffer *buffer_: puntatore al buffer ** _time_t date_: data +// TRANSLATION MISSING +** _int date_usec_: microseconds of date ** _int tags_count_: numero di tag per riga ** _const char **tags_: array con tag per riga ** _int displayed_: 1 se la riga è visualizzata, 0 se filtrata (nascosta) @@ -11581,7 +11789,7 @@ Esempio in C: ---- int my_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer, - time_t date, int tags_count, const char **tags, + time_t date, int date_usec, int tags_count, const char **tags, int displayed, int highlight, const char *prefix, const char *message) { @@ -13891,9 +14099,17 @@ Contenuto della tabella hash inviata alla callback (tasti e valori sono di tipo | _chat_line_date | Riga con data/ora. | "1313237175" | "0" +// TRANSLATION MISSING +| _chat_line_date_usec | Microseconds of line date/time. +| "123456" | "0" + | _chat_line_date_printed | Riga con data/ora ^(4)^. | "1313237175" | "0" +// TRANSLATION MISSING +| _chat_line_date_usec_printed | Microseconds of line printed date/time ^(4)^. +| "123456" | "0" + | _chat_line_time | Ora visualizzata. | "14:06:15" | "" diff --git a/doc/it/weechat_scripting.it.adoc b/doc/it/weechat_scripting.it.adoc index 4f9cb47e8..7670bf0d9 100644 --- a/doc/it/weechat_scripting.it.adoc +++ b/doc/it/weechat_scripting.it.adoc @@ -681,10 +681,14 @@ Elenco di funzioni nelle API per gli script: print (for python: prnt) + // TRANSLATION MISSING print_date_tags (for python: prnt_date_tags) + +// TRANSLATION MISSING + print_datetime_tags (for python: prnt_datetime_tags) + // TRANSLATION MISSING print_y (for python: prnt_y) + // TRANSLATION MISSING print_y_date_tags (for python: prnt_y_date_tags) + +// TRANSLATION MISSING + print_y_datetime_tags (for python: prnt_y_datetime_tags) + log_print | hook diff --git a/doc/it/weechat_user.it.adoc b/doc/it/weechat_user.it.adoc index c7abe8066..ea06ec017 100644 --- a/doc/it/weechat_user.it.adoc +++ b/doc/it/weechat_user.it.adoc @@ -5575,7 +5575,7 @@ type: | signal | tg_signal_data | | hsignal | | | modifier | tg_string | tg_string -| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message +| line | message | buffer, buffer_name, y, date, date_usec, date_printed, date_usec_printed, str_time, tags, notify_level, highlight, prefix, message | print | tg_message | | command | tg_argv_eol1 | | command_run | tg_command | @@ -5734,7 +5734,9 @@ The "line" callback sets following variables in hashtable: | buffer_type | string | Buffer type ("formatted" or "free"). | y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content. | date | string | Line date (timestamp). +| date_usec | string | Microseconds of line date. | date_printed | string | Date when line was displayed (timestamp). +| date_usec_printed | string | Microseconds of date when line was displayed. | str_time | string | Date for display. It may contain color codes. | tags | string | Tags of message (with comma added at beginning/end of string). | displayed | string | "1" if displayed, "0" if line filtered. @@ -5773,7 +5775,8 @@ The "print" callback sets following variables in hashtable: |=== | Variable | Type | Description | buffer | pointer | Buffer. -| tg_date | string | Message date/time (format: `YYYY-MM-DD hh:mm:ss`). +// TRANSLATION MISSING +| tg_date | string | Message date/time (format: `%FT%T.%f`, see link:weechat_plugin_api.it.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]). | tg_displayed | string | "1" if displayed, "0" if line filtered. | tg_highlight | string | "1" if highlight, otherwise "0". | tg_prefix | string | Prefix. @@ -5838,7 +5841,8 @@ The "timer" callback sets following variables in hashtable: |=== | Variable | Type | Description | tg_remaining_calls | string | Number of remaining calls. -| tg_date | string | Current date/time (format: `YYYY-MM-DD hh:mm:ss`). +// TRANSLATION MISSING +| tg_date | string | Current date/time (format: `%FT%T.%f`, see link:weechat_plugin_api.it.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]). |=== [[trigger_data_config]] diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index bb9c7450a..aa42991be 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -4820,6 +4820,48 @@ weechat_printf (NULL, "date: %s", [NOTE] スクリプト API ではこの関数を利用できません。 +// TRANSLATION MISSING +==== util_strftimeval + +_WeeChat ≥ 4.2.0._ + +Format date and time like function `strftime` in C library, using `struct timeval` +as input, and supporting extra specifiers for microseconds. + +Prototype: + +[source,c] +---- +int weechat_util_strftimeval (char *string, int max, const char *format, struct timeval *tv); +---- + +Arguments: + +* _string_: buffer where the formatted string is stored +* _max_: string size +* _format_: format, the same as _strftime_ function, with these extra specifiers: +** `%.N` where `N` is between 1 and 6: zero-padded microseconds on N digits + (for example `%.3` for milliseconds) +** `%f`: alias of `%.6` + +Return value: + +* number of bytes put in _string_ (value returned from _strftime_ function) + +C example: + +[source,c] +---- +char time[256]; +struct timeval tv; +gettimeofday (&tv, NULL); +weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv); +/* result: 2023-12-26T18:10:04.460509 */ +---- + +[NOTE] +スクリプト API ではこの関数を利用できません。 + ==== util_version_number _WeeChat バージョン 0.3.9 以上で利用可。_ @@ -9375,13 +9417,13 @@ weechat.prnt("", "Color: %sblue %sdefault color %syellow on red" void weechat_printf (struct t_gui_buffer *buffer, const char *message, ...); ---- -この関数は printf_date_tags +この関数は printf_datetime_tags 関数の別名です。以下に示す通り、どちらの関数も同じ結果を返します: [source,c] ---- weechat_printf (buffer, "message"); -weechat_printf_date_tags (buffer, 0, NULL, "message"); +weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message"); ---- 引数: @@ -9443,6 +9485,15 @@ void weechat_printf_date_tags (struct t_gui_buffer *buffer, time_t date, const char *tags, const char *message, ...); ---- +この関数は printf_datetime_tags +関数の別名です。以下に示す通り、どちらの関数も同じ結果を返します: + +[source,c] +---- +weechat_printf_date_tags (buffer, 0, NULL, "message"); +weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message"); +---- + 引数: * _buffer_: バッファへのポインタ、NULL の場合、メッセージは WeeChat バッファに表示 @@ -9477,6 +9528,64 @@ weechat.prnt_date_tags("", time - 120, "notify_message", [NOTE] この関数をスクリプトの中で実行するには "print_date_tags" (Python の場合は "prnt_date_tags") と書きます。 +==== printf_datetime_tags + +_WeeChat ≥ 4.2.0._ + +// TRANSLATION MISSING +Display a message on a buffer, using a custom date/time (with microseconds) +and tags. + +プロトタイプ: + +[source,c] +---- +void weechat_printf_datetime_tags (struct t_gui_buffer *buffer, time_t date, + int date_usec, const char *tags, const char *message, ...); +---- + +引数: + +* _buffer_: バッファへのポインタ、NULL の場合、メッセージは WeeChat バッファに表示 +* _date_: メッセージの日付 (0 は現在の日付/時間を意味する) +// TRANSLATION MISSING +* _date_usec_: microseconds of date (between 0 and 999999) +* _tags_: タグのコンマ区切りリスト (タグを指定しない場合は NULL) +* _message_: 表示するメッセージ + +WeeChat で共通に使われるタグのリストは +link:weechat_user.ja.html#lines_tags[WeeChat ユーザーズガイド / 行のタグ ^↗^^]を参照してください + +C 言語での使用例: + +[source,c] +---- +struct timeval tv_now; + +gettimeofday (&tv_now, NULL); +weechat_printf_datetime_tags (NULL, tv_now.tv_sec - 120, tv_now.tv_usec, + "notify_message", + "Message 2 minutes ago, with a tag 'notify_message'"); +---- + +スクリプト (Python) での使用例: + +[source,python] +---- +# プロトタイプ +def prnt_datetime_tags(buffer: str, date: int, date_usec: int, tags: str, message: str) -> int: ... + +# 例 +now = time.time() +time_sec = int(now) +time_usec = int((now * 1000000) % 1000000) +weechat.prnt_datetime_tags("", time_sec - 120, time_usec, "notify_message", + "Message 2 minutes ago, with a tag 'notify_message'") +---- + +[NOTE] +この関数をスクリプトの中で実行するには "print_datetime_tags" (Python の場合は "prnt_datetime_tags") と書きます。 + ==== printf_y 自由内容のバッファのある行にメッセージを表示 @@ -9485,8 +9594,17 @@ weechat.prnt_date_tags("", time - 120, "notify_message", [source,c] ---- -void weechat_printf_y (struct t_gui_buffer *buffer, int y, - const char *message, ...); +void weechat_printf_y (struct t_gui_buffer *buffer, int y, const char *message, ...); +---- + +// TRANSLATION MISSING +This function is a shortcut for function printf_y_datetime_tags. + +These two calls give exactly same result: + +[source,c] +---- +weechat_printf_y (buffer, 0, "message"); +weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message"); ---- 引数: @@ -9535,6 +9653,16 @@ void weechat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date const char *tags, const char *message, ...); ---- +// TRANSLATION MISSING +This function is a shortcut for function printf_y_datetime_tags. + +These two calls give exactly same result: + +[source,c] +---- +weechat_printf_y_date_tags (buffer, 0, 0, NULL, "message"); +weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message"); +---- + 引数: * _buffer_: バッファへのポインタ @@ -9566,6 +9694,55 @@ weechat.prnt_y_date_tags("", 2, 0, "my_tag", "My message on third line with a ta [NOTE] この関数をスクリプトの中で実行するには "print_y_date_tags" (Python の場合は "prnt_y_date_tags") と書きます。 +==== printf_y_datetime_tags + +_WeeChat ≥ 4.2.0._ + +// TRANSLATION MISSING +Display a message on a line of a buffer with free content, using a custom +date/time (with microseconds) and tags. + +プロトタイプ: + +[source,c] +---- +void weechat_printf_y_datetime_tags (struct t_gui_buffer *buffer, int y, time_t date, + int date_usec, const char *tags, const char *message, ...); +---- + +引数: + +* _buffer_: バッファへのポインタ +* _y_: 行番号 (1 行目は 0); 負数の場合は表示された最後の行の後に行を追加する: + _y_ の絶対値で最後の行の後に追加する行数を指定 (例えば + -1 は最後の行のすぐ後、-2 は 最後の行の 2 行後) +* _date_: メッセージの日付 (0 は現在の日付/時間を意味する) +// TRANSLATION MISSING +* _date_usec_: microseconds of date (between 0 and 999999) +* _tags_: タグのコンマ区切りリスト (タグを指定しない場合は NULL) +* _message_: 表示するメッセージ + +C 言語での使用例: + +[source,c] +---- +weechat_printf_y_datetime_tags (buffer, 2, 0, 0, "my_tag", "My message on third line with a tag"); +---- + +スクリプト (Python) での使用例: + +[source,python] +---- +# プロトタイプ +def prnt_y_datetime_tags(buffer: str, y: int, date: int, date_usec: int, tags: str, message: str) -> int: ... + +# 例 +weechat.prnt_y_datetime_tags("", 2, 0, 0, "my_tag", "My message on third line with a tag") +---- + +[NOTE] +この関数をスクリプトの中で実行するには "print_y_datetime_tags" (Python の場合は "prnt_y_datetime_tags") と書きます。 + ==== log_printf WeeChat ログファイル (weechat.log) にメッセージを書き込む。 @@ -10944,7 +11121,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "", ==== hook_line // TRANSLATION MISSING -_WeeChat ≥ 2.3, updated in 3.7._ +_WeeChat ≥ 2.3, updated in 4.2.0._ バッファに対する行表示をフックする。 @@ -11043,11 +11220,23 @@ struct t_hook *weechat_hook_line (const char *buffer_type, | 利用不可 ("0") | `+1533792000+` +// TRANSLATION MISSING +| date_usec +| Microseconds of line date (between 0 and 999999). +| N/A ("0"). +| `+123456+` + | date_printed | 行が表示された日付 (タイムスタンプ) | 利用不可 ("0") | `+1533792012+` +// TRANSLATION MISSING +| date_usec_printed +| Microseconds of date when line was displayed (between 0 and 999999). +| N/A ("0"). +| `+654321+` + | str_time | 行に追加される日付 (色コードを入れてもよい) | 利用不可 (空文字列) @@ -11135,11 +11324,24 @@ WeeChat はそれらを無視します。 | 日付はこの値に設定されます + これに対応して `+str_time+` も更新されます +// TRANSLATION MISSING +| date_usec +| Integer ("0" to "999999"). +| 利用不可 +| The microseconds of line date is set to this value. + + これに対応して `+str_time+` も更新されます + | date_printed | タイムスタンプ | 利用不可 | 表示される日付はこのタイムスタンプを使います。The printed date is set to this timestamp (not displayed). +// TRANSLATION MISSING +| date_usec_printed +| Integer ("0" to "999999"). +| 利用不可 +| The microseconds of printed date is set to this value. + | str_time | 文字列 | 利用不可 @@ -11220,7 +11422,7 @@ hook = weechat.hook_line("", "", "irc_join", "my_line_cb", "") ==== hook_print -_WeeChat バージョン 0.4.3、1.0、1.5 で更新。_ +_WeeChat バージョン 0.4.3、1.0、1.5、4.2.0 で更新。_ メッセージの表示をフックする。これは行がフォーマット済みバッファに追加された時点で呼び出されます。 @@ -11239,6 +11441,7 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer, void *data, struct t_gui_buffer *buffer, time_t date, + int date_usec, int tags_count, const char **tags, int displayed, @@ -11268,6 +11471,8 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer, ** _void *data_: ポインタ ** _struct t_gui_buffer *buffer_: バッファへのポインタ ** _time_t date_: 日付 +// TRANSLATION MISSING +** _int date_usec_: microseconds of date ** _int tags_count_: 行に付けられたタグの個数 ** _const char **tags_: 行に付けられたタグの配列 ** _int displayed_: 行が表示される場合は 1、フィルタされる (隠される) 場合は 0 @@ -11298,7 +11503,7 @@ C 言語での使用例: ---- int my_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer, - time_t date, int tags_count, const char **tags, + time_t date, int date_usec, int tags_count, const char **tags, int displayed, int highlight, const char *prefix, const char *message) { @@ -13460,9 +13665,17 @@ info を使う前にエリアが一致していることを確認して下さい | _chat_line_date | 日付/時間の行 | "1313237175" | "0" +// TRANSLATION MISSING +| _chat_line_date_usec | Microseconds of line date/time. +| "123456" | "0" + | _chat_line_date_printed | 日付/時間の行 ^(4)^ | "1313237175" | "0" +// TRANSLATION MISSING +| _chat_line_date_usec_printed | Microseconds of line printed date/time ^(4)^. +| "123456" | "0" + | _chat_line_time | 表示された時間 | "14:06:15" | "" diff --git a/doc/ja/weechat_relay_protocol.ja.adoc b/doc/ja/weechat_relay_protocol.ja.adoc index 83cc5e6c4..6203376d2 100644 --- a/doc/ja/weechat_relay_protocol.ja.adoc +++ b/doc/ja/weechat_relay_protocol.ja.adoc @@ -507,7 +507,9 @@ hda: 'buffer': 'ptr', 'y': 'int', 'date': 'tim', + 'date_usec': 'int', 'date_printed': 'tim', + 'date_usec_printed', 'int', 'str_time': 'str', 'tags_count': 'int', 'tags_array': 'arr', @@ -525,7 +527,9 @@ hda: buffer: '0x558d61ea3e60' y: -1 date: 1588404926 + date_usec: 118712 date_printed: 1588404926 + date_usec_printed: 118712 str_time: 'F@0025209F@0024535F@0024026' tags_count: 0 tags_array: [] @@ -541,7 +545,9 @@ hda: buffer: '0x558d61ea3e60' y: -1 date: 1588404930 + date_usec: 25 date_printed: 1588404930 + date_usec_printed: 25 str_time: 'F@0025209F@0024535F@0024030' tags_count: 0 tags_array: [] @@ -2085,17 +2091,21 @@ hdata として送られるデータ: [width="100%",cols="3m,2,10",options="header"] |=== -| 名前 | 型 | 説明 -| buffer | pointer | バッファへのポインタ -| date | time | メッセージの日付 -| date_printed | time | WeeChat メッセージを表示した日付 -| displayed | char | メッセージが表示される場合は 1、メッセージがフィルタされる (隠される) 場合は 0 +| 名前 | 型 | 説明 +| buffer | pointer | バッファへのポインタ +| date | time | メッセージの日付 // TRANSLATION MISSING -| notify_level | char | Notify level: -1 = notify disabled, 0 = low, 1 = message, 2 = private, 3 = highlight. -| highlight | char | 行がハイライト部分を含む場合は 1、それ以外は 0 -| tags_array | string の配列 | 行に対するタグのリスト -| prefix | string | プレフィックス -| message | string | メッセージ +| date_usec | integer | Microseconds of date. +| date_printed | time | WeeChat メッセージを表示した日付 +// TRANSLATION MISSING +| date_usec_printed | integer | Microseconds of date when WeeChat displayed message. +| displayed | char | メッセージが表示される場合は 1、メッセージがフィルタされる (隠される) 場合は 0 +// TRANSLATION MISSING +| notify_level | char | Notify level: -1 = notify disabled, 0 = low, 1 = message, 2 = private, 3 = highlight. +| highlight | char | 行がハイライト部分を含む場合は 1、それ以外は 0 +| tags_array | string の配列 | 行に対するタグのリスト +| prefix | string | プレフィックス +| message | string | メッセージ |=== 例: バッファ _irc.libera.#weechat_ でニックネーム _FlashCode_ からの新しいメッセージ _hello!_: @@ -2107,7 +2117,9 @@ hda: keys: { 'buffer': 'ptr', 'date': 'tim', + 'date_used': 'int', 'date_printed': 'tim', + 'date_usec_printed': 'int', 'displayed': 'chr', 'notify_level': 'chr', 'highlight': 'chr', @@ -2120,7 +2132,9 @@ hda: __path: ['0x4a49600'] buffer: '0x4a715d0' date: 1362728993 + date_usec: 902765 date_printed: 1362728993 + date_usec_printed: 902765 displayed: 1 notify_level: 1 highlight: 0 diff --git a/doc/ja/weechat_scripting.ja.adoc b/doc/ja/weechat_scripting.ja.adoc index 4b5d05e00..c48826643 100644 --- a/doc/ja/weechat_scripting.ja.adoc +++ b/doc/ja/weechat_scripting.ja.adoc @@ -671,8 +671,10 @@ link:weechat_plugin_api.ja.html[WeeChat プラグイン API リファレンス  color + print (python では prnt) + print_date_tags (python では prnt_date_tags) + + print_datetime_tags (python では prnt_datetime_tags) + print_y (python では prnt_y) + print_y_date_tags (python では prnt_y_date_tags) + + print_y_datetime_tags (python では prnt_y_datetime_tags) + log_print | フック diff --git a/doc/ja/weechat_user.ja.adoc b/doc/ja/weechat_user.ja.adoc index e4aa456d5..bda337731 100644 --- a/doc/ja/weechat_user.ja.adoc +++ b/doc/ja/weechat_user.ja.adoc @@ -5415,7 +5415,7 @@ type: | signal | tg_signal_data | | hsignal | | | modifier | tg_string | tg_string -| line | message | buffer、buffer_name、y、date、date_printed、str_time、tags、notify_level、highlight、prefix、message +| line | message | buffer、buffer_name、y、date、date_usec、date_printed、date_usec_printed、str_time、tags、notify_level、highlight、prefix、message | print | tg_message | | command | tg_argv_eol1 | | command_run | tg_command | @@ -5575,7 +5575,11 @@ _weechat_print_ 修飾子では、メッセージタグを使う変数 (下の | buffer_type | string | バッファ型 ("formatted" または "free") | y | string | 自由内容バッファの行番号 (≥ 0)、-1 はフォーマット済みバッファ用 | date | string | 行の日付 (タイムスタンプ) +// TRANSLATION MISSING +| date_usec | string | Microseconds of line date. | date_printed | string | 行が表示される日付 (タイムスタンプ). +// TRANSLATION MISSING +| date_usec_printed | string | Microseconds of date when line was displayed. | str_time | string | 表示に使う日付、色コードを含めることも可能 | tags | string | メッセージのタグ (文字列の最初と最後にコンマが追加されます) | displayed | string | "1" の場合は表示、"0" の場合は非表示 @@ -5617,7 +5621,8 @@ _weechat_print_ 修飾子では、メッセージタグを使う変数 (下の |=== | 変数 | 型 | 説明 | buffer | pointer | メッセージが表示されたバッファ -| tg_date | string | メッセージの日付と時間 (書式: `YYYY-MM-DD hh:mm:ss`) +// TRANSLATION MISSING +| tg_date | string | メッセージの日付と時間 (書式: `%FT%T.%f`, see link:weechat_plugin_api.ja.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]). | tg_displayed | string | 表示された場合 "1"、フィルタされた場合 "0" | tg_highlight | string | ハイライトされた場合 "1"、それ以外は "0" | tg_prefix | string | プレフィックス @@ -5689,7 +5694,8 @@ _weechat_print_ 修飾子では、メッセージタグを使う変数 (下の |=== | 変数 | 型 | 説明 | tg_remaining_calls | string | 残り呼び出し回数 -| tg_date | string | 現在の日付および時間 (書式: `YYYY-MM-DD hh:mm:ss`) +// TRANSLATION MISSING +| tg_date | string | 現在の日付および時間 (書式: `%FT%T.%f`, see link:weechat_plugin_api.ja.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]). |=== [[trigger_data_config]] diff --git a/doc/pl/weechat_scripting.pl.adoc b/doc/pl/weechat_scripting.pl.adoc index e8fd67bcd..5942f27ac 100644 --- a/doc/pl/weechat_scripting.pl.adoc +++ b/doc/pl/weechat_scripting.pl.adoc @@ -657,8 +657,10 @@ Lista funkcji w API skryptów: color + print (dla pythona: prnt) + print_date_tags (dla pythona: prnt_date_tags) + + print_datetime_tags (dla pythona: prnt_datetime_tags) + print_y (dla pythona: prnt_y) + print_y_date_tags (dla pythona: prnt_y_date_tags) + + print_y_datetime_tags (dla pythona: prnt_y_datetime_tags) + log_print | hooks diff --git a/doc/pl/weechat_user.pl.adoc b/doc/pl/weechat_user.pl.adoc index 5de34817f..ce3ee8f28 100644 --- a/doc/pl/weechat_user.pl.adoc +++ b/doc/pl/weechat_user.pl.adoc @@ -5229,7 +5229,7 @@ od typu hooka: | signal | tg_signal_data | | hsignal | | | modifier | tg_string | tg_string -| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message +| line | message | buffer, buffer_name, y, date, date_usec, date_printed, date_usec_printed, str_time, tags, notify_level, highlight, prefix, message | print | tg_message | | command | tg_argv_eol1 | | command_run | tg_command | @@ -5388,7 +5388,11 @@ Callback "line" ustawia następujące zmienne w tablicy hashy: | buffer_type | ciąg | Typ bufora ("formatted" lub "free"). | y | ciąg | Numer linii bufora z wolną zawartością (≥ 0), -1 dla bufora ze sformatowaną zawartością. | date | ciąg | Linia z datą (timestamp). +// TRANSLATION MISSING +| date_usec | ciąg | Microseconds of line date. | date_printed | ciąg | Data, kiedy linia została wyświetlona (timestamp). +// TRANSLATION MISSING +| date_usec_printed | ciąg | Microseconds of date when line was displayed. | str_time | ciąg | Date do wyświetlenia. Może zawierać kody kolorów. | tags | ciąg | Tagi wiadomości (z przecinkiem dodanym na początku/końcu ciągu). | displayed | ciąg | "1" jeśli wyświetlono, "0" jeśli nie wyświetlono. @@ -5427,7 +5431,8 @@ Callback "print" ustawia następujące zmienne w tablicy hashy: |=== | Zmienna | Typ | Opis | buffer | wskaźnik | Bufor. -| tg_date | ciąg | Data/czas wiadomości (format: `YYYY-MM-DD hh:mm:ss`). +// TRANSLATION MISSING +| tg_date | ciąg | Data/czas wiadomości (format: `%FT%T.%f`, see link:weechat_plugin_api.en.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]). | tg_displayed | ciąg | "1" jeśli wyświetlone, "0" jeśli linia odfiltrowana. | tg_highlight | ciąg | "1" jeśli higlight, inaczej "0". | tg_prefix | ciąg | Prefiks. @@ -5492,7 +5497,8 @@ Callback "timer" ustawia następujące zmienne w tablicy hashy: |=== | Zmienna | Typ | Opis | tg_remaining_calls | ciąg | Liczba pozostałych wywołań. -| tg_date | ciąg | Obecna data/czas (format: `YYYY-MM-DD hh:mm:ss`). +// TRANSLATION MISSING +| tg_date | ciąg | Obecna data/czas `%FT%T.%f`, see link:weechat_plugin_api.en.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]). |=== [[trigger_data_config]] diff --git a/doc/sr/weechat_plugin_api.sr.adoc b/doc/sr/weechat_plugin_api.sr.adoc index ef99b8605..995eca75c 100644 --- a/doc/sr/weechat_plugin_api.sr.adoc +++ b/doc/sr/weechat_plugin_api.sr.adoc @@ -4557,6 +4557,48 @@ weechat_printf (NULL, "date: %s", [NOTE] Ова функција није доступна у API скриптовања. +// TRANSLATION MISSING +==== util_strftimeval + +_WeeChat ≥ 4.2.0._ + +Format date and time like function `strftime` in C library, using `struct timeval` +as input, and supporting extra specifiers for microseconds. + +Prototype: + +[source,c] +---- +int weechat_util_strftimeval (char *string, int max, const char *format, struct timeval *tv); +---- + +Arguments: + +* _string_: buffer where the formatted string is stored +* _max_: string size +* _format_: format, the same as _strftime_ function, with these extra specifiers: +** `%.N` where `N` is between 1 and 6: zero-padded microseconds on N digits + (for example `%.3` for milliseconds) +** `%f`: alias of `%.6` + +Return value: + +* number of bytes put in _string_ (value returned from _strftime_ function) + +C example: + +[source,c] +---- +char time[256]; +struct timeval tv; +gettimeofday (&tv, NULL); +weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv); +/* result: 2023-12-26T18:10:04.460509 */ +---- + +[NOTE] +Ова функција није доступна у API скриптовања. + ==== util_version_number _WeeChat ≥ 0.3.9._ @@ -9027,12 +9069,13 @@ weechat.prnt("", "Color: %sblue %sdefault color %syellow on red" void weechat_printf (struct t_gui_buffer *buffer, const char *message, ...); ---- -Ова функција је пречица за функцију printf_date_tags. Следећа два позива дају потпуно исти резултат: +Ова функција је пречица за функцију printf_datetime_tags. + +Следећа два позива дају потпуно исти резултат: [source,c] ---- weechat_printf (buffer, "message"); -weechat_printf_date_tags (buffer, 0, NULL, "message"); +weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message"); ---- Аргументи: @@ -9090,6 +9133,15 @@ void weechat_printf_date_tags (struct t_gui_buffer *buffer, time_t date, const char *tags, const char *message, ...); ---- +Ова функција је пречица за функцију printf_datetime_tags. + +Следећа два позива дају потпуно исти резултат: + +[source,c] +---- +weechat_printf_date_tags (buffer, 0, NULL, "message"); +weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message"); +---- + Аргументи: * _buffer_: показивач на бафер, ако је NULL, порука се приказује у WeeChat баферу @@ -9123,6 +9175,63 @@ weechat.prnt_date_tags("", time - 120, "notify_message", [NOTE] Функција се у скриптама зове „print_date_tags” („prnt_date_tags” у језику Python). +==== printf_datetime_tags + +_WeeChat ≥ 4.2.0._ + +// TRANSLATION MISSING +Display a message on a buffer, using a custom date/time (with microseconds) +and tags. + +Прототип: + +[source,c] +---- +void weechat_printf_datetime_tags (struct t_gui_buffer *buffer, time_t date, + int date_usec, const char *tags, const char *message, ...); +---- + +Аргументи: + +* _buffer_: показивач на бафер, ако је NULL, порука се приказује у WeeChat баферу +* _date_: датум за поруку (0 значи текући датум/време) +// TRANSLATION MISSING +* _date_usec_: microseconds of date (between 0 and 999999) +* _tags_: листа ознака раздвојених запетама (NULL значи да нема ознака) +* _message_: порука која треба да се прикаже + +За листу ознака које се уобичјаено користе у програму WeeChat, погледајте link:weechat_user.sr.html#lines_tags[Корисничко упутство / Ознаке линија ^↗^^]. + +C пример: + +[source,c] +---- +struct timeval tv_now; + +gettimeofday (&tv_now, NULL); +weechat_printf_datetime_tags (NULL, tv_now.tv_sec - 120, tv_now.tv_usec, + "notify_message", + "Message 2 minutes ago, with a tag 'notify_message'"); +---- + +Скрипта (Python): + +[source,python] +---- +# прототип +def prnt_datetime_tags(buffer: str, date: int, date_usec: int, tags: str, message: str) -> int: ... + +# пример +now = time.time() +time_sec = int(now) +time_usec = int((now * 1000000) % 1000000) +weechat.prnt_datetime_tags("", time_sec - 120, time_usec, "notify_message", + "Message 2 minutes ago, with a tag 'notify_message'") +---- + +[NOTE] +Функција се у скриптама зове „print_datetime_tags” („prnt_datetime_tags” у језику Python). + ==== printf_y Приказује поруку на линији бафера са слободним садржајем. @@ -9131,8 +9240,17 @@ weechat.prnt_date_tags("", time - 120, "notify_message", [source,c] ---- -void weechat_printf_y (struct t_gui_buffer *buffer, int y, - const char *message, ...); +void weechat_printf_y (struct t_gui_buffer *buffer, int y, const char *message, ...); +---- + +// TRANSLATION MISSING +This function is a shortcut for function printf_y_datetime_tags. + +These two calls give exactly same result: + +[source,c] +---- +weechat_printf_y (buffer, 0, "message"); +weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message"); ---- Аргументи: @@ -9177,6 +9295,16 @@ void weechat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date const char *tags, const char *message, ...); ---- +// TRANSLATION MISSING +This function is a shortcut for function printf_y_datetime_tags. + +These two calls give exactly same result: + +[source,c] +---- +weechat_printf_y_date_tags (buffer, 0, 0, NULL, "message"); +weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message"); +---- + Аргументи: * _buffer_: показивач на бафер @@ -9206,6 +9334,53 @@ weechat.prnt_y_date_tags("", 2, 0, "my_tag", "My message on third line with a ta [NOTE] У скриптама се функција зове „print_y_date_tags” („prnt_y_date_tags” у језику Python). +==== printf_y_datetime_tags + +_WeeChat ≥ 4.2.0._ + +// TRANSLATION MISSING +Display a message on a line of a buffer with free content, using a custom +date/time (with microseconds) and tags. + +Прототип: + +[source,c] +---- +void weechat_printf_y_datetime_tags (struct t_gui_buffer *buffer, int y, time_t date, + int date_usec, const char *tags, const char *message, ...); +---- + +Аргументи: + +* _buffer_: показивач на бафер +* _y_: број линије (прва линија је 0); негативна вредност додаје линију иза последње приказане линије: апсолутна вредност _y_ је број линија након последње линије (на пример -1 је непосредно након последње линије, -2 је 2 линије након последње линије) +* _date_: датум за поруку (0 значи текући датум/време) +// TRANSLATION MISSING +* _date_usec_: microseconds of date (between 0 and 999999) +* _tags_: листа ознака раздвојених запетама (NULL значи да нема ознака) +* _message_: порука која треба да се прикаже + +C пример: + +[source,c] +---- +weechat_printf_y_datetime_tags (buffer, 2, 0, 0, "my_tag", "My message on third line with a tag"); +---- + +Скрипта (Python): + +[source,python] +---- +# прототип +def prnt_y_datetime_tags(buffer: str, y: int, date: int, date_usec: int, tags: str, message: str) -> int: ... + +# пример +weechat.prnt_y_datetime_tags("", 2, 0, 0, "my_tag", "My message on third line with a tag") +---- + +[NOTE] +У скриптама се функција зове „print_y_datetime_tags” („prnt_y_datetime_tags” у језику Python). + ==== log_printf Уписује поруку у WeeChat лог фајл (weechat.log). @@ -10488,7 +10663,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "", ==== hook_line -_WeeChat ≥ 2.3, ажурирано у 3.7._ +_WeeChat ≥ 2.3, ажурирано у 4.2.0._ Качи се на линију која треба да се испише у бафер. @@ -10573,11 +10748,23 @@ struct t_hook *weechat_hook_line (const char *buffer_type, | Нема ("0"). | `+1533792000+` +// TRANSLATION MISSING +| date_usec +| Microseconds of line date (between 0 and 999999). +| N/A ("0"). +| `+123456+` + | date_printed | Датум када је линија била приказана (временска ознака). | Нема ("0"). | `+1533792012+` +// TRANSLATION MISSING +| date_usec_printed +| Microseconds of date when line was displayed (between 0 and 999999). +| N/A ("0"). +| `+654321+` + | str_time | Датум за приказ (са могућим кодовима боја у себи). | Нема (празан стринг). @@ -10662,11 +10849,24 @@ struct t_hook *weechat_hook_line (const char *buffer_type, | Датум се поставља на ову вредност. + Сагласно овоме се поставља и вредност `+str_time+`. +// TRANSLATION MISSING +| date_usec +| Integer ("0" to "999999"). +| Нема. +| The microseconds of line date is set to this value. + + Сагласно овоме се поставља и вредност `+str_time+`. + | date_printed | Временска ознака. | Нема. | Датум се поставља на ову временску ознаку (не приказује се). +// TRANSLATION MISSING +| date_usec_printed +| Integer ("0" to "999999"). +| Нема. +| The microseconds of printed date is set to this value. + | str_time | Стринг. | Нема. @@ -10747,7 +10947,7 @@ hook = weechat.hook_line("", "", "irc_join", "my_line_cb", "") ==== hook_print -_Ажурирано у верзијама 0.4.3, 1.0, 1.5._ +_Ажурирано у верзијама 0.4.3, 1.0, 1.5, 4.2.0._ Качи се на поруку која се исписује. Позива се када се у бафер са форматираним садржајем дода линија. @@ -10765,6 +10965,7 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer, void *data, struct t_gui_buffer *buffer, time_t date, + int date_usec, int tags_count, const char **tags, int displayed, @@ -10788,6 +10989,8 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer, ** _void *data_: показивач ** _struct t_gui_buffer *buffer_: показивач на бафер ** _time_t date_: датум +// TRANSLATION MISSING +** _int date_usec_: microseconds of date ** _int tags_count_: број ознака за линију ** _const char **tags_: низ са ознакама за линију ** _int displayed_: 1 ако се линија приказује, 0 ако је филтрирана (скривена) @@ -10814,7 +11017,7 @@ C пример: ---- int my_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer, - time_t date, int tags_count, const char **tags, + time_t date, int date_usec, int tags_count, const char **tags, int displayed, int highlight, const char *prefix, const char *message) { @@ -12859,9 +13062,17 @@ struct t_hook *weechat_hook_focus (const char *area, | _chat_line_date | Датум/време линије. | "1313237175" | "0" +// TRANSLATION MISSING +| _chat_line_date_usec | Microseconds of line date/time. +| "123456" | "0" + | _chat_line_date_printed | Датум/време линије ^(4)^. | "1313237175" | "0" +// TRANSLATION MISSING +| _chat_line_date_usec_printed | Microseconds of line printed date/time ^(4)^. +| "123456" | "0" + | _chat_line_time | Приказано време. | "14:06:15" | "" diff --git a/doc/sr/weechat_relay_protocol.sr.adoc b/doc/sr/weechat_relay_protocol.sr.adoc index b1e9de288..4597fa3c7 100644 --- a/doc/sr/weechat_relay_protocol.sr.adoc +++ b/doc/sr/weechat_relay_protocol.sr.adoc @@ -439,7 +439,9 @@ hda: 'buffer': 'ptr', 'y': 'int', 'date': 'tim', + 'date_usec': 'int', 'date_printed': 'tim', + 'date_usec_printed': 'int', 'str_time': 'str', 'tags_count': 'int', 'tags_array': 'arr', @@ -457,7 +459,9 @@ hda: buffer: '0x558d61ea3e60' y: -1 date: 1588404926 + date_usec: 118712 date_printed: 1588404926 + date_usec_printed: 118712 str_time: 'F@0025209F@0024535F@0024026' tags_count: 0 tags_array: [] @@ -473,7 +477,9 @@ hda: buffer: '0x558d61ea3e60' y: -1 date: 1588404930 + date_usec: 25 date_printed: 1588404930 + date_usec_printed: 25 str_time: 'F@0025209F@0024535F@0024030' tags_count: 0 tags_array: [] @@ -1946,16 +1952,20 @@ hda: [width="100%", cols="3m,2,10", options="header"] |=== -| Име | Тип | Опис -| buffer | показивач | Показивач на бафер. -| date | време | Датум поруке. -| date_printed | време | Датум када је програм WeeChat приказао поруку. -| displayed | карактер | 1 ако је порука приказана, 0 ако је порука филтрирана (скривена). -| notify_level | карактер | Ниво обавештења: -1 = обавештење искључено, 0 = ниски, 1 = порука, 2 = приватно, 3 = истицање. -| highlight | карактер | 1 ако се у линији налази истицање, у супротном 0. -| tags_array | низ стрингова | Листа ознака за линију. -| prefix | стринг | Префикс. -| message | стринг | Порука. +| Име | Тип | Опис +| buffer | показивач | Показивач на бафер. +| date | време | Датум поруке. +// TRANSLATION MISSING +| date_usec | integer | Microseconds of date. +| date_printed | време | Датум када је програм WeeChat приказао поруку. +// TRANSLATION MISSING +| date_usec_printed | integer | Microseconds of date when WeeChat displayed message. +| displayed | карактер | 1 ако је порука приказана, 0 ако је порука филтрирана (скривена). +| notify_level | карактер | Ниво обавештења: -1 = обавештење искључено, 0 = ниски, 1 = порука, 2 = приватно, 3 = истицање. +| highlight | карактер | 1 ако се у линији налази истицање, у супротном 0. +| tags_array | низ стрингова | Листа ознака за линију. +| prefix | стринг | Префикс. +| message | стринг | Порука. |=== Пример: нова порука _здраво!_ од надимка _FlashCode_ у баферу _irc.libera.#weechat_: @@ -1967,7 +1977,9 @@ hda: keys: { 'buffer': 'ptr', 'date': 'tim', + 'date_usec': 'int', 'date_printed': 'tim', + 'date_usec_printed': 'int', 'displayed': 'chr', 'notify_level': 'chr', 'highlight': 'chr', @@ -1980,7 +1992,9 @@ hda: __path: ['0x4a49600'] buffer: '0x4a715d0' date: 1362728993 + date_usec: 902765 date_printed: 1362728993 + date_usec_printed: 902765 displayed: 1 notify_level: 1 highlight: 0 diff --git a/doc/sr/weechat_scripting.sr.adoc b/doc/sr/weechat_scripting.sr.adoc index 81e698520..dd5ce3e30 100644 --- a/doc/sr/weechat_scripting.sr.adoc +++ b/doc/sr/weechat_scripting.sr.adoc @@ -610,8 +610,10 @@ weechat_hook_timer(1000, 0, 1, $timer_cb, 'test'); color + print (за python: prnt) + print_date_tags (за python: prnt_date_tags) + + print_datetime_tags (за python: prnt_datetime_tags) + print_y (за python: prnt_y) + print_y_date_tags (за python: prnt_y_date_tags) + + print_y_datetime_tags (за python: prnt_y_datetime_tags) + log_print | куке diff --git a/doc/sr/weechat_user.sr.adoc b/doc/sr/weechat_user.sr.adoc index 3c99b10d5..18b09d283 100644 --- a/doc/sr/weechat_user.sr.adoc +++ b/doc/sr/weechat_user.sr.adoc @@ -4915,7 +4915,7 @@ y/${chars:a-z}${chars:A-Z}/${chars:b-z}a${chars:B-Z}A/ | signal | tg_signal_data | | hsignal | | | modifier | tg_string | tg_string -| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message +| line | message | buffer, buffer_name, y, date, date_usec, date_printed, date_usec_printed, str_time, tags, notify_level, highlight, prefix, message | print | tg_message | | command | tg_argv_eol1 | | command_run | tg_command | @@ -5064,7 +5064,11 @@ ${buffer[${tg_signal_data}].full_name} | buffer_type | стринг | Тип бафера („formatted” или „free”). | y | стринг | Број линије за бафер са слободним садржајем (≥ 0), -1 за бафер са форматираним садржајем. | date | стринг | Датум линије (временска ознака). +// TRANSLATION MISSING +| date_usec | стринг | Microseconds of line date. | date_printed | стринг | Датум када је линија била приказана (временска ознака). +// TRANSLATION MISSING +| date_usec_printed | стринг | Microseconds of date when line was displayed. | str_time | стринг | Датум за приказ. Може да садржи кодове боја. | tags | стринг | Ознаке поруке (са запетом додатом на почетак/крај стринга). | displayed | стринг | „1” ако се приказује, „0” ако је линија филтрирана. @@ -5103,7 +5107,8 @@ ${buffer[${tg_signal_data}].full_name} |=== | Променљива | Тип | Опис | buffer | показивач | Бафер. -| tg_date | стринг | Датум/време поруке (формат: `ГГГГ-ММ-ДД чч:мм:сс`). +// TRANSLATION MISSING +| tg_date | стринг | Датум/време поруке (формат: `%FT%T.%f`, see link:weechat_plugin_api.sr.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]). | tg_displayed | стринг | „1” ако се приказује, „0” ако се линија филтрира. | tg_highlight | стринг | „1” ако је истакнута, у супротном „0”. | tg_prefix | стринг | Префикс. @@ -5168,7 +5173,8 @@ ${buffer[${tg_signal_data}].full_name} |=== | Променљива | Тип | Опис | tg_remaining_calls | стринг | Број преосталих позива. -| tg_date | стринг | Текући датум/време (формат: `ГГГГ-ММ-ДД чч:мм:сс`). +// TRANSLATION MISSING +| tg_date | стринг | Текући датум/време (формат: `%FT%T.%f`, see link:weechat_plugin_api.sr.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]). |=== [[trigger_data_config]] diff --git a/po/cs.po b/po/cs.po index 1302d1346..baed327a2 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-12-24 16:45+0100\n" +"POT-Creation-Date: 2023-12-26 18:55+0100\n" "PO-Revision-Date: 2023-11-29 09:59+0100\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -3883,7 +3883,9 @@ msgstr "" #, fuzzy msgid "" -"time format in bare display mode (see man strftime for date/time specifiers)" +"time format in bare display mode (see API man strftime for date/time " +"specifiers, extra specifiers are supported, see function util_strftimeval in " +"Plugin API reference)" msgstr "" "časový formát pro \"time\" položku panelu (viz. man strftime pro specifikaci " "data/času)" @@ -3938,9 +3940,12 @@ msgstr "" #, fuzzy msgid "" "time format for each line displayed in buffers (see man strftime for date/" -"time specifiers) (note: content is evaluated, so you can use colors with " -"format \"${color:xxx}\", see /help eval); for example time using grayscale: " -"\"${color:252}%H${color:243}%M${color:237}%S\"" +"time specifiers, extra specifiers are supported, see function " +"util_strftimeval in Plugin API reference) (note: content is evaluated, so " +"you can use colors with format \"${color:xxx}\", see /help eval); for " +"example time using grayscale: " +"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: " +"\"${color:252}%H${color:243}%M${color:237}%S.%.3\"" msgstr "" "formát času zobrazeného na každém řádku v bufferu (viz. man strftime pro " "specifikaci data/času), barvy jsou povoleny ve formátu \"${barva}\", " @@ -4494,8 +4499,11 @@ msgstr "text pro zobrazení před přezdívkou v okně rozhovoru" msgid "text to display after nick when quoting a message (see /help cursor)" msgstr "text pro zobrazení za přezdívkou v okně rozhovoru" -msgid "time format when quoting a message (see /help cursor)" -msgstr "formát času při citování zprávy (viz /help cursor)" +msgid "" +"time format when quoting a message (see /help cursor) (see man strftime for " +"date/time specifiers, extra specifiers are supported, see function " +"util_strftimeval in Plugin API reference)" +msgstr "" msgid "use a marker (line or char) on buffers to show first unread line" msgstr "" @@ -9504,8 +9512,9 @@ msgid "" "> `c:xxx`: show only messages matching the evaluated condition \"xxx\", " "using following variables: output of function irc_message_parse (like nick, " "command, channel, text, etc., see function info_get_hashtable in plugin API " -"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:" -"ss\"), server, recv, sent, modified, redirected" +"reference for the list of all variables), date (format: \"%FT%T.%f\", see " +"function util_strftimeval in Plugin API reference), server, recv, sent, " +"modified, redirected" msgstr "" msgid "list services currently connected to the network" @@ -10326,7 +10335,8 @@ msgstr "použít stejnou barvu přezdívky pro kanál a soukromý rozhovor" #, fuzzy msgid "" "time format used in answer to message CTCP TIME (see man strftime for date/" -"time specifiers)" +"time specifiers, extra specifiers are supported, see function " +"util_strftimeval in Plugin API reference)" msgstr "" "časový formát pro \"time\" položku panelu (viz. man strftime pro specifikaci " "data/času)" @@ -12372,7 +12382,13 @@ msgid "" "rotation_compression_type" msgstr "" -msgid "timestamp used in log files (see man strftime for date/time specifiers)" +#, fuzzy +#| msgid "" +#| "timestamp used in log files (see man strftime for date/time specifiers)" +msgid "" +"timestamp used in log files (see man strftime for date/time specifiers, " +"extra specifiers are supported, see function util_strftimeval in Plugin API " +"reference)" msgstr "" "časová známka použita v logovacích souborech (použijte manuálovou stránku " "strftime pro spcifikátory data/času)" @@ -15867,3 +15883,6 @@ msgstr "%s%s: vypršel časový limit \"%s\" pro %s" #, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: nemohu se připojit\" neočekávaná chyba (%d)" + +#~ msgid "time format when quoting a message (see /help cursor)" +#~ msgstr "formát času při citování zprávy (viz /help cursor)" diff --git a/po/de.po b/po/de.po index 30d26e09b..a75469f25 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-12-24 16:45+0100\n" +"POT-Creation-Date: 2023-12-26 18:55+0100\n" "PO-Revision-Date: 2023-12-25 15:45+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -4308,8 +4308,14 @@ msgstr "" msgid "exit the bare display mode on any changes in input" msgstr "beendet den einfachen Anzeigemodus durch Tastendruck" +#, fuzzy +#| msgid "" +#| "time format in bare display mode (see man strftime for date/time " +#| "specifiers)" msgid "" -"time format in bare display mode (see man strftime for date/time specifiers)" +"time format in bare display mode (see API man strftime for date/time " +"specifiers, extra specifiers are supported, see function util_strftimeval in " +"Plugin API reference)" msgstr "" "Format für die Zeitanzeige im einfachen Anzeigemodus, \"time\" (siehe man " "strftime, welche Platzhalter für das Datum und die Uhrzeit verwendet werden)" @@ -4380,11 +4386,20 @@ msgstr "" "(prefix), Präfix und Nachricht (prefix_message)" #. TRANSLATORS: string "${color:xxx}" must NOT be translated +#, fuzzy +#| msgid "" +#| "time format for each line displayed in buffers (see man strftime for date/" +#| "time specifiers) (note: content is evaluated, so you can use colors with " +#| "format \"${color:xxx}\", see /help eval); for example time using " +#| "grayscale: \"${color:252}%H${color:243}%M${color:237}%S\"" msgid "" "time format for each line displayed in buffers (see man strftime for date/" -"time specifiers) (note: content is evaluated, so you can use colors with " -"format \"${color:xxx}\", see /help eval); for example time using grayscale: " -"\"${color:252}%H${color:243}%M${color:237}%S\"" +"time specifiers, extra specifiers are supported, see function " +"util_strftimeval in Plugin API reference) (note: content is evaluated, so " +"you can use colors with format \"${color:xxx}\", see /help eval); for " +"example time using grayscale: " +"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: " +"\"${color:252}%H${color:243}%M${color:237}%S.%.3\"" msgstr "" "Format für die Uhrzeit, die in jeder Zeile eines Buffers dargestellt wird " "(siehe man strftime, welche Platzhalter für das Datum und die Uhrzeit " @@ -5081,8 +5096,11 @@ msgstr "" "Text der nach dem Nick dargestellt werden soll, wenn die Nachricht gequotet " "wird (siehe /help cursor)" -msgid "time format when quoting a message (see /help cursor)" -msgstr "Zeitformat wenn eine Nachricht gequotet wird (siehe /help cursor)" +msgid "" +"time format when quoting a message (see /help cursor) (see man strftime for " +"date/time specifiers, extra specifiers are supported, see function " +"util_strftimeval in Plugin API reference)" +msgstr "" msgid "use a marker (line or char) on buffers to show first unread line" msgstr "" @@ -5855,7 +5873,6 @@ msgstr "Speicheranzeige nicht verfügbar (Funktion \"mallinfo\" nicht gefunden)" msgid "not initialized" msgstr "nicht initialisiert" -#| msgid "no variable" msgid "not available" msgstr "nicht verfügbar" @@ -10530,12 +10547,20 @@ msgstr "" msgid "> `m:xxx`: show only IRC command \"xxx\"" msgstr "> `m:xxx`: zeigt nur IRC Befehl \"xxx\" an" +#, fuzzy +#| msgid "" +#| "> `c:xxx`: show only messages matching the evaluated condition \"xxx\", " +#| "using following variables: output of function irc_message_parse (like " +#| "nick, command, channel, text, etc., see function info_get_hashtable in " +#| "plugin API reference for the list of all variables), date (format: \"yyyy-" +#| "mm-dd hh:mm:ss\"), server, recv, sent, modified, redirected" msgid "" "> `c:xxx`: show only messages matching the evaluated condition \"xxx\", " "using following variables: output of function irc_message_parse (like nick, " "command, channel, text, etc., see function info_get_hashtable in plugin API " -"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:" -"ss\"), server, recv, sent, modified, redirected" +"reference for the list of all variables), date (format: \"%FT%T.%f\", see " +"function util_strftimeval in Plugin API reference), server, recv, sent, " +"modified, redirected" msgstr "" "> `c:xxx`: zeigt nur Nachrichten an auf die die evaluierte Bedingung \"xxx\" " "zutrifft, folgende Variablen können verwendet werden: Ausgabe der Funktion " @@ -11427,9 +11452,14 @@ msgstr "" "nutzt die selbe Farbe für die Darstellung des Nicks im Kanal wie auch im " "privaten Buffer" +#, fuzzy +#| msgid "" +#| "time format used in answer to message CTCP TIME (see man strftime for " +#| "date/time specifiers)" msgid "" "time format used in answer to message CTCP TIME (see man strftime for date/" -"time specifiers)" +"time specifiers, extra specifiers are supported, see function " +"util_strftimeval in Plugin API reference)" msgstr "" "Format für die Zeitanzeige die bei einer CTCP TIME Anfrage zurückgesendet " "wird (siehe man strftime, welche Platzhalter für das Datum und die Uhrzeit " @@ -13676,7 +13706,13 @@ msgstr "" "Option ändern,sollte sie zuerst den Komprimierungstyp über die Option logger." "file festlegen.rotation_compression_type" -msgid "timestamp used in log files (see man strftime for date/time specifiers)" +#, fuzzy +#| msgid "" +#| "timestamp used in log files (see man strftime for date/time specifiers)" +msgid "" +"timestamp used in log files (see man strftime for date/time specifiers, " +"extra specifiers are supported, see function util_strftimeval in Plugin API " +"reference)" msgstr "" "Zeitstempel in Protokoll-Datei nutzen (siehe man strftime, welche " "Platzhalter für das Datum und die Uhrzeit verwendet werden)" @@ -16433,8 +16469,7 @@ msgstr "verwaltet Trigger, das Schweizer Armeemesser für WeeChat" msgid "" "list [-o|-ol|-i|-il] || listfull || listdefault || add|addoff|addreplace " " " -"[\"\" [\"\" [\"\" [\"\" [\"<" -"return_code>\" [\"\"]]]]]] " +"[\"\" [\"\" [\"\" [\"\" [\"\" [\"\"]]]]]] " "|| addinput [] || input|output|recreate || set