diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-11-05 11:40:22 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-11-05 11:40:22 +0100 |
commit | 8e5288ba27db92f4aa21a8ade5af57fd1d9dbe7f (patch) | |
tree | b2f15638f247a3f9dfd7a4c7c140d3d25949349c | |
parent | 3ec981877ab0ca8d7a25c7bf30a0dbbe50b96cb4 (diff) | |
download | weechat-8e5288ba27db92f4aa21a8ade5af57fd1d9dbe7f.zip |
irc: add option irc.color.mirc_remap to remap mirc colors in messages to WeeChat colors
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | doc/de/autogen/user/irc_options.txt | 5 | ||||
-rw-r--r-- | doc/en/autogen/user/irc_options.txt | 5 | ||||
-rw-r--r-- | doc/fr/autogen/user/irc_options.txt | 5 | ||||
-rw-r--r-- | doc/it/autogen/user/irc_options.txt | 5 | ||||
-rw-r--r-- | po/cs.po | 14 | ||||
-rw-r--r-- | po/de.po | 14 | ||||
-rw-r--r-- | po/es.po | 14 | ||||
-rw-r--r-- | po/fr.po | 25 | ||||
-rw-r--r-- | po/hu.po | 14 | ||||
-rw-r--r-- | po/it.po | 14 | ||||
-rw-r--r-- | po/pl.po | 14 | ||||
-rw-r--r-- | po/pt_BR.po | 14 | ||||
-rw-r--r-- | po/ru.po | 14 | ||||
-rw-r--r-- | po/weechat.pot | 14 | ||||
-rw-r--r-- | src/plugins/irc/irc-color.c | 26 | ||||
-rw-r--r-- | src/plugins/irc/irc-config.c | 74 | ||||
-rw-r--r-- | src/plugins/irc/irc-config.h | 2 |
18 files changed, 259 insertions, 18 deletions
@@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu <flashcode@flashtux.org> -v0.3.7-dev, 2011-11-04 +v0.3.7-dev, 2011-11-05 Version 0.3.7 (under dev!) @@ -17,6 +17,8 @@ Version 0.3.7 (under dev!) * core: fix compilation error with "pid_t" on Mac OS X (bug #34639) * core: enable background process under Cygwin to connect to servers, fix reconnection problem (bug #34626) +* irc: add option irc.color.mirc_remap to remap mirc colors in messages to + WeeChat colors * irc: allow URL "irc://" in command /connect * irc: auto-connect to servers created with "irc://" on command line but not other servers if "-a" ("--no-connect") is given diff --git a/doc/de/autogen/user/irc_options.txt b/doc/de/autogen/user/irc_options.txt index 4be8a5c90..9626ff59c 100644 --- a/doc/de/autogen/user/irc_options.txt +++ b/doc/de/autogen/user/irc_options.txt @@ -33,6 +33,11 @@ ** Typ: Farbe ** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute werden vor einer Farbe gesetzt (ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "_" für unterstrichen (Standardwert: `red`) +* *irc.color.mirc_remap* +** Beschreibung: `remap mirc colors in messages using a hashtable: keys are "fg,bg" as integers between -1 (not specified) and 15, values are WeeChat color names or numbers (format is: "1,-1:color1;2,7:color2"), example: "1,-1:darkgray;1,2:white,blue" to remap black on any bg to "darkgray" and black on blue to "white,blue"; default WeeChat colors for IRC codes: 0:white, 1:black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, 15:white` +** Typ: Zeichenkette +** Werte: beliebige Zeichenkette (Standardwert: `"1,-1:darkgray"`) + * *irc.color.nick_prefix* ** Beschreibung: `Farbe für den Nick Präfix (Präfix ist die editierbare Zeichenkette die vor dem Nick steht)` ** Typ: Farbe diff --git a/doc/en/autogen/user/irc_options.txt b/doc/en/autogen/user/irc_options.txt index 01463a3fb..72e1b78f7 100644 --- a/doc/en/autogen/user/irc_options.txt +++ b/doc/en/autogen/user/irc_options.txt @@ -33,6 +33,11 @@ ** type: color ** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "_" for underline (default value: `red`) +* *irc.color.mirc_remap* +** description: `remap mirc colors in messages using a hashtable: keys are "fg,bg" as integers between -1 (not specified) and 15, values are WeeChat color names or numbers (format is: "1,-1:color1;2,7:color2"), example: "1,-1:darkgray;1,2:white,blue" to remap black on any bg to "darkgray" and black on blue to "white,blue"; default WeeChat colors for IRC codes: 0:white, 1:black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, 15:white` +** type: string +** values: any string (default value: `"1,-1:darkgray"`) + * *irc.color.nick_prefix* ** description: `color for nick prefix (prefix is custom string displayed before nick)` ** type: color diff --git a/doc/fr/autogen/user/irc_options.txt b/doc/fr/autogen/user/irc_options.txt index 5cc6dfd98..4a62b64e5 100644 --- a/doc/fr/autogen/user/irc_options.txt +++ b/doc/fr/autogen/user/irc_options.txt @@ -33,6 +33,11 @@ ** type: couleur ** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour du gras, "!" pour la vidéo inverse, "_" pour du souligné (valeur par défaut: `red`) +* *irc.color.mirc_remap* +** description: `réassigner les couleurs mirc dans les messages en utilisant une hashtable: les clés sont "fg,bg" sous forme d'entiers entre -1 (non spécifié) et 15, les valeurs sont des noms de couleur WeeChat ou nombres (le format est: "1,-1:couleur1;2,7:couleur2"), exemple: "1,-1:darkgray;1,2:white,blue" pour réassigner le noir sur n'importe quel fond en "darkgray" et le noir sur bleu en "white,blue"; les couleurs WeeChat par défaut pour les codes IRC sont: 0:white, 1:black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9:lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, 15:white` +** type: chaîne +** valeurs: toute chaîne (valeur par défaut: `"1,-1:darkgray"`) + * *irc.color.nick_prefix* ** description: `couleur pour le préfixe du pseudo (le préfixe est une chaîne personnalisée affichée avant le pseudo)` ** type: couleur diff --git a/doc/it/autogen/user/irc_options.txt b/doc/it/autogen/user/irc_options.txt index aceb91864..c72dd7591 100644 --- a/doc/it/autogen/user/irc_options.txt +++ b/doc/it/autogen/user/irc_options.txt @@ -33,6 +33,11 @@ ** tipo: colore ** valori: un nome colore di WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numero colore del terminale o un alias; attributi consentiti prima del colore (solo per il colore del testo, non lo sfondo): "*" per il grassetto, "!" per l'inverso, "_" per la sottolineatura (valore predefinito: `red`) +* *irc.color.mirc_remap* +** descrizione: `remap mirc colors in messages using a hashtable: keys are "fg,bg" as integers between -1 (not specified) and 15, values are WeeChat color names or numbers (format is: "1,-1:color1;2,7:color2"), example: "1,-1:darkgray;1,2:white,blue" to remap black on any bg to "darkgray" and black on blue to "white,blue"; default WeeChat colors for IRC codes: 0:white, 1:black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, 15:white` +** tipo: stringa +** valori: qualsiasi stringa (valore predefinito: `"1,-1:darkgray"`) + * *irc.color.nick_prefix* ** descrizione: `colore per il prefisso del nick (il prefisso è la stringa personalizzata visualizzata prima del nick)` ** tipo: colore @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-11-04 12:41+0100\n" +"POT-Creation-Date: 2011-11-05 11:34+0100\n" "PO-Revision-Date: 2011-11-03 16:57+0100\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5634,6 +5634,18 @@ msgstr "barva textu vezprávách připojení" msgid "color for text in part/quit messages" msgstr "barva textu ve zprávách odchodu/ukončení" +#. TRANSLATORS: please do not translate the list of WeeChat color names at the end of string +msgid "" +"remap mirc colors in messages using a hashtable: keys are \"fg,bg\" as " +"integers between -1 (not specified) and 15, values are WeeChat color names " +"or numbers (format is: \"1,-1:color1;2,7:color2\"), example: \"1,-1:" +"darkgray;1,2:white,blue\" to remap black on any bg to \"darkgray\" and black " +"on blue to \"white,blue\"; default WeeChat colors for IRC codes: 0:white, 1:" +"black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: " +"lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, " +"15:white" +msgstr "" + msgid "" "color for nick prefixes using mode char (o=op, h=halfop, v=voice, ..), " "format is: \"o:color1;h:color2;v:color3\" (if a mode is not found, WeeChat " @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-11-04 12:41+0100\n" +"POT-Creation-Date: 2011-11-05 11:34+0100\n" "PO-Revision-Date: 2011-11-03 16:57+0100\n" "Last-Translator: Nils Görs\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -6002,6 +6002,18 @@ msgstr "" "Textfarbe in der die Meldungen für das Verlassen/Beenden eines Channels " "angezeigt werden soll" +#. TRANSLATORS: please do not translate the list of WeeChat color names at the end of string +msgid "" +"remap mirc colors in messages using a hashtable: keys are \"fg,bg\" as " +"integers between -1 (not specified) and 15, values are WeeChat color names " +"or numbers (format is: \"1,-1:color1;2,7:color2\"), example: \"1,-1:" +"darkgray;1,2:white,blue\" to remap black on any bg to \"darkgray\" and black " +"on blue to \"white,blue\"; default WeeChat colors for IRC codes: 0:white, 1:" +"black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: " +"lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, " +"15:white" +msgstr "" + msgid "" "color for nick prefixes using mode char (o=op, h=halfop, v=voice, ..), " "format is: \"o:color1;h:color2;v:color3\" (if a mode is not found, WeeChat " @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-11-04 12:41+0100\n" +"POT-Creation-Date: 2011-11-05 11:34+0100\n" "PO-Revision-Date: 2011-11-03 16:57+0100\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5824,6 +5824,18 @@ msgstr "color para el texto en mensajes de unión" msgid "color for text in part/quit messages" msgstr "color para el texto en mensajes de salida/abandono" +#. TRANSLATORS: please do not translate the list of WeeChat color names at the end of string +msgid "" +"remap mirc colors in messages using a hashtable: keys are \"fg,bg\" as " +"integers between -1 (not specified) and 15, values are WeeChat color names " +"or numbers (format is: \"1,-1:color1;2,7:color2\"), example: \"1,-1:" +"darkgray;1,2:white,blue\" to remap black on any bg to \"darkgray\" and black " +"on blue to \"white,blue\"; default WeeChat colors for IRC codes: 0:white, 1:" +"black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: " +"lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, " +"15:white" +msgstr "" + msgid "" "color for nick prefixes using mode char (o=op, h=halfop, v=voice, ..), " "format is: \"o:color1;h:color2;v:color3\" (if a mode is not found, WeeChat " @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-11-04 12:41+0100\n" -"PO-Revision-Date: 2011-11-04 12:42+0100\n" +"POT-Creation-Date: 2011-11-05 11:34+0100\n" +"PO-Revision-Date: 2011-11-05 11:34+0100\n" "Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: French\n" @@ -5870,6 +5870,27 @@ msgstr "couleur pour le texte dans les messages join" msgid "color for text in part/quit messages" msgstr "couleur pour le texte dans les messages part/quit" +#. TRANSLATORS: please do not translate the list of WeeChat color names at the end of string +msgid "" +"remap mirc colors in messages using a hashtable: keys are \"fg,bg\" as " +"integers between -1 (not specified) and 15, values are WeeChat color names " +"or numbers (format is: \"1,-1:color1;2,7:color2\"), example: \"1,-1:" +"darkgray;1,2:white,blue\" to remap black on any bg to \"darkgray\" and black " +"on blue to \"white,blue\"; default WeeChat colors for IRC codes: 0:white, 1:" +"black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: " +"lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, " +"15:white" +msgstr "" +"réassigner les couleurs mirc dans les messages en utilisant une hashtable: " +"les clés sont \"fg,bg\" sous forme d'entiers entre -1 (non spécifié) et 15, " +"les valeurs sont des noms de couleur WeeChat ou nombres (le format est: " +"\"1,-1:couleur1;2,7:couleur2\"), exemple: \"1,-1:darkgray;1,2:white,blue\" " +"pour réassigner le noir sur n'importe quel fond en \"darkgray\" et le noir " +"sur bleu en \"white,blue\"; les couleurs WeeChat par défaut pour les codes " +"IRC sont: 0:white, 1:black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:" +"brown, 8:yellow, 9:lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:" +"lightmagenta, 14:gray, 15:white" + msgid "" "color for nick prefixes using mode char (o=op, h=halfop, v=voice, ..), " "format is: \"o:color1;h:color2;v:color3\" (if a mode is not found, WeeChat " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-11-04 12:41+0100\n" +"POT-Creation-Date: 2011-11-05 11:34+0100\n" "PO-Revision-Date: 2011-10-22 12:21+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5212,6 +5212,18 @@ msgstr "új üzenetet tartalmazó ablak színe" msgid "color for text in part/quit messages" msgstr "alapértelmezett kilépő üzenet" +#. TRANSLATORS: please do not translate the list of WeeChat color names at the end of string +msgid "" +"remap mirc colors in messages using a hashtable: keys are \"fg,bg\" as " +"integers between -1 (not specified) and 15, values are WeeChat color names " +"or numbers (format is: \"1,-1:color1;2,7:color2\"), example: \"1,-1:" +"darkgray;1,2:white,blue\" to remap black on any bg to \"darkgray\" and black " +"on blue to \"white,blue\"; default WeeChat colors for IRC codes: 0:white, 1:" +"black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: " +"lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, " +"15:white" +msgstr "" + msgid "" "color for nick prefixes using mode char (o=op, h=halfop, v=voice, ..), " "format is: \"o:color1;h:color2;v:color3\" (if a mode is not found, WeeChat " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-11-04 12:41+0100\n" +"POT-Creation-Date: 2011-11-05 11:34+0100\n" "PO-Revision-Date: 2011-11-03 16:57+0100\n" "Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5815,6 +5815,18 @@ msgstr "colore per il testo nei messaggi di entrata" msgid "color for text in part/quit messages" msgstr "colore per il testo nei messaggi di uscita/abbandono" +#. TRANSLATORS: please do not translate the list of WeeChat color names at the end of string +msgid "" +"remap mirc colors in messages using a hashtable: keys are \"fg,bg\" as " +"integers between -1 (not specified) and 15, values are WeeChat color names " +"or numbers (format is: \"1,-1:color1;2,7:color2\"), example: \"1,-1:" +"darkgray;1,2:white,blue\" to remap black on any bg to \"darkgray\" and black " +"on blue to \"white,blue\"; default WeeChat colors for IRC codes: 0:white, 1:" +"black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: " +"lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, " +"15:white" +msgstr "" + msgid "" "color for nick prefixes using mode char (o=op, h=halfop, v=voice, ..), " "format is: \"o:color1;h:color2;v:color3\" (if a mode is not found, WeeChat " @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-11-04 12:41+0100\n" +"POT-Creation-Date: 2011-11-05 11:34+0100\n" "PO-Revision-Date: 2011-11-03 16:57+0100\n" "Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5787,6 +5787,18 @@ msgstr "kolor tekstu w wiadomościach o wejściu na kanał" msgid "color for text in part/quit messages" msgstr "kolor tekstu w wiadomościach o opuszczeniu kanału/wyjściu z IRC" +#. TRANSLATORS: please do not translate the list of WeeChat color names at the end of string +msgid "" +"remap mirc colors in messages using a hashtable: keys are \"fg,bg\" as " +"integers between -1 (not specified) and 15, values are WeeChat color names " +"or numbers (format is: \"1,-1:color1;2,7:color2\"), example: \"1,-1:" +"darkgray;1,2:white,blue\" to remap black on any bg to \"darkgray\" and black " +"on blue to \"white,blue\"; default WeeChat colors for IRC codes: 0:white, 1:" +"black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: " +"lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, " +"15:white" +msgstr "" + msgid "" "color for nick prefixes using mode char (o=op, h=halfop, v=voice, ..), " "format is: \"o:color1;h:color2;v:color3\" (if a mode is not found, WeeChat " diff --git a/po/pt_BR.po b/po/pt_BR.po index f600518dd..0504249f6 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-11-04 12:41+0100\n" +"POT-Creation-Date: 2011-11-05 11:34+0100\n" "PO-Revision-Date: 2011-11-03 16:58+0100\n" "Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5292,6 +5292,18 @@ msgstr "" msgid "color for text in part/quit messages" msgstr "" +#. TRANSLATORS: please do not translate the list of WeeChat color names at the end of string +msgid "" +"remap mirc colors in messages using a hashtable: keys are \"fg,bg\" as " +"integers between -1 (not specified) and 15, values are WeeChat color names " +"or numbers (format is: \"1,-1:color1;2,7:color2\"), example: \"1,-1:" +"darkgray;1,2:white,blue\" to remap black on any bg to \"darkgray\" and black " +"on blue to \"white,blue\"; default WeeChat colors for IRC codes: 0:white, 1:" +"black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: " +"lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, " +"15:white" +msgstr "" + msgid "" "color for nick prefixes using mode char (o=op, h=halfop, v=voice, ..), " "format is: \"o:color1;h:color2;v:color3\" (if a mode is not found, WeeChat " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-11-04 12:41+0100\n" +"POT-Creation-Date: 2011-11-05 11:34+0100\n" "PO-Revision-Date: 2011-10-22 12:21+0200\n" "Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5219,6 +5219,18 @@ msgstr "цвет текущего окна с сообщениями" msgid "color for text in part/quit messages" msgstr "сообщение о выходе по-умолчанию" +#. TRANSLATORS: please do not translate the list of WeeChat color names at the end of string +msgid "" +"remap mirc colors in messages using a hashtable: keys are \"fg,bg\" as " +"integers between -1 (not specified) and 15, values are WeeChat color names " +"or numbers (format is: \"1,-1:color1;2,7:color2\"), example: \"1,-1:" +"darkgray;1,2:white,blue\" to remap black on any bg to \"darkgray\" and black " +"on blue to \"white,blue\"; default WeeChat colors for IRC codes: 0:white, 1:" +"black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: " +"lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, " +"15:white" +msgstr "" + msgid "" "color for nick prefixes using mode char (o=op, h=halfop, v=voice, ..), " "format is: \"o:color1;h:color2;v:color3\" (if a mode is not found, WeeChat " diff --git a/po/weechat.pot b/po/weechat.pot index 98969dc75..c74e85844 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-11-04 12:41+0100\n" +"POT-Creation-Date: 2011-11-05 11:34+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -4490,6 +4490,18 @@ msgstr "" msgid "color for text in part/quit messages" msgstr "" +#. TRANSLATORS: please do not translate the list of WeeChat color names at the end of string +msgid "" +"remap mirc colors in messages using a hashtable: keys are \"fg,bg\" as " +"integers between -1 (not specified) and 15, values are WeeChat color names " +"or numbers (format is: \"1,-1:color1;2,7:color2\"), example: \"1,-1:" +"darkgray;1,2:white,blue\" to remap black on any bg to \"darkgray\" and black " +"on blue to \"white,blue\"; default WeeChat colors for IRC codes: 0:white, 1:" +"black, 2:blue, 3:green, 4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: " +"lightgreen, 10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, " +"15:white" +msgstr "" + msgid "" "color for nick prefixes using mode char (o=op, h=halfop, v=voice, ..), " "format is: \"o:color1;h:color2;v:color3\" (if a mode is not found, WeeChat " diff --git a/src/plugins/irc/irc-color.c b/src/plugins/irc/irc-color.c index 9b019e73f..34fe6589b 100644 --- a/src/plugins/irc/irc-color.c +++ b/src/plugins/irc/irc-color.c @@ -64,7 +64,8 @@ irc_color_decode (const char *string, int keep_colors) { unsigned char *out, *ptr_string; int out_length, length, out_pos; - char str_fg[3], str_bg[3], str_color[128]; + char str_fg[3], str_bg[3], str_color[128], str_key[128]; + const char *remapped_color; int fg, bg, bold, reverse, italic, underline, rc; out_length = (strlen (string) * 2) + 1; @@ -175,11 +176,24 @@ irc_color_decode (const char *string, int keep_colors) bg %= IRC_NUM_COLORS; } } - snprintf (str_color, sizeof (str_color), - "|%s%s%s", - (fg >= 0) ? irc_color_to_weechat[fg] : "", - (bg >= 0) ? "," : "", - (bg >= 0) ? irc_color_to_weechat[bg] : ""); + /* search "fg,bg" in hashtable of remapped colors */ + snprintf (str_key, sizeof (str_key), "%d,%d", fg, bg); + remapped_color = weechat_hashtable_get ( + irc_config_hashtable_color_mirc_remap, + str_key); + if (remapped_color) + { + snprintf (str_color, sizeof (str_color), + "|%s", remapped_color); + } + else + { + snprintf (str_color, sizeof (str_color), + "|%s%s%s", + (fg >= 0) ? irc_color_to_weechat[fg] : "", + (bg >= 0) ? "," : "", + (bg >= 0) ? irc_color_to_weechat[bg] : ""); + } strcat ((char *)out, weechat_color(str_color)); } else diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 1fede24b7..d711ff34d 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -99,6 +99,7 @@ struct t_config_option *irc_config_look_topic_strip_colors; struct t_config_option *irc_config_color_message_join; struct t_config_option *irc_config_color_message_quit; +struct t_config_option *irc_config_color_mirc_remap; struct t_config_option *irc_config_color_nick_prefixes; struct t_config_option *irc_config_color_nick_prefix; struct t_config_option *irc_config_color_nick_suffix; @@ -135,6 +136,7 @@ char **irc_config_nick_colors = NULL; int irc_config_num_nick_colors = 0; struct t_hashtable *irc_config_hashtable_nick_color_force = NULL; struct t_hashtable *irc_config_hashtable_nick_prefixes = NULL; +struct t_hashtable *irc_config_hashtable_color_mirc_remap = NULL; int irc_config_write_temp_servers = 0; @@ -591,6 +593,51 @@ irc_config_change_color_item_lag (void *data, } /* + * irc_config_change_color_mirc_remap: called when the "mirc remap" option is + * changed + */ + +void +irc_config_change_color_mirc_remap (void *data, struct t_config_option *option) +{ + char **items, *pos; + int num_items, i; + + /* make C compiler happy */ + (void) data; + (void) option; + + if (!irc_config_hashtable_color_mirc_remap) + { + irc_config_hashtable_color_mirc_remap = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); + } + else + weechat_hashtable_remove_all (irc_config_hashtable_color_mirc_remap); + + items = weechat_string_split (weechat_config_string (irc_config_color_mirc_remap), + ";", 0, 0, &num_items); + if (items) + { + for (i = 0; i < num_items; i++) + { + pos = strchr (items[i], ':'); + if (pos) + { + pos[0] = '\0'; + weechat_hashtable_set (irc_config_hashtable_color_mirc_remap, + items[i], + pos + 1); + } + } + weechat_string_free_split (items); + } +} + +/* * irc_config_change_color_nick_prefixes: called when the string with color of * nick prefixes is changed */ @@ -1903,6 +1950,11 @@ irc_config_init () { struct t_config_section *ptr_section; + irc_config_hashtable_color_mirc_remap = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); irc_config_hashtable_nick_color_force = weechat_hashtable_new (8, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, @@ -2241,6 +2293,21 @@ irc_config_init () N_("color for text in part/quit messages"), NULL, -1, 0, "red", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_color_mirc_remap = weechat_config_new_option ( + irc_config_file, ptr_section, + "mirc_remap", "string", + /* TRANSLATORS: please do not translate the list of WeeChat color names at the end of string */ + N_("remap mirc colors in messages using a hashtable: keys are \"fg,bg\" " + "as integers between -1 (not specified) and 15, values are WeeChat " + "color names or numbers (format is: \"1,-1:color1;2,7:color2\"), " + "example: \"1,-1:darkgray;1,2:white,blue\" to remap black on any bg " + "to \"darkgray\" and black on blue to \"white,blue\"; default " + "WeeChat colors for IRC codes: 0:white, 1:black, 2:blue, 3:green, " + "4:lightred, 5:red, 6:magenta, 7:brown, 8:yellow, 9: lightgreen, " + "10:cyan, 11:lightcyan, 12:lightblue, 13:lightmagenta, 14:gray, " + "15:white"), + NULL, 0, 0, "1,-1:darkgray", NULL, 0, NULL, NULL, + &irc_config_change_color_mirc_remap, NULL, NULL, NULL); irc_config_color_nick_prefixes = weechat_config_new_option ( irc_config_file, ptr_section, "nick_prefixes", "string", @@ -2497,6 +2564,7 @@ irc_config_read () irc_notify_new_for_all_servers (); irc_config_change_look_nick_color_force (NULL, NULL); irc_config_change_color_nick_prefixes (NULL, NULL); + irc_config_change_color_mirc_remap (NULL, NULL); irc_config_change_network_notify_check_ison (NULL, NULL); irc_config_change_network_notify_check_whois (NULL, NULL); } @@ -2547,4 +2615,10 @@ irc_config_free () weechat_hashtable_free (irc_config_hashtable_nick_prefixes); irc_config_hashtable_nick_prefixes = NULL; } + + if (irc_config_hashtable_color_mirc_remap) + { + weechat_hashtable_free (irc_config_hashtable_color_mirc_remap); + irc_config_hashtable_color_mirc_remap = NULL; + } } diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index 4dd024551..f23b4dbc6 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -122,6 +122,7 @@ extern struct t_config_option *irc_config_look_topic_strip_colors; extern struct t_config_option *irc_config_color_message_join; extern struct t_config_option *irc_config_color_message_quit; +extern struct t_config_option *irc_config_color_mirc_remap; extern struct t_config_option *irc_config_color_nick_prefixes; extern struct t_config_option *irc_config_color_nick_prefix; extern struct t_config_option *irc_config_color_nick_suffix; @@ -154,6 +155,7 @@ extern int irc_config_num_nick_colors; extern struct t_hashtable *irc_config_hashtable_nick_color_force; extern struct t_hashtable *irc_config_hashtable_nick_prefixes; +extern struct t_hashtable *irc_config_hashtable_color_mirc_remap; extern void irc_config_set_nick_colors (); extern int irc_config_server_check_value_cb (void *data, |