Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
l10n.c File Reference
#include "system/macros.h"
#include "common/paths.h"
#include "system/mem_alloc.h"
#include "common/l10n.h"
#include "common/file_location.h"
#include "common/conf.h"
#include <libintl.h>
#include <locale.h>
#include <gtk/gtk.h>
#include <json-glib/json-glib.h>
#include "osx/osx.h"
#include "win/dtwin.h"
#include <windows.h>
+ Include dependency graph for l10n.c:

Go to the source code of this file.

Functions

static gchar * _dt_full_locale_name (const char *locale)
 
void dt_l10n_disable_setlocale_early (void)
 
static void set_locale (const char *ui_lang, const char *old_env)
 
static gint sort_languages (gconstpointer a, gconstpointer b)
 
static void get_language_names (GList *languages)
 
dt_l10n_tdt_l10n_init (gboolean init_list)
 
const char * dt_l10n_get_name (const dt_l10n_language_t *language)
 
const char * dt_l10n_get_current_lang (dt_l10n_t *l10n)
 
const char * dt_l10n_get_current_code (dt_l10n_t *l10n)
 

Variables

static gboolean _l10n_gtk_locale_disabled = FALSE
 

Function Documentation

◆ _dt_full_locale_name()

static gchar * _dt_full_locale_name ( const char *  locale)
static

Definition at line 49 of file l10n.c.

References dt_free, and error().

Referenced by set_locale().

◆ dt_l10n_disable_setlocale_early()

void dt_l10n_disable_setlocale_early ( void  )

Definition at line 92 of file l10n.c.

References _l10n_gtk_locale_disabled, and TRUE.

Referenced by main(), and set_locale().

◆ dt_l10n_get_current_code()

const char * dt_l10n_get_current_code ( dt_l10n_t l10n)

ISO code of the language the GUI currently runs in – "fr" for fr_FR, "de" for de_AT – or "C" when running untranslated. This is the machine-readable half of the pair: dt_l10n_get_current_lang() returns the human-readable name shown in preferences ("Francais (fr_FR)"), which is not usable as a file name suffix or a URL segment.

Definition at line 463 of file l10n.c.

References dt_l10n_language_t::base_code, dt_l10n_language_t::code, IS_NULL_PTR, dt_l10n_t::languages, and dt_l10n_t::selected.

Referenced by _on_capture().

◆ dt_l10n_get_current_lang()

const char * dt_l10n_get_current_lang ( dt_l10n_t l10n)

Definition at line 457 of file l10n.c.

References dt_l10n_t::languages, and dt_l10n_t::selected.

Referenced by dt_gui_gtk_init().

◆ dt_l10n_get_name()

const char * dt_l10n_get_name ( const dt_l10n_language_t language)

Definition at line 450 of file l10n.c.

References dt_l10n_language_t::code, IS_NULL_PTR, and dt_l10n_language_t::name.

Referenced by init_tab_general(), and sort_languages().

◆ dt_l10n_init()

◆ get_language_names()

◆ set_locale()

static void set_locale ( const char *  ui_lang,
const char *  old_env 
)
static

Definition at line 99 of file l10n.c.

References _dt_full_locale_name(), dt_free, dt_l10n_disable_setlocale_early(), and TRUE.

Referenced by dt_l10n_init().

◆ sort_languages()

static gint sort_languages ( gconstpointer  a,
gconstpointer  b 
)
static

Definition at line 120 of file l10n.c.

References dt_free, and dt_l10n_get_name().

Referenced by dt_l10n_init().

Variable Documentation

◆ _l10n_gtk_locale_disabled

gboolean _l10n_gtk_locale_disabled = FALSE
static

Definition at line 90 of file l10n.c.

Referenced by dt_l10n_disable_setlocale_early().