diff options
Diffstat (limited to 'modules/computer')
| -rw-r--r-- | modules/computer/os.c | 15 | 
1 files changed, 10 insertions, 5 deletions
diff --git a/modules/computer/os.c b/modules/computer/os.c index b6975854..fa9bb476 100644 --- a/modules/computer/os.c +++ b/modules/computer/os.c @@ -158,12 +158,17 @@ detect_desktop_environment(OperatingSystem * os)  gchar *  computer_get_entropy_avail(void)  { +    gchar tab_entropy_fstr[][32] = { +      N_(/*/bits of entropy for rng (0)*/              "(None or not available)"), +      N_(/*/bits of entropy for rng (low/poor value)*/  "%d bits (low)"), +      N_(/*/bits of entropy for rng (medium value)*/    "%d bits (medium)"), +      N_(/*/bits of entropy for rng (high/good value)*/ "%d bits (healthy)") +    };      gint bits = h_sysfs_read_int("/proc/sys/kernel/random", "entropy_avail"); -    if (bits < 200) -        return g_strdup_printf("%d bits (low)", bits); -    if (bits < 3000) -        return g_strdup_printf("%d bits (medium)", bits); -    return g_strdup_printf("%d bits (healthy)", bits); +    if (bits > 3000) return g_strdup_printf(_(tab_entropy_fstr[3]), bits); +    if (bits > 200)  return g_strdup_printf(_(tab_entropy_fstr[2]), bits); +    if (bits > 1)    return g_strdup_printf(_(tab_entropy_fstr[1]), bits); +    return g_strdup_printf(_(tab_entropy_fstr[0]), bits);  }  OperatingSystem *  | 
