klavaro  3.13
About: Klavaro is a touch typing tutor program.
  Fossies Dox: klavaro-3.13.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

translation.c File Reference
#include <stdio.h>
#include <string.h>
#include <locale.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <gtk/gtk.h>
#include "auxiliar.h"
#include "main.h"
#include "callbacks.h"
#include "keyboard.h"
#include "velocity.h"
#include "fluidness.h"
#include "translation.h"
Include dependency graph for translation.c:

Go to the source code of this file.

Macros

#define COUNTRY_N   50
 

Functions

const gchar * trans_code_to_country (gchar *code)
 
gchar * trans_get_default_keyboard ()
 
void trans_init_lang_name_code ()
 
gchar * trans_get_code (gint i)
 
gboolean trans_lang_is_available (gchar *langcode)
 
gboolean trans_lang_has_stopmark ()
 
static gboolean trans_lang_get_similar (gchar *test)
 
void trans_init_language_env ()
 
void trans_set_combo_language ()
 
gchar * trans_get_current_language ()
 
void trans_change_language (gchar *language)
 
FILE * trans_lang_get_similar_file (const gchar *file_end)
 
gchar * trans_lang_get_similar_file_name (const gchar *file_end)
 
gchar * trans_read_text (const gchar *file_end)
 

Variables

static Lang_Name_Codelang
 
static gint lang_num = 0
 

Macro Definition Documentation

◆ COUNTRY_N

#define COUNTRY_N   50

Function Documentation

◆ trans_change_language()

void trans_change_language ( gchar *  language)

Update the current language used accordingly to that selected in the 'combo_language'

Definition at line 498 of file translation.c.

References _, fluid_reset_paragraph(), get_wg(), i, lang, lang_num, language, main_preferences_set_string(), name, and velo_reset_dict().

Referenced by on_combobox_language_changed(), and on_combobox_top10_language_changed().

◆ trans_code_to_country()

const gchar* trans_code_to_country ( gchar *  code)

Get country name from its "ISO code" (eo and xx are just languages...)

Definition at line 46 of file translation.c.

References COUNTRY_N, and i.

Referenced by keyb_get_country().

◆ trans_get_code()

gchar* trans_get_code ( gint  i)

Definition at line 218 of file translation.c.

References i, lang, and lang_num.

Referenced by top10_get_score_file().

◆ trans_get_current_language()

gchar* trans_get_current_language ( void  )

Get the current language name, mapped from the preference's key code

Definition at line 471 of file translation.c.

References i, lang, lang_num, main_preferences_get_string(), and name.

Referenced by on_combobox_stat_module_changed(), plot_draw_chart(), and tutor_calc_stats().

◆ trans_get_default_keyboard()

gchar* trans_get_default_keyboard ( void  )

Get a 'reazonable' value for keyboard, that is, QWERTY... :-(

Definition at line 120 of file translation.c.

References i, lang, lang_num, and main_preferences_get_string().

Referenced by keyb_set_chars(), and keyb_set_combo_kbd().

◆ trans_init_lang_name_code()

void trans_init_lang_name_code ( void  )

Initialize 'lang', 'code' and 'kbd' accordingly to 'language_set', which was defined in "languages.h".

Definition at line 148 of file translation.c.

References Lang_Name_Code::cd, Lang_Name_Code::code, i, Lang_Name_Code::kbd, lang, lang_num, LANG_SET, and Lang_Name_Code::name.

Referenced by main_initialize_global_variables().

◆ trans_init_language_env()

void trans_init_language_env ( void  )

◆ trans_lang_get_similar()

static gboolean trans_lang_get_similar ( gchar *  test)
static

Private auxiliar function

Definition at line 260 of file translation.c.

References i, lang, and lang_num.

Referenced by trans_init_language_env().

◆ trans_lang_get_similar_file()

FILE* trans_lang_get_similar_file ( const gchar *  file_end)

Find a file whose language prefix is similar to the current one

Definition at line 537 of file translation.c.

References i, lang, lang_num, main_path_data(), and main_preferences_get_string().

Referenced by fluid_init_paragraph_list(), and trans_read_text().

◆ trans_lang_get_similar_file_name()

gchar* trans_lang_get_similar_file_name ( const gchar *  file_end)

Find a file whose language prefix is similar to the current one, returnig its name

Definition at line 570 of file translation.c.

References i, lang, lang_num, main_path_data(), and main_preferences_get_string().

Referenced by tutor_char_distribution_approved(), and velo_init_dict().

◆ trans_lang_has_stopmark()

gboolean trans_lang_has_stopmark ( void  )

Define if we may put a stop mark at the end of "phrases".

Definition at line 240 of file translation.c.

References main_preferences_get_string().

Referenced by adapt_create_word(), adapt_draw_random_pattern(), and velo_draw_random_words().

◆ trans_lang_is_available()

gboolean trans_lang_is_available ( gchar *  langcode)

Definition at line 226 of file translation.c.

References i, lang, and lang_num.

Referenced by trans_init_language_env().

◆ trans_read_text()

gchar* trans_read_text ( const gchar *  file_end)

Reads the text of a file to be presented at some dialog, accordingly to the environment language. 'text': new buffer where the text is copied into. 'file_end': how the file name ends

Definition at line 604 of file translation.c.

References _, main_path_data(), main_path_user(), main_preferences_get_string(), main_preferences_set_string(), pos, and trans_lang_get_similar_file().

Referenced by tutor_update_intro().

◆ trans_set_combo_language()

void trans_set_combo_language ( void  )

Inserts the list of available languages in the 'combo_language'.

Definition at line 398 of file translation.c.

References callbacks_shield_set(), get_wg(), i, lang, lang_num, main_preferences_get_string(), main_preferences_set_string(), and name.

Referenced by main_window_init().

Variable Documentation

◆ lang

◆ lang_num