2021-02-18 22:25:36 +01:00
|
|
|
#include "fastfetch.h"
|
|
|
|
|
|
|
|
|
|
void ffPrintLocale(FFstate* state)
|
|
|
|
|
{
|
2021-02-22 16:52:51 +01:00
|
|
|
if(ffPrintCachedValue(state, "Locale"))
|
|
|
|
|
return;
|
|
|
|
|
|
2021-02-18 22:25:36 +01:00
|
|
|
char locale[256];
|
|
|
|
|
ffParsePropFile("/etc/locale.conf", "LANG=%[^\n]", locale);
|
2021-02-19 16:23:41 +01:00
|
|
|
if(locale[0] == '\0')
|
|
|
|
|
{
|
2021-02-20 19:08:23 +01:00
|
|
|
ffPrintError(state, "Locale", "\"LANG=%[^\\n]\" not found in \"/etc/locale.conf\"");
|
2021-02-19 16:23:41 +01:00
|
|
|
return;
|
|
|
|
|
}
|
2021-02-18 22:25:36 +01:00
|
|
|
|
2021-02-22 20:53:12 +01:00
|
|
|
ffPrintAndSaveCachedValue(state, "Locale", locale);
|
2021-02-18 22:25:36 +01:00
|
|
|
}
|