From 0bb72abc462d42af051bebf5f4093bb1735ad448 Mon Sep 17 00:00:00 2001 From: Burt P Date: Sat, 15 Jul 2017 01:31:47 -0500 Subject: Make cache type strings translatable Signed-off-by: Burt P --- modules/devices/x86/processor.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'modules/devices/x86/processor.c') diff --git a/modules/devices/x86/processor.c b/modules/devices/x86/processor.c index 9adfe9c8..f6b9963c 100644 --- a/modules/devices/x86/processor.c +++ b/modules/devices/x86/processor.c @@ -152,7 +152,7 @@ static gchar *__cache_get_info_as_string(Processor *processor) result = h_strdup_cprintf(_("Level %d (%s)=%d-way set-associative, %d sets, %dKB size\n"), result, cache->level, - cache->type, + C_("cache-type", cache->type), cache->ways_of_associativity, cache->number_of_sets, cache->size); @@ -161,6 +161,14 @@ static gchar *__cache_get_info_as_string(Processor *processor) return result; } +/* This is not used directly, but creates translatable strings for + * the type string returned from /sys/.../cache */ +static const char* cache_types[] = { + NC_("cache-type", /*/cache type, as appears in: Level 1 (Data)*/ "Data"), + NC_("cache-type", /*/cache type, as appears in: Level 1 (Instruction)*/ "Instruction"), + NC_("cache-type", /*/cache type, as appears in: Level 2 (Unified)*/ "Unified") +}; + static void __cache_obtain_info(Processor *processor) { ProcessorCache *cache; -- cgit v1.2.3