speakup: Separate out translations for bright colors names
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 13 Jun 2021 19:59:09 +0000 (21:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Jun 2021 15:07:46 +0000 (17:07 +0200)
The existing code was assuming that bright color names can be forged by just
prepending the "bright" word to the color name. But some langages may rather
append it, or require completely different names ("grey" is actually already an
example).

From: Trevor Astrope <astrope@tabbweb.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Link: https://lore.kernel.org/r/20210613195909.n7ssor6iqeo3pcno@begin
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/accessibility/speakup/i18n.c
drivers/accessibility/speakup/i18n.h
drivers/accessibility/speakup/main.c

index 46bd50f3c3a42c119e1523cb7f1f6cb64fb8cbe6..bc7b47d1876fd277894831d73975ad6bf3444754 100644 (file)
@@ -90,6 +90,13 @@ static char *speakup_default_msgs[MSG_LAST_INDEX] = {
        [MSG_COLOR_YELLOW] = "yellow",
        [MSG_COLOR_WHITE] = "white",
        [MSG_COLOR_GREY] = "grey",
+       [MSG_COLOR_BRIGHTBLUE] "bright blue",
+       [MSG_COLOR_BRIGHTGREEN] "bright green",
+       [MSG_COLOR_BRIGHTCYAN] "bright cyan",
+       [MSG_COLOR_BRIGHTRED] "bright red",
+       [MSG_COLOR_BRIGHTMAGENTA] "bright magenta",
+       [MSG_COLOR_BRIGHTYELLOW] "bright yellow",
+       [MSG_COLOR_BRIGHTWHITE] "bright white",
 
        /* Names of key states. */
        [MSG_STATE_DOUBLE] = "double",
index 2a607d2632340ac4ff0c3e57ea12b271b463a10c..51e3260995d980b759a2e175675b074dbf71941e 100644 (file)
@@ -99,7 +99,14 @@ enum msg_index_t {
        MSG_COLOR_YELLOW,
        MSG_COLOR_WHITE,
        MSG_COLOR_GREY,
-       MSG_COLORS_END = MSG_COLOR_GREY,
+       MSG_COLOR_BRIGHTBLUE,
+       MSG_COLOR_BRIGHTGREEN,
+       MSG_COLOR_BRIGHTCYAN,
+       MSG_COLOR_BRIGHTRED,
+       MSG_COLOR_BRIGHTMAGENTA,
+       MSG_COLOR_BRIGHTYELLOW,
+       MSG_COLOR_BRIGHTWHITE,
+       MSG_COLORS_END = MSG_COLOR_BRIGHTWHITE,
 
        MSG_STATES_START,
        MSG_STATE_DOUBLE = MSG_STATES_START,
index 428fceaf9d50e9386b8c8ea58920dad0868d055d..d726537fa16ce0f6e881a1ac3707f8d4576fa0d0 100644 (file)
@@ -389,10 +389,6 @@ static void say_attributes(struct vc_data *vc)
        int fg = spk_attr & 0x0f;
        int bg = spk_attr >> 4;
 
-       if (fg > 8) {
-               synth_printf("%s ", spk_msg_get(MSG_BRIGHT));
-               fg -= 8;
-       }
        synth_printf("%s", spk_msg_get(MSG_COLORS_START + fg));
        if (bg > 7) {
                synth_printf(" %s ", spk_msg_get(MSG_ON_BLINKING));