Greenbone Security Assistant
Macros | Functions
gsad_i18n.c File Reference

I18n support for Greenbone Security Assistant. More...

#include "gsad_i18n.h"
#include "gsad_base.h"
#include <assert.h>
#include <dirent.h>
#include <errno.h>
#include <glib.h>
#include <libintl.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <locale.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

Macros

#define _GNU_SOURCE
 
#define G_LOG_DOMAIN   "gsad i18n"
 GLib log domain. More...
 

Functions

gchar * accept_language_to_env_fmt (const char *accept_language)
 Convert an Accept-Language string to the LANGUAGE env variable form. More...
 

Detailed Description

I18n support for Greenbone Security Assistant.

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "gsad i18n"

GLib log domain.

Function Documentation

◆ accept_language_to_env_fmt()

gchar* accept_language_to_env_fmt ( const char *  accept_language)

Convert an Accept-Language string to the LANGUAGE env variable form.

Converts the language preferences as defined in a HTTP Accept-Language header to a colon-separated list of language codes as used by gettext in the LANGUAGE environment variable.

Parameters
[in]accept_languageHTTP Accept-Language header text.
Returns
Newly allocated string of language codes as used by gettext. If accept_language is NULL or it doesn't contain a language DEFAULT_GSAD_LANGUAGE is returned.