Version 18.21

This commit is contained in:
Antonio Cañas Vargas 2018-12-08 16:43:13 +01:00
parent a5ae43670e
commit 9b5f4398b3
49 changed files with 325 additions and 360 deletions

View File

@ -127,7 +127,7 @@ void QR_ImageQRCode (const char *QRString)
void QR_LinkTo (unsigned Size,const char *ParamStr,long Cod) void QR_LinkTo (unsigned Size,const char *ParamStr,long Cod)
{ {
extern const char *Txt_Shortcut; extern const char *Txt_Shortcut;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
/***** Show QR code with direct link to the current centre *****/ /***** Show QR code with direct link to the current centre *****/
fprintf (Gbl.F.Out,"<img src=\"https://chart.googleapis.com/chart?cht=qr&amp;chs=%ux%u&amp;chl=%s/%s?%s=%ld\"" fprintf (Gbl.F.Out,"<img src=\"https://chart.googleapis.com/chart?cht=qr&amp;chs=%ux%u&amp;chl=%s/%s?%s=%ld\""
@ -135,7 +135,7 @@ void QR_LinkTo (unsigned Size,const char *ParamStr,long Cod)
" style=\"width:%upx; height:%upx;\" />", " style=\"width:%upx; height:%upx;\" />",
Size,Size, Size,Size,
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language],ParamStr,Cod, Lan_STR_LANG_ID[Gbl.Prefs.Language],ParamStr,Cod,
Txt_Shortcut, Txt_Shortcut,
Txt_Shortcut, Txt_Shortcut,
Size,Size); Size,Size);

View File

@ -706,7 +706,7 @@ void Acc_CreateNewUsr (struct UsrData *UsrDat,bool CreatingMyOwnAccount)
extern const char *The_ThemeId[The_NUM_THEMES]; extern const char *The_ThemeId[The_NUM_THEMES];
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS]; extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
extern const char *Pri_VisibilityDB[Pri_NUM_OPTIONS_PRIVACY]; extern const char *Pri_VisibilityDB[Pri_NUM_OPTIONS_PRIVACY];
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Usr_StringsSexDB[Usr_NUM_SEXS]; extern const char *Usr_StringsSexDB[Usr_NUM_SEXS];
char BirthdayStrDB[Usr_BIRTHDAY_STR_DB_LENGTH + 1]; char BirthdayStrDB[Usr_BIRTHDAY_STR_DB_LENGTH + 1];
size_t CommentsLength; size_t CommentsLength;
@ -759,7 +759,7 @@ void Acc_CreateNewUsr (struct UsrData *UsrDat,bool CreatingMyOwnAccount)
Usr_StringsSexDB[UsrDat->Sex], Usr_StringsSexDB[UsrDat->Sex],
The_ThemeId[UsrDat->Prefs.Theme], The_ThemeId[UsrDat->Prefs.Theme],
Ico_IconSetId[UsrDat->Prefs.IconSet], Ico_IconSetId[UsrDat->Prefs.IconSet],
Txt_STR_LANG_ID[UsrDat->Prefs.Language], Lan_STR_LANG_ID[UsrDat->Prefs.Language],
Cal_FIRST_DAY_OF_WEEK_DEFAULT, Cal_FIRST_DAY_OF_WEEK_DEFAULT,
(unsigned) Dat_FORMAT_DEFAULT, (unsigned) Dat_FORMAT_DEFAULT,
Pri_VisibilityDB[UsrDat->PhotoVisibility], Pri_VisibilityDB[UsrDat->PhotoVisibility],

View File

@ -5115,7 +5115,7 @@ const char *Act_GetSubtitleAction (Act_Action_t Action)
char *Act_GetActionTextFromDB (long ActCod, char *Act_GetActionTextFromDB (long ActCod,
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1]) char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1])
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -5123,7 +5123,7 @@ char *Act_GetActionTextFromDB (long ActCod,
if (DB_QuerySELECT (&mysql_res,"can not get text for an action", if (DB_QuerySELECT (&mysql_res,"can not get text for an action",
"SELECT Txt FROM actions" "SELECT Txt FROM actions"
" WHERE ActCod=%ld AND Language='%s'", " WHERE ActCod=%ld AND Language='%s'",
ActCod,Txt_STR_LANG_ID[Txt_LANGUAGE_ES])) // !!! TODO: Replace Txt_LANGUAGE_ES by Gbl.Prefs.Language !!! ActCod,Lan_STR_LANG_ID[Lan_LANGUAGE_ES])) // !!! TODO: Replace Lan_LANGUAGE_ES by Gbl.Prefs.Language !!!
{ {
/***** Get text *****/ /***** Get text *****/
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);

View File

@ -31,9 +31,9 @@
#include "swad_constant.h" #include "swad_constant.h"
#include "swad_cryptography.h" #include "swad_cryptography.h"
#include "swad_language.h"
#include "swad_string.h" #include "swad_string.h"
#include "swad_tab.h" #include "swad_tab.h"
#include "swad_text.h"
/*****************************************************************************/ /*****************************************************************************/
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/

View File

@ -399,15 +399,15 @@ void Agd_ShowUsrAgenda (void)
void Agd_ShowOtherAgendaAfterLogIn (void) void Agd_ShowOtherAgendaAfterLogIn (void)
{ {
extern const char *Hlp_PROFILE_Agenda_public_agenda; extern const char *Hlp_PROFILE_Agenda_public_agenda;
extern const unsigned Txt_Current_CGI_SWAD_Language; extern const unsigned Lan_Current_CGI_SWAD_Language;
extern const char *Txt_Public_agenda_USER; extern const char *Txt_Public_agenda_USER;
extern const char *Txt_User_not_found_or_you_do_not_have_permission_; extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
extern const char *Txt_Switching_to_LANGUAGE[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_Switching_to_LANGUAGE[1 + Lan_NUM_LANGUAGES];
bool ItsMe; bool ItsMe;
if (Gbl.Usrs.Me.Logged) if (Gbl.Usrs.Me.Logged)
{ {
if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Txt_Current_CGI_SWAD_Language) if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Lan_Current_CGI_SWAD_Language)
{ {
/***** Get user *****/ /***** Get user *****/
/* If nickname is correct, user code is already got from nickname */ /* If nickname is correct, user code is already got from nickname */
@ -667,12 +667,12 @@ static void Agd_PutIconToViewEditMyFullAgenda (void)
static void Agd_PutIconToShowQR (void) static void Agd_PutIconToShowQR (void)
{ {
char URL[Cns_MAX_BYTES_WWW + 1]; char URL[Cns_MAX_BYTES_WWW + 1];
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
snprintf (URL,sizeof (URL), snprintf (URL,sizeof (URL),
"%s/%s?agd=@%s", "%s/%s?agd=@%s",
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.Usrs.Me.UsrDat.Nickname); Gbl.Usrs.Me.UsrDat.Nickname);
Gbl.QR.Str = URL; Gbl.QR.Str = URL;
QR_PutLinkToPrintQRCode (ActPrnAgdQR,QR_PutParamQRString); QR_PutLinkToPrintQRCode (ActPrnAgdQR,QR_PutParamQRString);

View File

@ -37,10 +37,10 @@
#include "swad_database.h" #include "swad_database.h"
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_language.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_photo.h" #include "swad_photo.h"
#include "swad_table.h" #include "swad_table.h"
#include "swad_text.h"
/*****************************************************************************/ /*****************************************************************************/
/************** External global variables from others modules ****************/ /************** External global variables from others modules ****************/

View File

@ -202,7 +202,7 @@ unsigned Cal_GetFirstDayOfWeekFromStr (const char *Str)
void Cal_DrawCurrentMonth (void) void Cal_DrawCurrentMonth (void)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
char ParamsStr[Frm_MAX_BYTES_PARAMS_STR]; char ParamsStr[Frm_MAX_BYTES_PARAMS_STR];
/***** Get list of holidays *****/ /***** Get list of holidays *****/
@ -225,7 +225,7 @@ void Cal_DrawCurrentMonth (void)
(long) Gbl.StartExecutionTimeUTC, (long) Gbl.StartExecutionTimeUTC,
Gbl.CurrentCtr.Ctr.PlcCod, Gbl.CurrentCtr.Ctr.PlcCod,
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language]); Lan_STR_LANG_ID[Gbl.Prefs.Language]);
Frm_SetParamsForm (ParamsStr,Cal_GetActionToSeeCalendar (),true); Frm_SetParamsForm (ParamsStr,Cal_GetActionToSeeCalendar (),true);
fprintf (Gbl.F.Out,"'%s',",ParamsStr); fprintf (Gbl.F.Out,"'%s',",ParamsStr);
Frm_SetParamsForm (ParamsStr,ActSeeDatExaAnn,true); Frm_SetParamsForm (ParamsStr,ActSeeDatExaAnn,true);
@ -302,7 +302,7 @@ static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
bool PrintView) bool PrintView)
{ {
extern const char *Hlp_Calendar; extern const char *Hlp_Calendar;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
char ParamsStr[Frm_MAX_BYTES_PARAMS_STR]; char ParamsStr[Frm_MAX_BYTES_PARAMS_STR];
/***** Get list of holidays *****/ /***** Get list of holidays *****/
@ -340,7 +340,7 @@ static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
PrintView ? "true" : PrintView ? "true" :
"false", "false",
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language]); Lan_STR_LANG_ID[Gbl.Prefs.Language]);
Frm_SetParamsForm (ParamsStr,ActionSeeCalendar,true); Frm_SetParamsForm (ParamsStr,ActionSeeCalendar,true);
fprintf (Gbl.F.Out,"'%s',", fprintf (Gbl.F.Out,"'%s',",
ParamsStr); ParamsStr);

View File

@ -43,12 +43,12 @@
#include "swad_help.h" #include "swad_help.h"
#include "swad_hierarchy.h" #include "swad_hierarchy.h"
#include "swad_institution.h" #include "swad_institution.h"
#include "swad_language.h"
#include "swad_logo.h" #include "swad_logo.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_QR.h" #include "swad_QR.h"
#include "swad_string.h" #include "swad_string.h"
#include "swad_table.h" #include "swad_table.h"
#include "swad_text.h"
/*****************************************************************************/ /*****************************************************************************/
/************** External global variables from others modules ****************/ /************** External global variables from others modules ****************/
@ -295,7 +295,7 @@ static void Ctr_Configuration (bool PrintView)
extern const char *Txt_Another_place; extern const char *Txt_Another_place;
extern const char *Txt_Web; extern const char *Txt_Web;
extern const char *Txt_Shortcut; extern const char *Txt_Shortcut;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_QR_code; extern const char *Txt_QR_code;
extern const char *Txt_Users_of_the_centre; extern const char *Txt_Users_of_the_centre;
extern const char *Txt_Place; extern const char *Txt_Place;
@ -596,10 +596,10 @@ static void Ctr_Configuration (bool PrintView)
The_ClassForm[Gbl.Prefs.Theme], The_ClassForm[Gbl.Prefs.Theme],
Txt_Shortcut, Txt_Shortcut,
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.CurrentCtr.Ctr.CtrCod, Gbl.CurrentCtr.Ctr.CtrCod,
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.CurrentCtr.Ctr.CtrCod); Gbl.CurrentCtr.Ctr.CtrCod);
if (PrintView) if (PrintView)

View File

@ -360,10 +360,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 18.20.1 (2018-12-08)" #define Log_PLATFORM_VERSION "SWAD 18.21 (2018-12-08)"
#define CSS_FILE "swad18.4.css" #define CSS_FILE "swad18.4.css"
#define JS_FILE "swad17.17.1.js" #define JS_FILE "swad17.17.1.js"
/* /*
Version 18.21: Dec 08, 2018 Code refactoring related to languages. (237098 lines)
Version 18.20.1: Dec 08, 2018 Some messages translated to portuguese. (237125 lines) Version 18.20.1: Dec 08, 2018 Some messages translated to portuguese. (237125 lines)
Version 18.20: Dec 08, 2018 New module swad_text_no_html for messages without HTML entities. Version 18.20: Dec 08, 2018 New module swad_text_no_html for messages without HTML entities.
Changed translation of degree in portuguese. (237124 lines) Changed translation of degree in portuguese. (237124 lines)

View File

@ -37,10 +37,10 @@
#include "swad_database.h" #include "swad_database.h"
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_language.h"
#include "swad_logo.h" #include "swad_logo.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_string.h" #include "swad_string.h"
#include "swad_text.h"
/*****************************************************************************/ /*****************************************************************************/
/************** External global variables from others modules ****************/ /************** External global variables from others modules ****************/

View File

@ -71,7 +71,7 @@
#define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "465" // SMTP port for sending automatic emails #define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "465" // SMTP port for sending automatic emails
#define Cfg_AUTOMATIC_EMAIL_FROM "acanas@openswad.org" // Email address from where automatic emails will be sent #define Cfg_AUTOMATIC_EMAIL_FROM "acanas@openswad.org" // Email address from where automatic emails will be sent
#define Cfg_DATABASE_HOST "localhost" // Database host #define Cfg_DATABASE_HOST "localhost" // Database host
#define Cfg_DEFAULT_LANGUAGE Txt_LANGUAGE_ES // Default language #define Cfg_DEFAULT_LANGUAGE Lan_LANGUAGE_ES // Default language
#define Cfg_LOG_START_YEAR 2012 // Year when the log started in the database #define Cfg_LOG_START_YEAR 2012 // Year when the log started in the database
// Footer of page with info about the institution where this platform is installed // Footer of page with info about the institution where this platform is installed
@ -112,7 +112,7 @@
#define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "465" // SMTP port for sending automatic emails #define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "465" // SMTP port for sending automatic emails
#define Cfg_AUTOMATIC_EMAIL_FROM "acanas@openswad.org" // Email address from where automatic emails will be sent #define Cfg_AUTOMATIC_EMAIL_FROM "acanas@openswad.org" // Email address from where automatic emails will be sent
#define Cfg_DATABASE_HOST "localhost" // Database host #define Cfg_DATABASE_HOST "localhost" // Database host
#define Cfg_DEFAULT_LANGUAGE Txt_LANGUAGE_EN // Default language #define Cfg_DEFAULT_LANGUAGE Lan_LANGUAGE_EN // Default language
#define Cfg_LOG_START_YEAR 2012 // Year when the log started in the database #define Cfg_LOG_START_YEAR 2012 // Year when the log started in the database
// Footer of page with info about the institution where this platform is installed // Footer of page with info about the institution where this platform is installed
@ -170,7 +170,7 @@
#define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "587" // SMTP port for sending automatic emails #define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "587" // SMTP port for sending automatic emails
#define Cfg_AUTOMATIC_EMAIL_FROM "swad@ugr.es" // Email address from where automatic emails will be sent #define Cfg_AUTOMATIC_EMAIL_FROM "swad@ugr.es" // Email address from where automatic emails will be sent
#define Cfg_DATABASE_HOST "localhost" // Database host #define Cfg_DATABASE_HOST "localhost" // Database host
#define Cfg_DEFAULT_LANGUAGE Txt_LANGUAGE_ES // Default language #define Cfg_DEFAULT_LANGUAGE Lan_LANGUAGE_ES // Default language
#define Cfg_LOG_START_YEAR 2005 // Year when the log started in the database #define Cfg_LOG_START_YEAR 2005 // Year when the log started in the database
// Footer of page with info about the institution where this platform is installed // Footer of page with info about the institution where this platform is installed
@ -225,7 +225,7 @@
#define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "587" // SMTP port for sending automatic emails #define Cfg_AUTOMATIC_EMAIL_SMTP_PORT "587" // SMTP port for sending automatic emails
#define Cfg_AUTOMATIC_EMAIL_FROM "swad@ugr.es" // Email address from where automatic emails will be sent #define Cfg_AUTOMATIC_EMAIL_FROM "swad@ugr.es" // Email address from where automatic emails will be sent
#define Cfg_DATABASE_HOST "localhost" // Database host #define Cfg_DATABASE_HOST "localhost" // Database host
#define Cfg_DEFAULT_LANGUAGE Txt_LANGUAGE_ES // Default language #define Cfg_DEFAULT_LANGUAGE Lan_LANGUAGE_ES // Default language
#define Cfg_LOG_START_YEAR 2016 // Year when the log started in the database #define Cfg_LOG_START_YEAR 2016 // Year when the log started in the database
// Footer of page with info about the institution where this platform is installed // Footer of page with info about the institution where this platform is installed

View File

@ -44,7 +44,6 @@
#include "swad_preference.h" #include "swad_preference.h"
#include "swad_QR.h" #include "swad_QR.h"
#include "swad_table.h" #include "swad_table.h"
#include "swad_text.h"
/*****************************************************************************/ /*****************************************************************************/
/************** External global variables from others modules ****************/ /************** External global variables from others modules ****************/
@ -94,7 +93,7 @@ static long Cty_GetParamOtherCtyCod (void);
static bool Cty_CheckIfNumericCountryCodeExists (long CtyCod); static bool Cty_CheckIfNumericCountryCodeExists (long CtyCod);
static bool Cty_CheckIfAlpha2CountryCodeExists (const char Alpha2[2 + 1]); static bool Cty_CheckIfAlpha2CountryCodeExists (const char Alpha2[2 + 1]);
static bool Cty_CheckIfCountryNameExists (Txt_Language_t Language,const char *Name,long CtyCod); static bool Cty_CheckIfCountryNameExists (Lan_Language_t Language,const char *Name,long CtyCod);
static void Cty_UpdateCtyNameDB (long CtyCod,const char *FieldName,const char *NewCtyName); static void Cty_UpdateCtyNameDB (long CtyCod,const char *FieldName,const char *NewCtyName);
static void Cty_PutFormToCreateCountry (void); static void Cty_PutFormToCreateCountry (void);
@ -108,7 +107,7 @@ static void Cty_CreateCountry (struct Country *Cty);
void Cty_SeeCtyWithPendingInss (void) void Cty_SeeCtyWithPendingInss (void)
{ {
extern const char *Hlp_SYSTEM_Hierarchy_pending; extern const char *Hlp_SYSTEM_Hierarchy_pending;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Countries_with_pending_institutions; extern const char *Txt_Countries_with_pending_institutions;
extern const char *Txt_Country; extern const char *Txt_Country;
extern const char *Txt_Institutions_ABBREVIATION; extern const char *Txt_Institutions_ABBREVIATION;
@ -133,7 +132,7 @@ void Cty_SeeCtyWithPendingInss (void)
" GROUP BY institutions.CtyCod" " GROUP BY institutions.CtyCod"
" ORDER BY countries.Name_%s", " ORDER BY countries.Name_%s",
(unsigned) Ins_STATUS_BIT_PENDING, (unsigned) Ins_STATUS_BIT_PENDING,
Txt_STR_LANG_ID[Gbl.Prefs.Language]); Lan_STR_LANG_ID[Gbl.Prefs.Language]);
break; break;
default: // Forbidden for other users default: // Forbidden for other users
return; return;
@ -235,7 +234,7 @@ static void Cty_Configuration (bool PrintView)
extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *The_ClassForm[The_NUM_THEMES];
extern const char *Txt_Country; extern const char *Txt_Country;
extern const char *Txt_Shortcut; extern const char *Txt_Shortcut;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_QR_code; extern const char *Txt_QR_code;
extern const char *Txt_Institutions; extern const char *Txt_Institutions;
extern const char *Txt_Institutions_of_COUNTRY_X; extern const char *Txt_Institutions_of_COUNTRY_X;
@ -343,10 +342,10 @@ static void Cty_Configuration (bool PrintView)
The_ClassForm[Gbl.Prefs.Theme], The_ClassForm[Gbl.Prefs.Theme],
Txt_Shortcut, Txt_Shortcut,
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.CurrentCty.Cty.CtyCod, Gbl.CurrentCty.Cty.CtyCod,
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.CurrentCty.Cty.CtyCod); Gbl.CurrentCty.Cty.CtyCod);
if (PrintView) if (PrintView)
@ -1012,11 +1011,11 @@ static void Cty_PutIconToViewCountries (void)
/************************** List all the countries ***************************/ /************************** List all the countries ***************************/
/*****************************************************************************/ /*****************************************************************************/
#define Cty_MAX_BYTES_SUBQUERY_CTYS ((1 + Txt_NUM_LANGUAGES) * 32) #define Cty_MAX_BYTES_SUBQUERY_CTYS ((1 + Lan_NUM_LANGUAGES) * 32)
void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData) void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
char StrField[32]; char StrField[32];
char SubQueryNam1[Cty_MAX_BYTES_SUBQUERY_CTYS + 1]; char SubQueryNam1[Cty_MAX_BYTES_SUBQUERY_CTYS + 1];
char SubQueryNam2[Cty_MAX_BYTES_SUBQUERY_CTYS + 1]; char SubQueryNam2[Cty_MAX_BYTES_SUBQUERY_CTYS + 1];
@ -1028,7 +1027,7 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
unsigned long NumRows = 0; unsigned long NumRows = 0;
unsigned NumCty; unsigned NumCty;
struct Country *Cty; struct Country *Cty;
Txt_Language_t Lan; Lan_Language_t Lan;
/***** Get countries from database *****/ /***** Get countries from database *****/
switch (GetExtraData) switch (GetExtraData)
@ -1037,37 +1036,37 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
NumRows = DB_QuerySELECT (&mysql_res,"can not get countries", NumRows = DB_QuerySELECT (&mysql_res,"can not get countries",
"SELECT CtyCod,Alpha2,Name_%s" "SELECT CtyCod,Alpha2,Name_%s"
" FROM countries ORDER BY Name_%s", " FROM countries ORDER BY Name_%s",
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Txt_STR_LANG_ID[Gbl.Prefs.Language]); Lan_STR_LANG_ID[Gbl.Prefs.Language]);
break; break;
case Cty_GET_EXTRA_DATA: case Cty_GET_EXTRA_DATA:
SubQueryNam1[0] = '\0'; SubQueryNam1[0] = '\0';
SubQueryNam2[0] = '\0'; SubQueryNam2[0] = '\0';
SubQueryWWW1[0] = '\0'; SubQueryWWW1[0] = '\0';
SubQueryWWW2[0] = '\0'; SubQueryWWW2[0] = '\0';
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
{ {
snprintf (StrField,sizeof (StrField), snprintf (StrField,sizeof (StrField),
"countries.Name_%s,", "countries.Name_%s,",
Txt_STR_LANG_ID[Lan]); Lan_STR_LANG_ID[Lan]);
Str_Concat (SubQueryNam1,StrField, Str_Concat (SubQueryNam1,StrField,
Cty_MAX_BYTES_SUBQUERY_CTYS); Cty_MAX_BYTES_SUBQUERY_CTYS);
snprintf (StrField,sizeof (StrField), snprintf (StrField,sizeof (StrField),
"Name_%s,", "Name_%s,",
Txt_STR_LANG_ID[Lan]); Lan_STR_LANG_ID[Lan]);
Str_Concat (SubQueryNam2,StrField, Str_Concat (SubQueryNam2,StrField,
Cty_MAX_BYTES_SUBQUERY_CTYS); Cty_MAX_BYTES_SUBQUERY_CTYS);
snprintf (StrField,sizeof (StrField), snprintf (StrField,sizeof (StrField),
"countries.WWW_%s,", "countries.WWW_%s,",
Txt_STR_LANG_ID[Lan]); Lan_STR_LANG_ID[Lan]);
Str_Concat (SubQueryWWW1,StrField, Str_Concat (SubQueryWWW1,StrField,
Cty_MAX_BYTES_SUBQUERY_CTYS); Cty_MAX_BYTES_SUBQUERY_CTYS);
snprintf (StrField,sizeof (StrField), snprintf (StrField,sizeof (StrField),
"WWW_%s,", "WWW_%s,",
Txt_STR_LANG_ID[Lan]); Lan_STR_LANG_ID[Lan]);
Str_Concat (SubQueryWWW2,StrField, Str_Concat (SubQueryWWW2,StrField,
Cty_MAX_BYTES_SUBQUERY_CTYS); Cty_MAX_BYTES_SUBQUERY_CTYS);
} }
@ -1076,12 +1075,12 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
{ {
case Cty_ORDER_BY_COUNTRY: case Cty_ORDER_BY_COUNTRY:
if (asprintf (&OrderBySubQuery,"Name_%s", if (asprintf (&OrderBySubQuery,"Name_%s",
Txt_STR_LANG_ID[Gbl.Prefs.Language]) < 0) Lan_STR_LANG_ID[Gbl.Prefs.Language]) < 0)
Lay_NotEnoughMemoryExit (); Lay_NotEnoughMemoryExit ();
break; break;
case Cty_ORDER_BY_NUM_USRS: case Cty_ORDER_BY_NUM_USRS:
if (asprintf (&OrderBySubQuery,"NumUsrs DESC,Name_%s", if (asprintf (&OrderBySubQuery,"NumUsrs DESC,Name_%s",
Txt_STR_LANG_ID[Gbl.Prefs.Language]) < 0) Lan_STR_LANG_ID[Gbl.Prefs.Language]) < 0)
Lay_NotEnoughMemoryExit (); Lay_NotEnoughMemoryExit ();
break; break;
} }
@ -1136,8 +1135,8 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
switch (GetExtraData) switch (GetExtraData)
{ {
case Cty_GET_BASIC_DATA: case Cty_GET_BASIC_DATA:
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
{ {
Cty->Name[Lan][0] = '\0'; Cty->Name[Lan][0] = '\0';
@ -1153,18 +1152,18 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
break; break;
case Cty_GET_EXTRA_DATA: case Cty_GET_EXTRA_DATA:
/* Get the name of the country in several languages */ /* Get the name of the country in several languages */
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
{ {
Str_Copy (Cty->Name[Lan],row[1 + Lan], Str_Copy (Cty->Name[Lan],row[1 + Lan],
Cty_MAX_BYTES_NAME); Cty_MAX_BYTES_NAME);
Str_Copy (Cty->WWW[Lan],row[1 + Txt_NUM_LANGUAGES + Lan], Str_Copy (Cty->WWW[Lan],row[1 + Lan_NUM_LANGUAGES + Lan],
Cns_MAX_BYTES_WWW); Cns_MAX_BYTES_WWW);
} }
/* Get number of users who claim to belong to this country */ /* Get number of users who claim to belong to this country */
if (sscanf (row[1 + Txt_NUM_LANGUAGES * 2 + 1],"%u", if (sscanf (row[1 + Lan_NUM_LANGUAGES * 2 + 1],"%u",
&Cty->NumUsrsWhoClaimToBelongToCty) != 1) &Cty->NumUsrsWhoClaimToBelongToCty) != 1)
Cty->NumUsrsWhoClaimToBelongToCty = 0; Cty->NumUsrsWhoClaimToBelongToCty = 0;
@ -1200,7 +1199,7 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
void Cty_WriteSelectorOfCountry (void) void Cty_WriteSelectorOfCountry (void)
{ {
extern const char *Txt_Country; extern const char *Txt_Country;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
unsigned NumCtys; unsigned NumCtys;
@ -1223,8 +1222,8 @@ void Cty_WriteSelectorOfCountry (void)
"SELECT DISTINCT CtyCod,Name_%s" "SELECT DISTINCT CtyCod,Name_%s"
" FROM countries" " FROM countries"
" ORDER BY countries.Name_%s", " ORDER BY countries.Name_%s",
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Txt_STR_LANG_ID[Gbl.Prefs.Language]); Lan_STR_LANG_ID[Gbl.Prefs.Language]);
/***** List countries *****/ /***** List countries *****/
for (NumCty = 0; for (NumCty = 0;
@ -1291,7 +1290,7 @@ void Cty_WriteCountryName (long CtyCod,const char *ClassLink)
bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraData) bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraData)
{ {
extern const char *Txt_Another_country; extern const char *Txt_Another_country;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
char StrField[32]; char StrField[32];
char SubQueryNam1[Cty_MAX_BYTES_SUBQUERY_CTYS + 1]; char SubQueryNam1[Cty_MAX_BYTES_SUBQUERY_CTYS + 1];
char SubQueryNam2[Cty_MAX_BYTES_SUBQUERY_CTYS + 1]; char SubQueryNam2[Cty_MAX_BYTES_SUBQUERY_CTYS + 1];
@ -1300,15 +1299,15 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
unsigned long NumRows = 0; unsigned long NumRows = 0;
Txt_Language_t Lan; Lan_Language_t Lan;
bool CtyFound; bool CtyFound;
if (Cty->CtyCod < 0) if (Cty->CtyCod < 0)
return false; return false;
/***** Clear data *****/ /***** Clear data *****/
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
{ {
Cty->Name[Lan][0] = '\0'; Cty->Name[Lan][0] = '\0';
@ -1321,8 +1320,8 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD
/***** Check if country code is correct *****/ /***** Check if country code is correct *****/
if (Cty->CtyCod == 0) if (Cty->CtyCod == 0)
{ {
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
if (Lan == Gbl.Prefs.Language) if (Lan == Gbl.Prefs.Language)
Str_Copy (Cty->Name[Lan],Txt_Another_country, Str_Copy (Cty->Name[Lan],Txt_Another_country,
@ -1342,8 +1341,8 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD
"SELECT Alpha2,Name_%s,WWW_%s" "SELECT Alpha2,Name_%s,WWW_%s"
" FROM countries" " FROM countries"
" WHERE CtyCod='%03ld'", " WHERE CtyCod='%03ld'",
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Cty->CtyCod); Cty->CtyCod);
break; break;
case Cty_GET_EXTRA_DATA: case Cty_GET_EXTRA_DATA:
@ -1351,29 +1350,29 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD
SubQueryNam2[0] = '\0'; SubQueryNam2[0] = '\0';
SubQueryWWW1[0] = '\0'; SubQueryWWW1[0] = '\0';
SubQueryWWW2[0] = '\0'; SubQueryWWW2[0] = '\0';
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
{ {
snprintf (StrField,sizeof (StrField), snprintf (StrField,sizeof (StrField),
"countries.Name_%s,", "countries.Name_%s,",
Txt_STR_LANG_ID[Lan]); Lan_STR_LANG_ID[Lan]);
Str_Concat (SubQueryNam1,StrField, Str_Concat (SubQueryNam1,StrField,
Cty_MAX_BYTES_SUBQUERY_CTYS); Cty_MAX_BYTES_SUBQUERY_CTYS);
snprintf (StrField,sizeof (StrField), snprintf (StrField,sizeof (StrField),
"Name_%s,", "Name_%s,",
Txt_STR_LANG_ID[Lan]); Lan_STR_LANG_ID[Lan]);
Str_Concat (SubQueryNam2,StrField, Str_Concat (SubQueryNam2,StrField,
Cty_MAX_BYTES_SUBQUERY_CTYS); Cty_MAX_BYTES_SUBQUERY_CTYS);
snprintf (StrField,sizeof (StrField), snprintf (StrField,sizeof (StrField),
"countries.WWW_%s,", "countries.WWW_%s,",
Txt_STR_LANG_ID[Lan]); Lan_STR_LANG_ID[Lan]);
Str_Concat (SubQueryWWW1,StrField, Str_Concat (SubQueryWWW1,StrField,
Cty_MAX_BYTES_SUBQUERY_CTYS); Cty_MAX_BYTES_SUBQUERY_CTYS);
snprintf (StrField,sizeof (StrField), snprintf (StrField,sizeof (StrField),
"WWW_%s,", "WWW_%s,",
Txt_STR_LANG_ID[Lan]); Lan_STR_LANG_ID[Lan]);
Str_Concat (SubQueryWWW2,StrField, Str_Concat (SubQueryWWW2,StrField,
Cty_MAX_BYTES_SUBQUERY_CTYS); Cty_MAX_BYTES_SUBQUERY_CTYS);
} }
@ -1416,18 +1415,18 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD
break; break;
case Cty_GET_EXTRA_DATA: case Cty_GET_EXTRA_DATA:
/* Get name and WWW of the country in several languages */ /* Get name and WWW of the country in several languages */
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
{ {
Str_Copy (Cty->Name[Lan],row[Lan], Str_Copy (Cty->Name[Lan],row[Lan],
Cty_MAX_BYTES_NAME); Cty_MAX_BYTES_NAME);
Str_Copy (Cty->WWW[Lan],row[Txt_NUM_LANGUAGES + Lan], Str_Copy (Cty->WWW[Lan],row[Lan_NUM_LANGUAGES + Lan],
Cns_MAX_BYTES_WWW); Cns_MAX_BYTES_WWW);
} }
/* Get number of users who claim to belong to this country */ /* Get number of users who claim to belong to this country */
if (sscanf (row[Txt_NUM_LANGUAGES * 2 + 1],"%u", if (sscanf (row[Lan_NUM_LANGUAGES * 2 + 1],"%u",
&Cty->NumUsrsWhoClaimToBelongToCty) != 1) &Cty->NumUsrsWhoClaimToBelongToCty) != 1)
Cty->NumUsrsWhoClaimToBelongToCty = 0; Cty->NumUsrsWhoClaimToBelongToCty = 0;
@ -1461,7 +1460,7 @@ void Cty_FlushCacheCountryName (void)
void Cty_GetCountryName (long CtyCod,char CtyName[Cty_MAX_BYTES_NAME + 1]) void Cty_GetCountryName (long CtyCod,char CtyName[Cty_MAX_BYTES_NAME + 1])
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -1485,7 +1484,7 @@ void Cty_GetCountryName (long CtyCod,char CtyName[Cty_MAX_BYTES_NAME + 1])
if (DB_QuerySELECT (&mysql_res,"can not get the name of a country", if (DB_QuerySELECT (&mysql_res,"can not get the name of a country",
"SELECT Name_%s FROM countries WHERE CtyCod='%03ld'", "SELECT Name_%s FROM countries WHERE CtyCod='%03ld'",
Txt_STR_LANG_ID[Gbl.Prefs.Language],CtyCod)) // Country found... Lan_STR_LANG_ID[Gbl.Prefs.Language],CtyCod)) // Country found...
{ {
/* Get row */ /* Get row */
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
@ -1575,10 +1574,10 @@ void Cty_FreeListCountries (void)
static void Cty_ListCountriesForEdition (void) static void Cty_ListCountriesForEdition (void)
{ {
extern const char *Txt_STR_LANG_NAME[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_STR_LANG_NAME[1 + Lan_NUM_LANGUAGES];
unsigned NumCty; unsigned NumCty;
struct Country *Cty; struct Country *Cty;
Txt_Language_t Lan; Lan_Language_t Lan;
/***** Write heading *****/ /***** Write heading *****/
Tbl_StartTableWide (2); Tbl_StartTableWide (2);
@ -1594,7 +1593,7 @@ static void Cty_ListCountriesForEdition (void)
/* Put icon to remove country */ /* Put icon to remove country */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td rowspan=\"%u\" class=\"BT\">", "<td rowspan=\"%u\" class=\"BT\">",
1 + Txt_NUM_LANGUAGES); 1 + Lan_NUM_LANGUAGES);
if (Cty->NumInss || if (Cty->NumInss ||
Cty->NumUsrsWhoClaimToBelongToCty || Cty->NumUsrsWhoClaimToBelongToCty ||
Cty->NumUsrs) // Country has institutions or users ==> deletion forbidden Cty->NumUsrs) // Country has institutions or users ==> deletion forbidden
@ -1612,13 +1611,13 @@ static void Cty_ListCountriesForEdition (void)
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">" fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">"
"%03ld" "%03ld"
"</td>", "</td>",
1 + Txt_NUM_LANGUAGES,Cty->CtyCod); 1 + Lan_NUM_LANGUAGES,Cty->CtyCod);
/* Alphabetic country code with 2 letters (ISO 3166-1) */ /* Alphabetic country code with 2 letters (ISO 3166-1) */
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">" fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">"
"%s" "%s"
"</td>", "</td>",
1 + Txt_NUM_LANGUAGES,Cty->Alpha2); 1 + Lan_NUM_LANGUAGES,Cty->Alpha2);
fprintf (Gbl.F.Out,"<td></td>" fprintf (Gbl.F.Out,"<td></td>"
"<td></td>" "<td></td>"
@ -1628,18 +1627,18 @@ static void Cty_ListCountriesForEdition (void)
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">" fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">"
"%u" "%u"
"</td>", "</td>",
1 + Txt_NUM_LANGUAGES,Cty->NumUsrsWhoClaimToBelongToCty); 1 + Lan_NUM_LANGUAGES,Cty->NumUsrsWhoClaimToBelongToCty);
/* Number of institutions */ /* Number of institutions */
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">" fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">"
"%u" "%u"
"</td>" "</td>"
"</tr>", "</tr>",
1 + Txt_NUM_LANGUAGES,Cty->NumInss); 1 + Lan_NUM_LANGUAGES,Cty->NumInss);
/* Country name in several languages */ /* Country name in several languages */
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
{ {
/* Language */ /* Language */
@ -1776,11 +1775,11 @@ void Cty_RenameCountry (void)
extern const char *Txt_You_can_not_leave_the_name_of_the_country_X_empty; extern const char *Txt_You_can_not_leave_the_name_of_the_country_X_empty;
extern const char *Txt_The_country_X_already_exists; extern const char *Txt_The_country_X_already_exists;
extern const char *Txt_The_country_X_has_been_renamed_as_Y; extern const char *Txt_The_country_X_has_been_renamed_as_Y;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_The_name_of_the_country_X_has_not_changed; extern const char *Txt_The_name_of_the_country_X_has_not_changed;
struct Country *Cty; struct Country *Cty;
char NewCtyName[Cty_MAX_BYTES_NAME + 1]; char NewCtyName[Cty_MAX_BYTES_NAME + 1];
Txt_Language_t Language; Lan_Language_t Language;
char FieldName[4 + 1 + 2 + 1]; // Example: "Name_en" char FieldName[4 + 1 + 2 + 1]; // Example: "Name_en"
Cty = &Gbl.Ctys.EditingCty; Cty = &Gbl.Ctys.EditingCty;
@ -1823,7 +1822,7 @@ void Cty_RenameCountry (void)
/* Update the table changing old name by new name */ /* Update the table changing old name by new name */
snprintf (FieldName,sizeof (FieldName), snprintf (FieldName,sizeof (FieldName),
"Name_%s", "Name_%s",
Txt_STR_LANG_ID[Language]); Lan_STR_LANG_ID[Language]);
Cty_UpdateCtyNameDB (Cty->CtyCod,FieldName,NewCtyName); Cty_UpdateCtyNameDB (Cty->CtyCod,FieldName,NewCtyName);
/* Write message to show the change made */ /* Write message to show the change made */
@ -1882,16 +1881,16 @@ static bool Cty_CheckIfAlpha2CountryCodeExists (const char Alpha2[2 + 1])
/******************** Check if the name of country exists ********************/ /******************** Check if the name of country exists ********************/
/*****************************************************************************/ /*****************************************************************************/
static bool Cty_CheckIfCountryNameExists (Txt_Language_t Language,const char *Name,long CtyCod) static bool Cty_CheckIfCountryNameExists (Lan_Language_t Language,const char *Name,long CtyCod)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
/***** Get number of countries with a name from database *****/ /***** Get number of countries with a name from database *****/
return (DB_QueryCOUNT ("can not check if the name" return (DB_QueryCOUNT ("can not check if the name"
" of a country already existed", " of a country already existed",
"SELECT COUNT(*) FROM countries" "SELECT COUNT(*) FROM countries"
" WHERE Name_%s='%s' AND CtyCod<>'%03ld'", " WHERE Name_%s='%s' AND CtyCod<>'%03ld'",
Txt_STR_LANG_ID[Language],Name,CtyCod) != 0); Lan_STR_LANG_ID[Language],Name,CtyCod) != 0);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1916,10 +1915,10 @@ static void Cty_UpdateCtyNameDB (long CtyCod,const char *FieldName,const char *N
void Cty_ChangeCtyWWW (void) void Cty_ChangeCtyWWW (void)
{ {
extern const char *Txt_The_new_web_address_is_X; extern const char *Txt_The_new_web_address_is_X;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
struct Country *Cty; struct Country *Cty;
char NewWWW[Cns_MAX_BYTES_WWW + 1]; char NewWWW[Cns_MAX_BYTES_WWW + 1];
Txt_Language_t Language; Lan_Language_t Language;
Cty = &Gbl.Ctys.EditingCty; Cty = &Gbl.Ctys.EditingCty;
@ -1939,7 +1938,7 @@ void Cty_ChangeCtyWWW (void)
DB_QueryUPDATE ("can not update the web of a country", DB_QueryUPDATE ("can not update the web of a country",
"UPDATE countries SET WWW_%s='%s'" "UPDATE countries SET WWW_%s='%s'"
" WHERE CtyCod='%03ld'", " WHERE CtyCod='%03ld'",
Txt_STR_LANG_ID[Language],NewWWW,Cty->CtyCod); Lan_STR_LANG_ID[Language],NewWWW,Cty->CtyCod);
Str_Copy (Cty->WWW[Language],NewWWW, Str_Copy (Cty->WWW[Language],NewWWW,
Cns_MAX_BYTES_WWW); Cns_MAX_BYTES_WWW);
@ -1982,11 +1981,11 @@ void Cty_ChangeCtyMapAttribution (void)
static void Cty_PutFormToCreateCountry (void) static void Cty_PutFormToCreateCountry (void)
{ {
extern const char *Txt_New_country; extern const char *Txt_New_country;
extern const char *Txt_STR_LANG_NAME[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_STR_LANG_NAME[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Create_country; extern const char *Txt_Create_country;
struct Country *Cty; struct Country *Cty;
Txt_Language_t Lan; Lan_Language_t Lan;
/***** Country data *****/ /***** Country data *****/
Cty = &Gbl.Ctys.EditingCty; Cty = &Gbl.Ctys.EditingCty;
@ -2004,13 +2003,13 @@ static void Cty_PutFormToCreateCountry (void)
/***** Column to remove country, disabled here *****/ /***** Column to remove country, disabled here *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td rowspan=\"%u\" class=\"BT\"></td>", "<td rowspan=\"%u\" class=\"BT\"></td>",
1 + Txt_NUM_LANGUAGES); 1 + Lan_NUM_LANGUAGES);
/***** Numerical country code (ISO 3166-1) *****/ /***** Numerical country code (ISO 3166-1) *****/
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"RIGHT_TOP\">" fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"RIGHT_TOP\">"
"<input type=\"text\" name=\"OthCtyCod\"" "<input type=\"text\" name=\"OthCtyCod\""
" size=\"3\" maxlength=\"10\" value=\"", " size=\"3\" maxlength=\"10\" value=\"",
1 + Txt_NUM_LANGUAGES); 1 + Lan_NUM_LANGUAGES);
if (Cty->CtyCod > 0) if (Cty->CtyCod > 0)
fprintf (Gbl.F.Out,"%03ld",Cty->CtyCod); fprintf (Gbl.F.Out,"%03ld",Cty->CtyCod);
fprintf (Gbl.F.Out,"\" required=\"required\" />" fprintf (Gbl.F.Out,"\" required=\"required\" />"
@ -2022,7 +2021,7 @@ static void Cty_PutFormToCreateCountry (void)
" size=\"2\" maxlength=\"2\" value=\"%s\"" " size=\"2\" maxlength=\"2\" value=\"%s\""
" required=\"required\" />" " required=\"required\" />"
"</td>", "</td>",
1 + Txt_NUM_LANGUAGES,Cty->Alpha2); 1 + Lan_NUM_LANGUAGES,Cty->Alpha2);
fprintf (Gbl.F.Out,"<td></td>" fprintf (Gbl.F.Out,"<td></td>"
"<td></td>" "<td></td>"
@ -2032,18 +2031,18 @@ static void Cty_PutFormToCreateCountry (void)
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">" fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">"
"0" "0"
"</td>", "</td>",
1 + Txt_NUM_LANGUAGES); 1 + Lan_NUM_LANGUAGES);
/* Number of institutions */ /* Number of institutions */
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">" fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">"
"0" "0"
"</td>" "</td>"
"</tr>", "</tr>",
1 + Txt_NUM_LANGUAGES); 1 + Lan_NUM_LANGUAGES);
/***** Country name in several languages *****/ /***** Country name in several languages *****/
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
{ {
/* Language */ /* Language */
@ -2059,7 +2058,7 @@ static void Cty_PutFormToCreateCountry (void)
" size=\"15\" maxlength=\"%u\" value=\"%s\"" " size=\"15\" maxlength=\"%u\" value=\"%s\""
" required=\"required\" />" " required=\"required\" />"
"</td>", "</td>",
Txt_STR_LANG_ID[Lan], Lan_STR_LANG_ID[Lan],
Cty_MAX_CHARS_NAME, Cty_MAX_CHARS_NAME,
Cty->Name[Lan]); Cty->Name[Lan]);
@ -2070,7 +2069,7 @@ static void Cty_PutFormToCreateCountry (void)
" class=\"INPUT_WWW\" />" " class=\"INPUT_WWW\" />"
"</td>" "</td>"
"</tr>", "</tr>",
Txt_STR_LANG_ID[Lan], Lan_STR_LANG_ID[Lan],
Cns_MAX_CHARS_WWW, Cns_MAX_CHARS_WWW,
Cty->WWW[Lan]); Cty->WWW[Lan]);
} }
@ -2135,13 +2134,13 @@ void Cty_RecFormNewCountry (void)
extern const char *Txt_The_numerical_code_X_already_exists; extern const char *Txt_The_numerical_code_X_already_exists;
extern const char *Txt_The_alphabetical_code_X_is_not_correct; extern const char *Txt_The_alphabetical_code_X_is_not_correct;
extern const char *Txt_The_alphabetical_code_X_already_exists; extern const char *Txt_The_alphabetical_code_X_already_exists;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_The_country_X_already_exists; extern const char *Txt_The_country_X_already_exists;
extern const char *Txt_You_must_specify_the_name_of_the_new_country_in_all_languages; extern const char *Txt_You_must_specify_the_name_of_the_new_country_in_all_languages;
char ParamName[32]; char ParamName[32];
struct Country *Cty; struct Country *Cty;
bool CreateCountry = true; bool CreateCountry = true;
Txt_Language_t Lan; Lan_Language_t Lan;
unsigned i; unsigned i;
Cty = &Gbl.Ctys.EditingCty; Cty = &Gbl.Ctys.EditingCty;
@ -2191,13 +2190,13 @@ void Cty_RecFormNewCountry (void)
else // Alphabetic code correct else // Alphabetic code correct
{ {
/* Get country name and WWW in different languages */ /* Get country name and WWW in different languages */
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
{ {
snprintf (ParamName,sizeof (ParamName), snprintf (ParamName,sizeof (ParamName),
"Name_%s", "Name_%s",
Txt_STR_LANG_ID[Lan]); Lan_STR_LANG_ID[Lan]);
Par_GetParToText (ParamName,Cty->Name[Lan],Cty_MAX_BYTES_NAME); Par_GetParToText (ParamName,Cty->Name[Lan],Cty_MAX_BYTES_NAME);
if (Cty->Name[Lan][0]) // If there's a country name if (Cty->Name[Lan][0]) // If there's a country name
@ -2222,7 +2221,7 @@ void Cty_RecFormNewCountry (void)
snprintf (ParamName,sizeof (ParamName), snprintf (ParamName,sizeof (ParamName),
"WWW_%s", "WWW_%s",
Txt_STR_LANG_ID[Lan]); Lan_STR_LANG_ID[Lan]);
Par_GetParToText (ParamName,Cty->WWW[Lan],Cns_MAX_BYTES_WWW); Par_GetParToText (ParamName,Cty->WWW[Lan],Cns_MAX_BYTES_WWW);
} }
} }
@ -2240,14 +2239,14 @@ void Cty_RecFormNewCountry (void)
/**************************** Create a new country ***************************/ /**************************** Create a new country ***************************/
/*****************************************************************************/ /*****************************************************************************/
#define Cty_MAX_BYTES_SUBQUERY_CTYS_NAME ((1 + Txt_NUM_LANGUAGES) * Cty_MAX_BYTES_NAME) #define Cty_MAX_BYTES_SUBQUERY_CTYS_NAME ((1 + Lan_NUM_LANGUAGES) * Cty_MAX_BYTES_NAME)
#define Cty_MAX_BYTES_SUBQUERY_CTYS_WWW ((1 + Txt_NUM_LANGUAGES) * Cns_MAX_BYTES_WWW) #define Cty_MAX_BYTES_SUBQUERY_CTYS_WWW ((1 + Lan_NUM_LANGUAGES) * Cns_MAX_BYTES_WWW)
static void Cty_CreateCountry (struct Country *Cty) static void Cty_CreateCountry (struct Country *Cty)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Created_new_country_X; extern const char *Txt_Created_new_country_X;
Txt_Language_t Lan; Lan_Language_t Lan;
char StrField[32]; char StrField[32];
char SubQueryNam1[Cty_MAX_BYTES_SUBQUERY_CTYS + 1]; char SubQueryNam1[Cty_MAX_BYTES_SUBQUERY_CTYS + 1];
char SubQueryNam2[Cty_MAX_BYTES_SUBQUERY_CTYS_NAME + 1]; char SubQueryNam2[Cty_MAX_BYTES_SUBQUERY_CTYS_NAME + 1];
@ -2259,13 +2258,13 @@ static void Cty_CreateCountry (struct Country *Cty)
SubQueryNam2[0] = '\0'; SubQueryNam2[0] = '\0';
SubQueryWWW1[0] = '\0'; SubQueryWWW1[0] = '\0';
SubQueryWWW2[0] = '\0'; SubQueryWWW2[0] = '\0';
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
{ {
snprintf (StrField,sizeof (StrField), snprintf (StrField,sizeof (StrField),
",Name_%s", ",Name_%s",
Txt_STR_LANG_ID[Lan]); Lan_STR_LANG_ID[Lan]);
Str_Concat (SubQueryNam1,StrField, Str_Concat (SubQueryNam1,StrField,
Cty_MAX_BYTES_SUBQUERY_CTYS); Cty_MAX_BYTES_SUBQUERY_CTYS);
@ -2278,7 +2277,7 @@ static void Cty_CreateCountry (struct Country *Cty)
snprintf (StrField,sizeof (StrField), snprintf (StrField,sizeof (StrField),
",WWW_%s", ",WWW_%s",
Txt_STR_LANG_ID[Lan]); Lan_STR_LANG_ID[Lan]);
Str_Concat (SubQueryWWW1,StrField, Str_Concat (SubQueryWWW1,StrField,
Cty_MAX_BYTES_SUBQUERY_CTYS); Cty_MAX_BYTES_SUBQUERY_CTYS);

View File

@ -32,8 +32,8 @@
#include "swad_action.h" #include "swad_action.h"
#include "swad_hierarchy.h" #include "swad_hierarchy.h"
#include "swad_language.h"
#include "swad_role_type.h" #include "swad_role_type.h"
#include "swad_text.h"
/*****************************************************************************/ /*****************************************************************************/
/************************** Public types and constants ***********************/ /************************** Public types and constants ***********************/
@ -48,8 +48,8 @@ struct Country
{ {
long CtyCod; long CtyCod;
char Alpha2[2 + 1]; char Alpha2[2 + 1];
char Name[1 + Txt_NUM_LANGUAGES][Cty_MAX_BYTES_NAME + 1]; char Name[1 + Lan_NUM_LANGUAGES][Cty_MAX_BYTES_NAME + 1];
char WWW [1 + Txt_NUM_LANGUAGES][Cns_MAX_BYTES_WWW + 1]; char WWW [1 + Lan_NUM_LANGUAGES][Cns_MAX_BYTES_WWW + 1];
unsigned NumUsrsWhoClaimToBelongToCty; unsigned NumUsrsWhoClaimToBelongToCty;
unsigned NumInss; unsigned NumInss;
unsigned NumCtrs; unsigned NumCtrs;

View File

@ -176,7 +176,7 @@ static void Crs_Configuration (bool PrintView)
extern const char *Txt_Institutional_code; extern const char *Txt_Institutional_code;
extern const char *Txt_Internal_code; extern const char *Txt_Internal_code;
extern const char *Txt_Shortcut; extern const char *Txt_Shortcut;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_QR_code; extern const char *Txt_QR_code;
extern const char *Txt_Indicators; extern const char *Txt_Indicators;
extern const char *Txt_of_PART_OF_A_TOTAL; extern const char *Txt_of_PART_OF_A_TOTAL;
@ -413,10 +413,10 @@ static void Crs_Configuration (bool PrintView)
The_ClassForm[Gbl.Prefs.Theme], The_ClassForm[Gbl.Prefs.Theme],
Txt_Shortcut, Txt_Shortcut,
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.CurrentCrs.Crs.CrsCod, Gbl.CurrentCrs.Crs.CrsCod,
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.CurrentCrs.Crs.CrsCod); Gbl.CurrentCrs.Crs.CrsCod);
if (PrintView) if (PrintView)

View File

@ -36,7 +36,7 @@
#include "swad_config.h" #include "swad_config.h"
#include "swad_database.h" #include "swad_database.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_text.h" #include "swad_language.h"
/*****************************************************************************/ /*****************************************************************************/
/************** External global variables from others modules ****************/ /************** External global variables from others modules ****************/

View File

@ -47,6 +47,7 @@
#include "swad_hierarchy.h" #include "swad_hierarchy.h"
#include "swad_indicator.h" #include "swad_indicator.h"
#include "swad_info.h" #include "swad_info.h"
#include "swad_language.h"
#include "swad_logo.h" #include "swad_logo.h"
#include "swad_notification.h" #include "swad_notification.h"
#include "swad_parameter.h" #include "swad_parameter.h"
@ -55,7 +56,6 @@
#include "swad_string.h" #include "swad_string.h"
#include "swad_tab.h" #include "swad_tab.h"
#include "swad_table.h" #include "swad_table.h"
#include "swad_text.h"
#include "swad_theme.h" #include "swad_theme.h"
/*****************************************************************************/ /*****************************************************************************/
@ -297,7 +297,7 @@ static void Deg_Configuration (bool PrintView)
extern const char *Txt_Short_name; extern const char *Txt_Short_name;
extern const char *Txt_Web; extern const char *Txt_Web;
extern const char *Txt_Shortcut; extern const char *Txt_Shortcut;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Courses; extern const char *Txt_Courses;
extern const char *Txt_Courses_of_DEGREE_X; extern const char *Txt_Courses_of_DEGREE_X;
extern const char *Txt_QR_code; extern const char *Txt_QR_code;
@ -483,10 +483,10 @@ static void Deg_Configuration (bool PrintView)
The_ClassForm[Gbl.Prefs.Theme], The_ClassForm[Gbl.Prefs.Theme],
Txt_Shortcut, Txt_Shortcut,
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.CurrentDeg.Deg.DegCod, Gbl.CurrentDeg.Deg.DegCod,
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.CurrentDeg.Deg.DegCod); Gbl.CurrentDeg.Deg.DegCod);
if (PrintView) if (PrintView)

View File

@ -39,9 +39,9 @@
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_institution.h" #include "swad_institution.h"
#include "swad_language.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_string.h" #include "swad_string.h"
#include "swad_text.h"
/*****************************************************************************/ /*****************************************************************************/
/************** External global variables from others modules ****************/ /************** External global variables from others modules ****************/

View File

@ -8715,7 +8715,7 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow)
extern const char *Txt_Upload_files; extern const char *Txt_Upload_files;
extern const char *Txt_or_you_can_upload_new_files_to_the_folder_X; extern const char *Txt_or_you_can_upload_new_files_to_the_folder_X;
extern const char *Txt_Select_one_or_more_files_from_your_computer_or_drag_and_drop_here; extern const char *Txt_Select_one_or_more_files_from_your_computer_or_drag_and_drop_here;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Done; extern const char *Txt_Done;
/***** Start box *****/ /***** Start box *****/
@ -8739,7 +8739,7 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow)
" style=\"display:inline-block; width:100%%;" " style=\"display:inline-block; width:100%%;"
" background:url('%s/upload320x320.gif') no-repeat center;\">", " background:url('%s/upload320x320.gif') no-repeat center;\">",
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.Prefs.IconsURL); Gbl.Prefs.IconsURL);
Par_PutHiddenParamLong ("act",Act_GetActCod (Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type])); Par_PutHiddenParamLong ("act",Act_GetActCod (Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type]));
Par_PutHiddenParamString ("ses",Gbl.Session.Id); Par_PutHiddenParamString ("ses",Gbl.Session.Id);

View File

@ -107,7 +107,7 @@ void Frm_StartFormId (Act_Action_t NextAction,const char *Id)
static void Frm_StartFormInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion, static void Frm_StartFormInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,
const char *Id,const char *Anchor,const char *OnSubmit) const char *Id,const char *Anchor,const char *OnSubmit)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
char ParamsStr[Frm_MAX_BYTES_PARAMS_STR + 1]; char ParamsStr[Frm_MAX_BYTES_PARAMS_STR + 1];
if (!Gbl.Form.Inside) if (!Gbl.Form.Inside)
@ -115,7 +115,7 @@ static void Frm_StartFormInternal (Act_Action_t NextAction,bool PutParameterLoca
/* Start form */ /* Start form */
fprintf (Gbl.F.Out,"<form method=\"post\" action=\"%s/%s", fprintf (Gbl.F.Out,"<form method=\"post\" action=\"%s/%s",
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language]); Lan_STR_LANG_ID[Gbl.Prefs.Language]);
if (Anchor) if (Anchor)
if (Anchor[0]) if (Anchor[0])
fprintf (Gbl.F.Out,"#%s",Anchor); fprintf (Gbl.F.Out,"#%s",Anchor);

View File

@ -2174,12 +2174,12 @@ static void For_WriteLinkToForum (struct Forum *Forum,
void For_SetForumName (struct Forum *Forum, void For_SetForumName (struct Forum *Forum,
char ForumName[For_MAX_BYTES_FORUM_NAME + 1], char ForumName[For_MAX_BYTES_FORUM_NAME + 1],
Txt_Language_t Language,bool UseHTMLEntities) Lan_Language_t Language,bool UseHTMLEntities)
{ {
extern const char *Txt_General; extern const char *Txt_General;
extern const char *Txt_General_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_General_NO_HTML[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_only_teachers; extern const char *Txt_only_teachers;
extern const char *Txt_only_teachers_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_only_teachers_NO_HTML[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Unknown_FORUM; extern const char *Txt_Unknown_FORUM;
struct Instit Ins; struct Instit Ins;
struct Centre Ctr; struct Centre Ctr;

View File

@ -124,7 +124,7 @@ void For_PutAllHiddenParamsForum (unsigned NumPageThreads,
void For_SetForumName (struct Forum *Forum, void For_SetForumName (struct Forum *Forum,
char ForumName[For_MAX_BYTES_FORUM_NAME + 1], char ForumName[For_MAX_BYTES_FORUM_NAME + 1],
Txt_Language_t Language,bool UseHTMLEntities); Lan_Language_t Language,bool UseHTMLEntities);
void For_ShowForumTheads (void); void For_ShowForumTheads (void);
unsigned For_GetNumTotalForumsOfType (For_ForumType_t ForumType, unsigned For_GetNumTotalForumsOfType (For_ForumType_t ForumType,

View File

@ -81,9 +81,9 @@ void Gbl_InitializeGlobals (void)
{ {
extern const char *The_ThemeId[The_NUM_THEMES]; extern const char *The_ThemeId[The_NUM_THEMES];
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS]; extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
extern const unsigned Txt_Current_CGI_SWAD_Language; extern const unsigned Lan_Current_CGI_SWAD_Language;
Rol_Role_t Role; Rol_Role_t Role;
Txt_Language_t Lan; Lan_Language_t Lan;
Gbl.Layout.WritingHTMLStart = Gbl.Layout.WritingHTMLStart =
Gbl.Layout.HTMLStartWritten = Gbl.Layout.HTMLStartWritten =
@ -129,7 +129,7 @@ void Gbl_InitializeGlobals (void)
Gbl.HiddenParamsInsertedIntoDB = false; Gbl.HiddenParamsInsertedIntoDB = false;
Gbl.Prefs.Language = Txt_Current_CGI_SWAD_Language; Gbl.Prefs.Language = Lan_Current_CGI_SWAD_Language;
Gbl.Prefs.FirstDayOfWeek = Cal_FIRST_DAY_OF_WEEK_DEFAULT; // Default first day of week Gbl.Prefs.FirstDayOfWeek = Cal_FIRST_DAY_OF_WEEK_DEFAULT; // Default first day of week
Gbl.Prefs.DateFormat = Dat_FORMAT_DEFAULT; // Default date format Gbl.Prefs.DateFormat = Dat_FORMAT_DEFAULT; // Default date format
Gbl.Prefs.Menu = Mnu_MENU_DEFAULT; // Default menu Gbl.Prefs.Menu = Mnu_MENU_DEFAULT; // Default menu
@ -254,8 +254,8 @@ void Gbl_InitializeGlobals (void)
Gbl.Ctys.Lst = NULL; Gbl.Ctys.Lst = NULL;
Gbl.Ctys.SelectedOrder = Cty_ORDER_DEFAULT; Gbl.Ctys.SelectedOrder = Cty_ORDER_DEFAULT;
Gbl.Ctys.EditingCty.CtyCod = -1L; Gbl.Ctys.EditingCty.CtyCod = -1L;
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
Gbl.Ctys.EditingCty.Name[Lan][0] = '\0'; Gbl.Ctys.EditingCty.Name[Lan][0] = '\0';

View File

@ -157,7 +157,7 @@ struct Globals
struct struct
{ {
Txt_Language_t Language; Lan_Language_t Language;
unsigned FirstDayOfWeek; unsigned FirstDayOfWeek;
Dat_Format_t DateFormat; Dat_Format_t DateFormat;
Mnu_Menu_t Menu; Mnu_Menu_t Menu;

View File

@ -36,9 +36,9 @@
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_holiday.h" #include "swad_holiday.h"
#include "swad_language.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_table.h" #include "swad_table.h"
#include "swad_text.h"
/*****************************************************************************/ /*****************************************************************************/
/************** External global variables from others modules ****************/ /************** External global variables from others modules ****************/

View File

@ -40,11 +40,11 @@
#include "swad_help.h" #include "swad_help.h"
#include "swad_hierarchy.h" #include "swad_hierarchy.h"
#include "swad_institution.h" #include "swad_institution.h"
#include "swad_language.h"
#include "swad_logo.h" #include "swad_logo.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_QR.h" #include "swad_QR.h"
#include "swad_table.h" #include "swad_table.h"
#include "swad_text.h"
#include "swad_user.h" #include "swad_user.h"
/*****************************************************************************/ /*****************************************************************************/
@ -307,7 +307,7 @@ static void Ins_Configuration (bool PrintView)
extern const char *Txt_Short_name; extern const char *Txt_Short_name;
extern const char *Txt_Web; extern const char *Txt_Web;
extern const char *Txt_Shortcut; extern const char *Txt_Shortcut;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_QR_code; extern const char *Txt_QR_code;
extern const char *Txt_Centres; extern const char *Txt_Centres;
extern const char *Txt_Centres_of_INSTITUTION_X; extern const char *Txt_Centres_of_INSTITUTION_X;
@ -494,10 +494,10 @@ static void Ins_Configuration (bool PrintView)
The_ClassForm[Gbl.Prefs.Theme], The_ClassForm[Gbl.Prefs.Theme],
Txt_Shortcut, Txt_Shortcut,
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.CurrentIns.Ins.InsCod, Gbl.CurrentIns.Ins.InsCod,
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.CurrentIns.Ins.InsCod); Gbl.CurrentIns.Ins.InsCod);
if (PrintView) if (PrintView)
@ -1297,7 +1297,7 @@ void Ins_FlushCacheFullNameAndCtyOfInstitution (void)
static void Ins_GetFullNameAndCtyOfInstitution (struct Instit *Ins, static void Ins_GetFullNameAndCtyOfInstitution (struct Instit *Ins,
char CtyName[Hie_MAX_BYTES_FULL_NAME + 1]) char CtyName[Hie_MAX_BYTES_FULL_NAME + 1])
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -1328,7 +1328,7 @@ static void Ins_GetFullNameAndCtyOfInstitution (struct Instit *Ins,
" FROM institutions,countries" " FROM institutions,countries"
" WHERE institutions.InsCod=%ld" " WHERE institutions.InsCod=%ld"
" AND institutions.CtyCod=countries.CtyCod", " AND institutions.CtyCod=countries.CtyCod",
Txt_STR_LANG_ID[Gbl.Prefs.Language],Ins->InsCod) == 1) Lan_STR_LANG_ID[Gbl.Prefs.Language],Ins->InsCod) == 1)
{ {
/* Get row */ /* Get row */
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);

View File

@ -41,6 +41,25 @@
extern struct Globals Gbl; extern struct Globals Gbl;
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES] = // ISO 639-1 language codes
{
"", // Lan_LANGUAGE_UNKNOWN
"ca", // Lan_LANGUAGE_CA
"de", // Lan_LANGUAGE_DE
"en", // Lan_LANGUAGE_EN
"es", // Lan_LANGUAGE_ES
"fr", // Lan_LANGUAGE_FR
"gn", // Lan_LANGUAGE_GN
"it", // Lan_LANGUAGE_IT
"pl", // Lan_LANGUAGE_PL
"pt", // Lan_LANGUAGE_PT
};
const unsigned Lan_Current_CGI_SWAD_Language = ((unsigned) L);
/*****************************************************************************/ /*****************************************************************************/
/****************************** Private constants ****************************/ /****************************** Private constants ****************************/
/*****************************************************************************/ /*****************************************************************************/
@ -97,16 +116,16 @@ static void Lan_PutIconsLanguage (void)
void Lan_PutSelectorToSelectLanguage (void) void Lan_PutSelectorToSelectLanguage (void)
{ {
extern const char *Txt_STR_LANG_NAME[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_STR_LANG_NAME[1 + Lan_NUM_LANGUAGES];
Txt_Language_t Lan; Lan_Language_t Lan;
Frm_StartForm (ActReqChgLan); Frm_StartForm (ActReqChgLan);
fprintf (Gbl.F.Out,"<select name=\"Lan\"" fprintf (Gbl.F.Out,"<select name=\"Lan\""
" style=\"width:112px; margin:0;\"" " style=\"width:112px; margin:0;\""
" onchange=\"document.getElementById('%s').submit();\">", " onchange=\"document.getElementById('%s').submit();\">",
Gbl.Form.Id); Gbl.Form.Id);
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
{ {
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Lan); fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Lan);
@ -124,10 +143,10 @@ void Lan_PutSelectorToSelectLanguage (void)
void Lan_AskChangeLanguage (void) void Lan_AskChangeLanguage (void)
{ {
extern const char *Txt_Do_you_want_to_change_your_language_to_LANGUAGE[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_Do_you_want_to_change_your_language_to_LANGUAGE[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Do_you_want_to_change_the_language_to_LANGUAGE[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_Do_you_want_to_change_the_language_to_LANGUAGE[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Switch_to_LANGUAGE[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_Switch_to_LANGUAGE[1 + Lan_NUM_LANGUAGES];
Txt_Language_t CurrentLanguage = Gbl.Prefs.Language; Lan_Language_t CurrentLanguage = Gbl.Prefs.Language;
/***** Get param language *****/ /***** Get param language *****/
Gbl.Prefs.Language = Lan_GetParamLanguage (); // Change temporarily language to set form action Gbl.Prefs.Language = Lan_GetParamLanguage (); // Change temporarily language to set form action
@ -179,7 +198,7 @@ void Lan_ChangeLanguage (void)
void Lan_UpdateMyLanguageToCurrentLanguage (void) void Lan_UpdateMyLanguageToCurrentLanguage (void)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
/***** Set my language to the current language *****/ /***** Set my language to the current language *****/
Gbl.Usrs.Me.UsrDat.Prefs.Language = Gbl.Prefs.Language; Gbl.Usrs.Me.UsrDat.Prefs.Language = Gbl.Prefs.Language;
@ -187,7 +206,7 @@ void Lan_UpdateMyLanguageToCurrentLanguage (void)
/***** Update my language in database *****/ /***** Update my language in database *****/
DB_QueryUPDATE ("can not update your language", DB_QueryUPDATE ("can not update your language",
"UPDATE usr_data SET Language='%s' WHERE UsrCod=%ld", "UPDATE usr_data SET Language='%s' WHERE UsrCod=%ld",
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.Usrs.Me.UsrDat.UsrCod); Gbl.Usrs.Me.UsrDat.UsrCod);
} }
@ -195,13 +214,13 @@ void Lan_UpdateMyLanguageToCurrentLanguage (void)
/*************************** Get parameter language **************************/ /*************************** Get parameter language **************************/
/*****************************************************************************/ /*****************************************************************************/
Txt_Language_t Lan_GetParamLanguage (void) Lan_Language_t Lan_GetParamLanguage (void)
{ {
extern const unsigned Txt_Current_CGI_SWAD_Language; extern const unsigned Lan_Current_CGI_SWAD_Language;
return (Txt_Language_t) return (Lan_Language_t)
Par_GetParToUnsignedLong ("Lan", Par_GetParToUnsignedLong ("Lan",
1, 1,
Txt_NUM_LANGUAGES, Lan_NUM_LANGUAGES,
(unsigned long) Txt_Current_CGI_SWAD_Language); (unsigned long) Lan_Current_CGI_SWAD_Language);
} }

View File

@ -31,10 +31,30 @@
/***************************** Public constants ******************************/ /***************************** Public constants ******************************/
/*****************************************************************************/ /*****************************************************************************/
#define Lan_NUM_LANGUAGES 9 // From 1 to 9. 0 is reserved to unknown language
#ifndef L
#define L 3 // English
#endif
/*****************************************************************************/ /*****************************************************************************/
/******************************* Public types ********************************/ /******************************* Public types ********************************/
/*****************************************************************************/ /*****************************************************************************/
typedef enum
{
Lan_LANGUAGE_UNKNOWN = 0,
Lan_LANGUAGE_CA = 1,
Lan_LANGUAGE_DE = 2,
Lan_LANGUAGE_EN = 3,
Lan_LANGUAGE_ES = 4,
Lan_LANGUAGE_FR = 5,
Lan_LANGUAGE_GN = 6,
Lan_LANGUAGE_IT = 7,
Lan_LANGUAGE_PL = 8,
Lan_LANGUAGE_PT = 9,
} Lan_Language_t; // ISO 639-1 language codes
/*****************************************************************************/ /*****************************************************************************/
/***************************** Public prototypes *****************************/ /***************************** Public prototypes *****************************/
/*****************************************************************************/ /*****************************************************************************/
@ -48,6 +68,6 @@ void Lan_AskChangeLanguage (void);
void Lan_ChangeLanguage (void); void Lan_ChangeLanguage (void);
void Lan_UpdateMyLanguageToCurrentLanguage (void); void Lan_UpdateMyLanguageToCurrentLanguage (void);
Txt_Language_t Lan_GetParamLanguage (void); Lan_Language_t Lan_GetParamLanguage (void);
#endif #endif

View File

@ -108,8 +108,8 @@ static void Lay_HelpTextEditor (const char *Text,const char *InlineMath,const ch
void Lay_WriteStartOfPage (void) void Lay_WriteStartOfPage (void)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const unsigned Txt_Current_CGI_SWAD_Language; extern const unsigned Lan_Current_CGI_SWAD_Language;
extern const char *The_TabOnBgColors[The_NUM_THEMES]; extern const char *The_TabOnBgColors[The_NUM_THEMES];
extern const char *Txt_NEW_YEAR_GREETING; extern const char *Txt_NEW_YEAR_GREETING;
const char *LayoutMainZone[Mnu_NUM_MENUS] = const char *LayoutMainZone[Mnu_NUM_MENUS] =
@ -172,7 +172,7 @@ void Lay_WriteStartOfPage (void)
"SWADroid," "SWADroid,"
"LMS," "LMS,"
"Learning Management System\" />\n", "Learning Management System\" />\n",
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Cfg_PLATFORM_SHORT_NAME); Cfg_PLATFORM_SHORT_NAME);
/* Viewport (used for responsive design) */ /* Viewport (used for responsive design) */
@ -237,7 +237,7 @@ void Lay_WriteStartOfPage (void)
/* Redirect to correct language */ /* Redirect to correct language */
if (Gbl.Usrs.Me.Logged && // I am logged if (Gbl.Usrs.Me.Logged && // I am logged
Gbl.Usrs.Me.UsrDat.Prefs.Language != Txt_Current_CGI_SWAD_Language) // My language != current language Gbl.Usrs.Me.UsrDat.Prefs.Language != Lan_Current_CGI_SWAD_Language) // My language != current language
{ {
if (Gbl.Action.Act == ActLogIn || // Regular log in if (Gbl.Action.Act == ActLogIn || // Regular log in
Gbl.Action.Act == ActLogInNew) // Log in when checking account Gbl.Action.Act == ActLogInNew) // Log in when checking account
@ -441,24 +441,24 @@ static void Lay_WritePageTitle (void)
static void Lay_WriteRedirToMyLangOnLogIn (void) static void Lay_WriteRedirToMyLangOnLogIn (void)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
fprintf (Gbl.F.Out,"<meta http-equiv=\"refresh\"" fprintf (Gbl.F.Out,"<meta http-equiv=\"refresh\""
" content=\"0; url='%s/%s?act=%ld&amp;ses=%s'\">", " content=\"0; url='%s/%s?act=%ld&amp;ses=%s'\">",
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Usrs.Me.UsrDat.Prefs.Language], Lan_STR_LANG_ID[Gbl.Usrs.Me.UsrDat.Prefs.Language],
Act_GetActCod (ActLogInLan), Act_GetActCod (ActLogInLan),
Gbl.Session.Id); Gbl.Session.Id);
} }
static void Lay_WriteRedirToMyLangOnViewUsrAgd (void) static void Lay_WriteRedirToMyLangOnViewUsrAgd (void)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
fprintf (Gbl.F.Out,"<meta http-equiv=\"refresh\"" fprintf (Gbl.F.Out,"<meta http-equiv=\"refresh\""
" content=\"0; url='%s/%s?act=%ld&amp;ses=%s&amp;agd=@%s'\">", " content=\"0; url='%s/%s?act=%ld&amp;ses=%s&amp;agd=@%s'\">",
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Usrs.Me.UsrDat.Prefs.Language], Lan_STR_LANG_ID[Gbl.Usrs.Me.UsrDat.Prefs.Language],
Act_GetActCod (ActLogInUsrAgdLan), Act_GetActCod (ActLogInUsrAgdLan),
Gbl.Session.Id, Gbl.Session.Id,
Gbl.Usrs.Other.UsrDat.Nickname); Gbl.Usrs.Other.UsrDat.Nickname);
@ -664,7 +664,7 @@ static void Lay_WriteScriptMathJax (void)
static void Lay_WriteScriptInit (void) static void Lay_WriteScriptInit (void)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n"); fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n");
@ -678,7 +678,7 @@ static void Lay_WriteScriptInit (void)
// Put the focus on login form // Put the focus on login form
fprintf (Gbl.F.Out," ActionAJAX = \"%s\";\n" fprintf (Gbl.F.Out," ActionAJAX = \"%s\";\n"
" setTimeout(\"refreshConnected()\",%lu);\n", " setTimeout(\"refreshConnected()\",%lu);\n",
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.Usrs.Connected.TimeToRefreshInMs); Gbl.Usrs.Connected.TimeToRefreshInMs);
if (Gbl.Action.Act == ActLstClk) if (Gbl.Action.Act == ActLstClk)
@ -1642,7 +1642,7 @@ static void Lay_HelpTextEditor (const char *Text,const char *InlineMath,const ch
void Lay_StartHTMLFile (FILE *File,const char *Title) void Lay_StartHTMLFile (FILE *File,const char *Title)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
fprintf (File,"<!DOCTYPE html>\n" fprintf (File,"<!DOCTYPE html>\n"
"<html lang=\"%s\">\n" "<html lang=\"%s\">\n"
@ -1651,6 +1651,6 @@ void Lay_StartHTMLFile (FILE *File,const char *Title)
" content=\"text/html;charset=windows-1252\" />\n" " content=\"text/html;charset=windows-1252\" />\n"
"<title>%s</title>\n" "<title>%s</title>\n"
"</head>\n", "</head>\n",
Txt_STR_LANG_ID[Gbl.Prefs.Language], // Language Lan_STR_LANG_ID[Gbl.Prefs.Language], // Language
Title); // Page title Title); // Page title
} }

View File

@ -36,10 +36,10 @@
#include "swad_database.h" #include "swad_database.h"
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_language.h"
#include "swad_link.h" #include "swad_link.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_table.h" #include "swad_table.h"
#include "swad_text.h"
/*****************************************************************************/ /*****************************************************************************/
/************** External global variables from others modules ****************/ /************** External global variables from others modules ****************/

View File

@ -38,12 +38,12 @@
#include "swad_database.h" #include "swad_database.h"
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_language.h"
#include "swad_mail.h" #include "swad_mail.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_QR.h" #include "swad_QR.h"
#include "swad_tab.h" #include "swad_tab.h"
#include "swad_table.h" #include "swad_table.h"
#include "swad_text.h"
/*****************************************************************************/ /*****************************************************************************/
/************** External global variables from others modules ****************/ /************** External global variables from others modules ****************/
@ -1914,8 +1914,8 @@ void Mai_CreateFileNameMail (void)
void Mai_WriteWelcomeNoteEMail (struct UsrData *UsrDat) void Mai_WriteWelcomeNoteEMail (struct UsrData *UsrDat)
{ {
extern const char *Txt_Dear_NO_HTML[Usr_NUM_SEXS][1 + Txt_NUM_LANGUAGES]; extern const char *Txt_Dear_NO_HTML[Usr_NUM_SEXS][1 + Lan_NUM_LANGUAGES];
extern const char *Txt_user_NO_HTML[Usr_NUM_SEXS][1 + Txt_NUM_LANGUAGES]; extern const char *Txt_user_NO_HTML[Usr_NUM_SEXS][1 + Lan_NUM_LANGUAGES];
fprintf (Gbl.Msg.FileMail,"%s %s:\n", fprintf (Gbl.Msg.FileMail,"%s %s:\n",
Txt_Dear_NO_HTML[UsrDat->Sex][UsrDat->Prefs.Language], Txt_Dear_NO_HTML[UsrDat->Sex][UsrDat->Prefs.Language],
@ -1927,9 +1927,9 @@ void Mai_WriteWelcomeNoteEMail (struct UsrData *UsrDat)
/****************** Write a foot note in the automatic email *****************/ /****************** Write a foot note in the automatic email *****************/
/*****************************************************************************/ /*****************************************************************************/
void Mai_WriteFootNoteEMail (Txt_Language_t Language) void Mai_WriteFootNoteEMail (Lan_Language_t Language)
{ {
extern const char *Txt_Please_do_not_reply_to_this_automatically_generated_email_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_Please_do_not_reply_to_this_automatically_generated_email_NO_HTML[1 + Lan_NUM_LANGUAGES];
fprintf (Gbl.Msg.FileMail,"%s\n" fprintf (Gbl.Msg.FileMail,"%s\n"
"%s\n" "%s\n"

View File

@ -92,7 +92,7 @@ void Mai_ConfirmEmail (void);
void Mai_CreateFileNameMail (void); void Mai_CreateFileNameMail (void);
void Mai_WriteWelcomeNoteEMail (struct UsrData *UsrDat); void Mai_WriteWelcomeNoteEMail (struct UsrData *UsrDat);
void Mai_WriteFootNoteEMail (Txt_Language_t Language); void Mai_WriteFootNoteEMail (Lan_Language_t Language);
bool Mai_ICanSeeOtherUsrEmail (const struct UsrData *UsrDat); bool Mai_ICanSeeOtherUsrEmail (const struct UsrData *UsrDat);

View File

@ -1605,21 +1605,21 @@ void Ntf_SendPendingNotifByEMailToAllUsrs (void)
static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsigned *NumNotif,unsigned *NumMails) static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsigned *NumNotif,unsigned *NumMails)
{ {
extern const char *Txt_NOTIFY_EVENTS_There_is_a_new_event_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_NOTIFY_EVENTS_There_is_a_new_event_NO_HTML[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_NOTIFY_EVENTS_There_are_X_new_events_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_NOTIFY_EVENTS_There_are_X_new_events_NO_HTML[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Txt_NUM_LANGUAGES]; extern const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Course_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_Course_NO_HTML[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Forum_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_Forum_NO_HTML[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_MSG_From_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_MSG_From_NO_HTML[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Go_to_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_Go_to_NO_HTML[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_TAB_Messages_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_TAB_Messages_NO_HTML[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Notifications_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_Notifications_NO_HTML[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_If_you_no_longer_wish_to_receive_email_notifications_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_If_you_no_longer_wish_to_receive_email_notifications_NO_HTML[1 + Lan_NUM_LANGUAGES];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
unsigned long NumRow; unsigned long NumRow;
unsigned long NumRows; unsigned long NumRows;
Txt_Language_t ToUsrLanguage; Lan_Language_t ToUsrLanguage;
struct UsrData FromUsrDat; struct UsrData FromUsrDat;
Ntf_NotifyEvent_t NotifyEvent = (Ntf_NotifyEvent_t) 0; // Initialized to avoid warning Ntf_NotifyEvent_t NotifyEvent = (Ntf_NotifyEvent_t) 0; // Initialized to avoid warning
struct Instit Ins; struct Instit Ins;
@ -1664,7 +1664,7 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
{ {
/***** If user has no language, set it to current language *****/ /***** If user has no language, set it to current language *****/
ToUsrLanguage = ToUsrDat->Prefs.Language; ToUsrLanguage = ToUsrDat->Prefs.Language;
if (ToUsrLanguage == Txt_LANGUAGE_UNKNOWN) if (ToUsrLanguage == Lan_LANGUAGE_UNKNOWN)
ToUsrLanguage = Gbl.Prefs.Language; ToUsrLanguage = Gbl.Prefs.Language;
/***** Create temporary file for mail content *****/ /***** Create temporary file for mail content *****/

View File

@ -444,7 +444,7 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
int Pwd_SendNewPasswordByEmail (char NewRandomPlainPassword[Pwd_MAX_BYTES_PLAIN_PASSWORD + 1]) int Pwd_SendNewPasswordByEmail (char NewRandomPlainPassword[Pwd_MAX_BYTES_PLAIN_PASSWORD + 1])
{ {
extern const char *Txt_The_following_password_has_been_assigned_to_you_to_log_in_X_NO_HTML; extern const char *Txt_The_following_password_has_been_assigned_to_you_to_log_in_X_NO_HTML;
extern const char *Txt_New_password_NO_HTML[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_New_password_NO_HTML[1 + Lan_NUM_LANGUAGES];
char Command[2048 + char Command[2048 +
Cfg_MAX_BYTES_SMTP_PASSWORD + Cfg_MAX_BYTES_SMTP_PASSWORD +
Cns_MAX_BYTES_EMAIL_ADDRESS + Cns_MAX_BYTES_EMAIL_ADDRESS +

View File

@ -36,10 +36,10 @@
#include "swad_database.h" #include "swad_database.h"
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_language.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_place.h" #include "swad_place.h"
#include "swad_table.h" #include "swad_table.h"
#include "swad_text.h"
/*****************************************************************************/ /*****************************************************************************/
/************** External global variables from others modules ****************/ /************** External global variables from others modules ****************/

View File

@ -42,10 +42,10 @@ TODO: Check if web service is called from an authorized IP.
#include "swad_database.h" #include "swad_database.h"
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_language.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_plugin.h" #include "swad_plugin.h"
#include "swad_session.h" #include "swad_session.h"
#include "swad_text.h"
#include "swad_web_service.h" #include "swad_web_service.h"
/*****************************************************************************/ /*****************************************************************************/

View File

@ -45,7 +45,6 @@
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_preference.h" #include "swad_preference.h"
#include "swad_privacy.h" #include "swad_privacy.h"
#include "swad_text.h"
/*****************************************************************************/ /*****************************************************************************/
/*************** External global variables from others modules ***************/ /*************** External global variables from others modules ***************/

View File

@ -36,6 +36,7 @@
#include "swad_follow.h" #include "swad_follow.h"
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_language.h"
#include "swad_network.h" #include "swad_network.h"
#include "swad_nickname.h" #include "swad_nickname.h"
#include "swad_notification.h" #include "swad_notification.h"
@ -46,7 +47,6 @@
#include "swad_role.h" #include "swad_role.h"
#include "swad_role_type.h" #include "swad_role_type.h"
#include "swad_social.h" #include "swad_social.h"
#include "swad_text.h"
#include "swad_theme.h" #include "swad_theme.h"
#include "swad_user.h" #include "swad_user.h"
@ -116,13 +116,13 @@ void Prf_SeeSocialProfiles (void)
char *Prf_GetURLPublicProfile (char URL[Cns_MAX_BYTES_WWW + 1], char *Prf_GetURLPublicProfile (char URL[Cns_MAX_BYTES_WWW + 1],
const char *NicknameWithoutArroba) const char *NicknameWithoutArroba)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
/***** Build URL using nickname *****/ /***** Build URL using nickname *****/
snprintf (URL,Cns_MAX_BYTES_WWW + 1, snprintf (URL,Cns_MAX_BYTES_WWW + 1,
"%s/%s?usr=@%s", "%s/%s?usr=@%s",
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
NicknameWithoutArroba); NicknameWithoutArroba);
return URL; return URL;

View File

@ -2939,7 +2939,7 @@ static void Rec_ShowRole (struct UsrData *UsrDat,
Rec_SharedRecordViewType_t TypeOfView, Rec_SharedRecordViewType_t TypeOfView,
const char *ClassForm) const char *ClassForm)
{ {
extern const char *Usr_StringsSexDB[Usr_NUM_SEXS]; extern const char *Usr_StringsSexIcons[Usr_NUM_SEXS];
extern const char *Txt_Role; extern const char *Txt_Role;
extern const char *Txt_Sex; extern const char *Txt_Sex;
extern const char *Txt_SEX_SINGULAR_Abc[Usr_NUM_SEXS]; extern const char *Txt_SEX_SINGULAR_Abc[Usr_NUM_SEXS];
@ -3172,14 +3172,9 @@ static void Rec_ShowRole (struct UsrData *UsrDat,
if (Sex == Gbl.Usrs.Me.UsrDat.Sex) if (Sex == Gbl.Usrs.Me.UsrDat.Sex)
fprintf (Gbl.F.Out," checked=\"checked\""); fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," required=\"required\" />" fprintf (Gbl.F.Out," required=\"required\" />"
"<img src=\"%s/%s16x16.gif\"" "%s %s"
" alt=\"%s\" title=\"%s\" class=\"ICO20x20\" />"
"%s"
"</label>", "</label>",
Gbl.Prefs.IconsURL,Usr_StringsSexDB[Sex], Usr_StringsSexIcons[Sex],Txt_SEX_SINGULAR_Abc[Sex]);
Txt_SEX_SINGULAR_Abc[Sex],
Txt_SEX_SINGULAR_Abc[Sex],
Txt_SEX_SINGULAR_Abc[Sex]);
} }
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"</tr>"); "</tr>");

View File

@ -615,7 +615,7 @@ static void Sch_SearchInDB (void)
static unsigned Sch_SearchCountriesInDB (const char *RangeQuery) static unsigned Sch_SearchCountriesInDB (const char *RangeQuery)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
char SearchQuery[Sch_MAX_BYTES_SEARCH_QUERY + 1]; char SearchQuery[Sch_MAX_BYTES_SEARCH_QUERY + 1];
char FieldName[4+1+2+1]; // Example: Name_en char FieldName[4+1+2+1]; // Example: Name_en
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
@ -632,7 +632,7 @@ static unsigned Sch_SearchCountriesInDB (const char *RangeQuery)
/***** Split countries string into words *****/ /***** Split countries string into words *****/
snprintf (FieldName,sizeof (FieldName), snprintf (FieldName,sizeof (FieldName),
"Name_%s", "Name_%s",
Txt_STR_LANG_ID[Gbl.Prefs.Language]); Lan_STR_LANG_ID[Gbl.Prefs.Language]);
if (Sch_BuildSearchQuery (SearchQuery,FieldName,NULL,NULL)) if (Sch_BuildSearchQuery (SearchQuery,FieldName,NULL,NULL))
{ {
/***** Query database and list institutions found *****/ /***** Query database and list institutions found *****/
@ -642,7 +642,7 @@ static unsigned Sch_SearchCountriesInDB (const char *RangeQuery)
" WHERE %s%s" " WHERE %s%s"
" ORDER BY Name_%s", " ORDER BY Name_%s",
SearchQuery,RangeQuery, SearchQuery,RangeQuery,
Txt_STR_LANG_ID[Gbl.Prefs.Language]); Lan_STR_LANG_ID[Gbl.Prefs.Language]);
Cty_ListCtysFound (&mysql_res,NumCtys); Cty_ListCtysFound (&mysql_res,NumCtys);
return NumCtys; return NumCtys;
} }
@ -658,7 +658,7 @@ static unsigned Sch_SearchCountriesInDB (const char *RangeQuery)
static unsigned Sch_SearchInstitutionsInDB (const char *RangeQuery) static unsigned Sch_SearchInstitutionsInDB (const char *RangeQuery)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
char SearchQuery[Sch_MAX_BYTES_SEARCH_QUERY + 1]; char SearchQuery[Sch_MAX_BYTES_SEARCH_QUERY + 1];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
unsigned NumInss; unsigned NumInss;
@ -681,7 +681,7 @@ static unsigned Sch_SearchInstitutionsInDB (const char *RangeQuery)
"%s" "%s"
" ORDER BY institutions.FullName,countries.Name_%s", " ORDER BY institutions.FullName,countries.Name_%s",
SearchQuery,RangeQuery, SearchQuery,RangeQuery,
Txt_STR_LANG_ID[Gbl.Prefs.Language]); Lan_STR_LANG_ID[Gbl.Prefs.Language]);
Ins_ListInssFound (&mysql_res,NumInss); Ins_ListInssFound (&mysql_res,NumInss);
return NumInss; return NumInss;
} }

View File

@ -8872,13 +8872,13 @@ static void Sta_GetAndShowNumUsrsPerLanguage (void)
extern const char *Hlp_ANALYTICS_Figures_language; extern const char *Hlp_ANALYTICS_Figures_language;
extern const char *Txt_STAT_USE_STAT_TYPES[Sta_NUM_FIGURES]; extern const char *Txt_STAT_USE_STAT_TYPES[Sta_NUM_FIGURES];
extern const char *Txt_Language; extern const char *Txt_Language;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_STR_LANG_NAME[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_STR_LANG_NAME[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_No_of_users; extern const char *Txt_No_of_users;
extern const char *Txt_PERCENT_of_users; extern const char *Txt_PERCENT_of_users;
Txt_Language_t Lan; Lan_Language_t Lan;
char *SubQuery; char *SubQuery;
unsigned NumUsrs[1 + Txt_NUM_LANGUAGES]; unsigned NumUsrs[1 + Lan_NUM_LANGUAGES];
unsigned NumUsrsTotal = 0; unsigned NumUsrsTotal = 0;
/***** Start box and table *****/ /***** Start box and table *****/
@ -8902,13 +8902,13 @@ static void Sta_GetAndShowNumUsrsPerLanguage (void)
Txt_PERCENT_of_users); Txt_PERCENT_of_users);
/***** For each language... *****/ /***** For each language... *****/
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
{ {
/* Get the number of users who have chosen this language from database */ /* Get the number of users who have chosen this language from database */
if (asprintf (&SubQuery,"usr_data.Language='%s'", if (asprintf (&SubQuery,"usr_data.Language='%s'",
Txt_STR_LANG_ID[Lan]) < 0) Lan_STR_LANG_ID[Lan]) < 0)
Lay_NotEnoughMemoryExit (); Lay_NotEnoughMemoryExit ();
NumUsrs[Lan] = Sta_GetNumUsrsWhoChoseAnOption (SubQuery); NumUsrs[Lan] = Sta_GetNumUsrsWhoChoseAnOption (SubQuery);
free ((void *) SubQuery); free ((void *) SubQuery);
@ -8918,8 +8918,8 @@ static void Sta_GetAndShowNumUsrsPerLanguage (void)
} }
/***** Write number of users who have chosen each language *****/ /***** Write number of users who have chosen each language *****/
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"DAT LEFT_MIDDLE\">" "<td class=\"DAT LEFT_MIDDLE\">"

View File

@ -112,7 +112,7 @@ action="https://localhost/swad/es" method="post">
void Str_InsertLinks (char *Txt,unsigned long MaxLength,size_t MaxCharsURLOnScreen) void Str_InsertLinks (char *Txt,unsigned long MaxLength,size_t MaxCharsURLOnScreen)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
char ParamsStr[Frm_MAX_BYTES_PARAMS_STR]; char ParamsStr[Frm_MAX_BYTES_PARAMS_STR];
char Anchor1Nick[256 + 256 + 256 + Cns_BYTES_SESSION_ID + 256 + 256]; char Anchor1Nick[256 + 256 + 256 + Cns_BYTES_SESSION_ID + 256 + 256];
char Anchor2Nick[256 + Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64]; char Anchor2Nick[256 + Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64];
@ -316,7 +316,7 @@ void Str_InsertLinks (char *Txt,unsigned long MaxLength,size_t MaxCharsURLOnScre
"%s" "%s"
"<input type=\"hidden\" name=\"usr\" value=\"", "<input type=\"hidden\" name=\"usr\" value=\"",
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.Usrs.Me.Logged ? Gbl.Form.UniqueId : Gbl.Usrs.Me.Logged ? Gbl.Form.UniqueId :
Gbl.Form.Id, Gbl.Form.Id,
ParamsStr); ParamsStr);

View File

@ -43,12 +43,12 @@
#include "swad_global.h" #include "swad_global.h"
#include "swad_ID.h" #include "swad_ID.h"
#include "swad_image.h" #include "swad_image.h"
#include "swad_language.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_table.h" #include "swad_table.h"
#include "swad_theme.h" #include "swad_theme.h"
#include "swad_test.h" #include "swad_test.h"
#include "swad_test_import.h" #include "swad_test_import.h"
#include "swad_text.h"
#include "swad_user.h" #include "swad_user.h"
#include "swad_xml.h" #include "swad_xml.h"

View File

@ -71,6 +71,7 @@
#include "swad_holiday.h" #include "swad_holiday.h"
#include "swad_info.h" #include "swad_info.h"
#include "swad_institution.h" #include "swad_institution.h"
#include "swad_language.h"
#include "swad_mail.h" #include "swad_mail.h"
#include "swad_menu.h" #include "swad_menu.h"
#include "swad_notification.h" #include "swad_notification.h"
@ -86,7 +87,6 @@
#include "swad_syllabus.h" #include "swad_syllabus.h"
#include "swad_tab.h" #include "swad_tab.h"
#include "swad_test.h" #include "swad_test.h"
#include "swad_text.h"
#include "swad_timetable.h" #include "swad_timetable.h"
#include "swad_user.h" #include "swad_user.h"
@ -105,23 +105,7 @@ const char *Txt_NEW_LINE = "\r\n"; // End of line in a file. If we put only \n t
// i with tilde: &#297; // i with tilde: &#297;
/***** Languages *****/ /***** Languages *****/
const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES] = // ISO 639-1 language codes const char *Txt_STR_LANG_NAME[1 + Lan_NUM_LANGUAGES] =
{
"", // Txt_LANGUAGE_UNKNOWN
"ca", // Txt_LANGUAGE_CA
"de", // Txt_LANGUAGE_DE
"en", // Txt_LANGUAGE_EN
"es", // Txt_LANGUAGE_ES
"fr", // Txt_LANGUAGE_FR
"gn", // Txt_LANGUAGE_GN
"it", // Txt_LANGUAGE_IT
"pl", // Txt_LANGUAGE_PL
"pt", // Txt_LANGUAGE_PT
};
const unsigned Txt_Current_CGI_SWAD_Language = (unsigned) L;
const char *Txt_STR_LANG_NAME[1 + Txt_NUM_LANGUAGES] =
{ {
"", "",
"Catal&agrave;", "Catal&agrave;",
@ -134,7 +118,7 @@ const char *Txt_STR_LANG_NAME[1 + Txt_NUM_LANGUAGES] =
"Polski", "Polski",
"Portugu&ecirc;s", "Portugu&ecirc;s",
}; };
const char *Txt_Do_you_want_to_change_the_language_to_LANGUAGE[1 + Txt_NUM_LANGUAGES] = const char *Txt_Do_you_want_to_change_the_language_to_LANGUAGE[1 + Lan_NUM_LANGUAGES] =
{ {
"", "",
"Voleu canviar l'idioma a catal&agrave;?", "Voleu canviar l'idioma a catal&agrave;?",
@ -147,7 +131,7 @@ const char *Txt_Do_you_want_to_change_the_language_to_LANGUAGE[1 + Txt_NUM_LANGU
"Czy chcesz zmieni&cacute; j&eogon;zyk na polski?", "Czy chcesz zmieni&cacute; j&eogon;zyk na polski?",
"Voc&ecirc; quer mudar o idioma para portugu&ecirc;s?", "Voc&ecirc; quer mudar o idioma para portugu&ecirc;s?",
}; };
const char *Txt_Do_you_want_to_change_your_language_to_LANGUAGE[1 + Txt_NUM_LANGUAGES] = const char *Txt_Do_you_want_to_change_your_language_to_LANGUAGE[1 + Lan_NUM_LANGUAGES] =
{ {
"", "",
"Voleu canviar el seu idioma a catal&agrave;?", "Voleu canviar el seu idioma a catal&agrave;?",
@ -160,7 +144,7 @@ const char *Txt_Do_you_want_to_change_your_language_to_LANGUAGE[1 + Txt_NUM_LANG
"Czy chcesz zmieni&cacute; j&eogon;zyk na polski?", "Czy chcesz zmieni&cacute; j&eogon;zyk na polski?",
"Voc&ecirc; quer mudar suo idioma para portugu&ecirc;s?", "Voc&ecirc; quer mudar suo idioma para portugu&ecirc;s?",
}; };
const char *Txt_Switch_to_LANGUAGE[1 + Txt_NUM_LANGUAGES] = const char *Txt_Switch_to_LANGUAGE[1 + Lan_NUM_LANGUAGES] =
{ {
"", "",
"Canviar a catal&agrave;", "Canviar a catal&agrave;",
@ -173,7 +157,7 @@ const char *Txt_Switch_to_LANGUAGE[1 + Txt_NUM_LANGUAGES] =
"Prze&lstrok;&aogon;cz na polski", "Prze&lstrok;&aogon;cz na polski",
"Mudar para portugu&ecirc;s", "Mudar para portugu&ecirc;s",
}; };
const char *Txt_Switching_to_LANGUAGE[1 + Txt_NUM_LANGUAGES] = const char *Txt_Switching_to_LANGUAGE[1 + Lan_NUM_LANGUAGES] =
{ {
"", "",
"Canviant a catal&agrave;&hellip;", "Canviant a catal&agrave;&hellip;",

View File

@ -1,62 +0,0 @@
// swad_text.h: text messages on screen, in several languages
#ifndef _SWAD_TXT
#define _SWAD_TXT
/*
SWAD (Shared Workspace At a Distance in Spanish),
is a web platform developed at the University of Granada (Spain),
and used to support university teaching.
This file is part of SWAD core.
Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*****************************************************************************/
/********************************** Headers **********************************/
/*****************************************************************************/
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Txt_NUM_LANGUAGES 9 // From 1 to 9. 0 is reserved to unknown language
/*****************************************************************************/
/******************************** Public types *******************************/
/*****************************************************************************/
typedef enum
{
Txt_LANGUAGE_UNKNOWN = 0,
Txt_LANGUAGE_CA = 1,
Txt_LANGUAGE_DE = 2,
Txt_LANGUAGE_EN = 3,
Txt_LANGUAGE_ES = 4,
Txt_LANGUAGE_FR = 5,
Txt_LANGUAGE_GN = 6,
Txt_LANGUAGE_IT = 7,
Txt_LANGUAGE_PL = 8,
Txt_LANGUAGE_PT = 9,
} Txt_Language_t; // ISO 639-1 language codes
#ifndef L
#define L 3 // English
#endif
/*****************************************************************************/
/****************************** Public prototypes ****************************/
/*****************************************************************************/
#endif

View File

@ -64,8 +64,8 @@
/********************************* Headers ***********************************/ /********************************* Headers ***********************************/
/*****************************************************************************/ /*****************************************************************************/
#include "swad_language.h"
#include "swad_notification.h" #include "swad_notification.h"
#include "swad_text.h"
#include "swad_user.h" #include "swad_user.h"
/*****************************************************************************/ /*****************************************************************************/
@ -117,7 +117,7 @@ const char *Txt_Confirmation_of_your_email_NO_HTML = // Don't use HTML entities
// The following variables are compilated together in all languages because they are used in emails... // The following variables are compilated together in all languages because they are used in emails...
// ...and each email is sent in the language of the recipient // ...and each email is sent in the language of the recipient
const char *Txt_Course_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here const char *Txt_Course_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here
{ {
"", "",
"Assignatura", "Assignatura",
@ -131,7 +131,7 @@ const char *Txt_Course_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entiti
"Disciplina", "Disciplina",
}; };
const char *Txt_Dear_NO_HTML[Usr_NUM_SEXS][1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &oacute; here const char *Txt_Dear_NO_HTML[Usr_NUM_SEXS][1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &oacute; here
{ {
{ {
// Usr_SEX_UNKNOWN // Usr_SEX_UNKNOWN
@ -187,7 +187,7 @@ const char *Txt_Dear_NO_HTML[Usr_NUM_SEXS][1 + Txt_NUM_LANGUAGES] = // Don't use
} }
}; };
const char *Txt_Forum_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &oacute; here const char *Txt_Forum_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &oacute; here
{ {
"", "",
"Fòrum", "Fòrum",
@ -201,7 +201,7 @@ const char *Txt_Forum_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entitie
"Fórum", "Fórum",
}; };
const char *Txt_General_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &eacute; here const char *Txt_General_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &eacute; here
{ {
"", "",
"General", "General",
@ -215,7 +215,7 @@ const char *Txt_General_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entit
"Geral", "Geral",
}; };
const char *Txt_Go_to_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &agrave; here const char *Txt_Go_to_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &agrave; here
{ {
"", "",
"Anar a", "Anar a",
@ -313,7 +313,7 @@ const char *Txt_If_you_just_request_from_X_the_confirmation_of_your_email_Y_NO_H
" if you have confirmed your email address.\n\n"; // Necessita de tradução " if you have confirmed your email address.\n\n"; // Necessita de tradução
#endif #endif
const char *Txt_If_you_no_longer_wish_to_receive_email_notifications_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here const char *Txt_If_you_no_longer_wish_to_receive_email_notifications_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here
{ {
"", "",
"Si no desitgeu rebre més avisos per correu," "Si no desitgeu rebre més avisos per correu,"
@ -357,7 +357,7 @@ const char *Txt_Institutions_NO_HTML =
"Instituções"; "Instituções";
#endif #endif
const char *Txt_MSG_From_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here const char *Txt_MSG_From_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here
{ {
"", "",
"De", "De",
@ -371,7 +371,7 @@ const char *Txt_MSG_From_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML enti
"De", "De",
}; };
const char *Txt_Notifications_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here const char *Txt_Notifications_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here
{ {
"", "",
"Notificacions", "Notificacions",
@ -385,7 +385,7 @@ const char *Txt_Notifications_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML
"Notificações", "Notificações",
}; };
const char *Txt_New_password_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &ntilde; here. const char *Txt_New_password_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &ntilde; here.
{ {
"", "",
"Nova contrasenya", "Nova contrasenya",
@ -399,7 +399,7 @@ const char *Txt_New_password_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML
"Nova senha", "Nova senha",
}; };
const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &uuml; here. const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &uuml; here.
{ {
{ {
// Ntf_EVENT_UNKNOWN // Ntf_EVENT_UNKNOWN
@ -676,7 +676,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Txt_NU
}, },
}; };
const char *Txt_NOTIFY_EVENTS_There_is_a_new_event_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Warning: it is very important to include %s in the following sentences const char *Txt_NOTIFY_EVENTS_There_is_a_new_event_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Warning: it is very important to include %s in the following sentences
{ // Don't use HTML entities like &uuml; here. { // Don't use HTML entities like &uuml; here.
"", "",
"Hi ha un nou esdeveniment en %s", "Hi ha un nou esdeveniment en %s",
@ -690,7 +690,7 @@ const char *Txt_NOTIFY_EVENTS_There_is_a_new_event_NO_HTML[1 + Txt_NUM_LANGUAGES
"Existe um novo evento em %s", "Existe um novo evento em %s",
}; };
const char *Txt_NOTIFY_EVENTS_There_are_X_new_events_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Warning: it is very important to include %u and %s in the following sentences const char *Txt_NOTIFY_EVENTS_There_are_X_new_events_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Warning: it is very important to include %u and %s in the following sentences
{ // Don't use HTML entities like &uuml; here. { // Don't use HTML entities like &uuml; here.
"", "",
"Hi ha %u nous esdeveniments en %s", "Hi ha %u nous esdeveniments en %s",
@ -704,7 +704,7 @@ const char *Txt_NOTIFY_EVENTS_There_are_X_new_events_NO_HTML[1 + Txt_NUM_LANGUAG
"Há %u novos eventos em %s", "Há %u novos eventos em %s",
}; };
const char *Txt_only_teachers_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &oacute; here const char *Txt_only_teachers_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &oacute; here
{ {
"", "",
", professors", ", professors",
@ -718,7 +718,7 @@ const char *Txt_only_teachers_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML
", professores", ", professores",
}; };
const char *Txt_Please_do_not_reply_to_this_automatically_generated_email_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here const char *Txt_Please_do_not_reply_to_this_automatically_generated_email_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here
{ {
"", "",
"Si us plau, no respongui a aquest correu generat automàticament.", "Si us plau, no respongui a aquest correu generat automàticament.",
@ -732,7 +732,7 @@ const char *Txt_Please_do_not_reply_to_this_automatically_generated_email_NO_HTM
"Por favor, não responda a este email gerado automaticamente.", "Por favor, não responda a este email gerado automaticamente.",
}; };
const char *Txt_TAB_Messages_NO_HTML[1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here const char *Txt_TAB_Messages_NO_HTML[1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here
{ {
"", "",
"Missatges", "Missatges",
@ -1136,7 +1136,7 @@ const char *Txt_UPLOAD_FILE_Upload_time_too_long_maximum_X_minutes_NO_HTML = //
"Tempo de upload muito longo (máximo %lu minutos)."; "Tempo de upload muito longo (máximo %lu minutos).";
#endif #endif
const char *Txt_user_NO_HTML[Usr_NUM_SEXS][1 + Txt_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here const char *Txt_user_NO_HTML[Usr_NUM_SEXS][1 + Lan_NUM_LANGUAGES] = // Don't use HTML entities like &egrave; here
{ {
{ {
// Usr_SEX_UNKNOWN // Usr_SEX_UNKNOWN

View File

@ -35,8 +35,8 @@
#include "swad_database.h" #include "swad_database.h"
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_language.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_text.h"
#include "swad_timetable.h" #include "swad_timetable.h"
/*****************************************************************************/ /*****************************************************************************/

View File

@ -69,12 +69,20 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
const char *Usr_StringsSexIcons[Usr_NUM_SEXS] =
{
"?", // Usr_SEX_UNKNOWN
"&female;", // Usr_SEX_FEMALE
"&male;", // Usr_SEX_MALE
"*", // Usr_SEX_ALL
};
const char *Usr_StringsSexDB[Usr_NUM_SEXS] = const char *Usr_StringsSexDB[Usr_NUM_SEXS] =
{ {
"unknown", "unknown", // Usr_SEX_UNKNOWN
"female", "female", // Usr_SEX_FEMALE
"male", "male", // Usr_SEX_MALE
"all", "all", // Usr_SEX_ALL
}; };
const char *Usr_StringsUsrListTypeInDB[Usr_NUM_USR_LIST_TYPES] = const char *Usr_StringsUsrListTypeInDB[Usr_NUM_USR_LIST_TYPES] =
@ -335,7 +343,7 @@ void Usr_ResetUsrDataExceptUsrCodAndIDs (struct UsrData *UsrDat)
UsrDat->Tch.Office[0] = '\0'; UsrDat->Tch.Office[0] = '\0';
UsrDat->Tch.OfficePhone[0] = '\0'; UsrDat->Tch.OfficePhone[0] = '\0';
UsrDat->Prefs.Language = Txt_LANGUAGE_UNKNOWN; // Language unknown UsrDat->Prefs.Language = Lan_LANGUAGE_UNKNOWN; // Language unknown
UsrDat->Prefs.FirstDayOfWeek = Cal_FIRST_DAY_OF_WEEK_DEFAULT; // Default first day of week UsrDat->Prefs.FirstDayOfWeek = Cal_FIRST_DAY_OF_WEEK_DEFAULT; // Default first day of week
UsrDat->Prefs.DateFormat = Dat_FORMAT_DEFAULT ; // Default date format UsrDat->Prefs.DateFormat = Dat_FORMAT_DEFAULT ; // Default date format
UsrDat->Prefs.Theme = The_THEME_DEFAULT; UsrDat->Prefs.Theme = The_THEME_DEFAULT;
@ -494,13 +502,13 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat)
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS]; extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
extern const char *The_ThemeId[The_NUM_THEMES]; extern const char *The_ThemeId[The_NUM_THEMES];
extern const char *Txt_The_user_does_not_exist; extern const char *Txt_The_user_does_not_exist;
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
unsigned long NumRows; unsigned long NumRows;
The_Theme_t Theme; The_Theme_t Theme;
Ico_IconSet_t IconSet; Ico_IconSet_t IconSet;
Txt_Language_t Lan; Lan_Language_t Lan;
/***** Get user's data from database *****/ /***** Get user's data from database *****/
NumRows = DB_QuerySELECT (&mysql_res,"can not get user's data", NumRows = DB_QuerySELECT (&mysql_res,"can not get user's data",
@ -594,11 +602,11 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat)
} }
/* Get language */ /* Get language */
UsrDat->Prefs.Language = Txt_LANGUAGE_UNKNOWN; // Language unknown UsrDat->Prefs.Language = Lan_LANGUAGE_UNKNOWN; // Language unknown
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
if (!strcasecmp (row[8],Txt_STR_LANG_ID[Lan])) if (!strcasecmp (row[8],Lan_STR_LANG_ID[Lan]))
{ {
UsrDat->Prefs.Language = Lan; UsrDat->Prefs.Language = Lan;
break; break;
@ -2155,7 +2163,7 @@ bool Usr_CheckIfIBelongToCrs (long CrsCod)
unsigned Usr_GetCtysFromUsr (long UsrCod,MYSQL_RES **mysql_res) unsigned Usr_GetCtysFromUsr (long UsrCod,MYSQL_RES **mysql_res)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
/***** Get the institutions a user belongs to from database *****/ /***** Get the institutions a user belongs to from database *****/
return return
@ -2176,7 +2184,7 @@ unsigned Usr_GetCtysFromUsr (long UsrCod,MYSQL_RES **mysql_res)
" AND institutions.CtyCod=countries.CtyCod" " AND institutions.CtyCod=countries.CtyCod"
" GROUP BY countries.CtyCod" " GROUP BY countries.CtyCod"
" ORDER BY countries.Name_%s", " ORDER BY countries.Name_%s",
UsrCod,Txt_STR_LANG_ID[Gbl.Prefs.Language]); UsrCod,Lan_STR_LANG_ID[Gbl.Prefs.Language]);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -2498,17 +2506,17 @@ void Usr_WriteFormLogin (Act_Action_t NextAction,void (*FuncParams) ())
void Usr_WelcomeUsr (void) void Usr_WelcomeUsr (void)
{ {
extern const unsigned Txt_Current_CGI_SWAD_Language; extern const unsigned Lan_Current_CGI_SWAD_Language;
extern const char *Txt_Happy_birthday; extern const char *Txt_Happy_birthday;
extern const char *Txt_Welcome_X_and_happy_birthday[Usr_NUM_SEXS]; extern const char *Txt_Welcome_X_and_happy_birthday[Usr_NUM_SEXS];
extern const char *Txt_Welcome_X[Usr_NUM_SEXS]; extern const char *Txt_Welcome_X[Usr_NUM_SEXS];
extern const char *Txt_Welcome[Usr_NUM_SEXS]; extern const char *Txt_Welcome[Usr_NUM_SEXS];
extern const char *Txt_Switching_to_LANGUAGE[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_Switching_to_LANGUAGE[1 + Lan_NUM_LANGUAGES];
bool CongratulateMyBirthday; bool CongratulateMyBirthday;
if (Gbl.Usrs.Me.Logged) if (Gbl.Usrs.Me.Logged)
{ {
if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Txt_Current_CGI_SWAD_Language) if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Lan_Current_CGI_SWAD_Language)
{ {
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\"" fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\""
" style=\"margin:12px;\">"); " style=\"margin:12px;\">");
@ -2542,6 +2550,7 @@ void Usr_WelcomeUsr (void)
Ale_ShowAlert (Ale_INFO,Txt_Welcome[Gbl.Usrs.Me.UsrDat.Sex]); Ale_ShowAlert (Ale_INFO,Txt_Welcome[Gbl.Usrs.Me.UsrDat.Sex]);
/***** Institutional video *****/ /***** Institutional video *****/
/*
Ale_ShowAlert (Ale_INFO, Ale_ShowAlert (Ale_INFO,
"<a href=\"https://abierta.ugr.es/creative_commons/\" target=\"_blank\">" "<a href=\"https://abierta.ugr.es/creative_commons/\" target=\"_blank\">"
"Curso MOOC LICENCIAS CREATIVE COMMONS Y OER</a><br />" "Curso MOOC LICENCIAS CREATIVE COMMONS Y OER</a><br />"
@ -2557,6 +2566,7 @@ void Usr_WelcomeUsr (void)
" class=\"img-responsive\"" " class=\"img-responsive\""
" alt=\"Responsive image\">" " alt=\"Responsive image\">"
"</video>"); "</video>");
*/
/***** Warning to confirm my email address *****/ /***** Warning to confirm my email address *****/
if (Gbl.Usrs.Me.UsrDat.Email[0] && if (Gbl.Usrs.Me.UsrDat.Email[0] &&
@ -3276,7 +3286,7 @@ static void Usr_SetMyPrefsAndRoles (void)
// In this point I am logged // In this point I am logged
/***** Set my language if unknown *****/ /***** Set my language if unknown *****/
if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Txt_LANGUAGE_UNKNOWN) // I have not chosen language if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Lan_LANGUAGE_UNKNOWN) // I have not chosen language
Lan_UpdateMyLanguageToCurrentLanguage (); // Update my language in database Lan_UpdateMyLanguageToCurrentLanguage (); // Update my language in database
/***** Set preferences from my preferences *****/ /***** Set preferences from my preferences *****/

View File

@ -172,7 +172,7 @@ struct UsrData
} Tch; } Tch;
struct struct
{ {
Txt_Language_t Language; Lan_Language_t Language;
unsigned FirstDayOfWeek; unsigned FirstDayOfWeek;
Dat_Format_t DateFormat; Dat_Format_t DateFormat;
The_Theme_t Theme; The_Theme_t Theme;

View File

@ -3110,10 +3110,10 @@ int swad__getNotifications (struct soap *soap,
static int Svc_GetMyLanguage (void) static int Svc_GetMyLanguage (void)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
Txt_Language_t Lan; Lan_Language_t Lan;
/***** Get user's language *****/ /***** Get user's language *****/
if (DB_QuerySELECT (&mysql_res,"can not get user's language", if (DB_QuerySELECT (&mysql_res,"can not get user's language",
@ -3128,16 +3128,16 @@ static int Svc_GetMyLanguage (void)
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
/* Get language (row[0]) */ /* Get language (row[0]) */
Gbl.Prefs.Language = Txt_LANGUAGE_UNKNOWN; // Language unknown Gbl.Prefs.Language = Lan_LANGUAGE_UNKNOWN; // Language unknown
for (Lan = (Txt_Language_t) 1; for (Lan = (Lan_Language_t) 1;
Lan <= Txt_NUM_LANGUAGES; Lan <= Lan_NUM_LANGUAGES;
Lan++) Lan++)
if (!strcasecmp (row[0],Txt_STR_LANG_ID[Lan])) if (!strcasecmp (row[0],Lan_STR_LANG_ID[Lan]))
{ {
Gbl.Prefs.Language = Lan; Gbl.Prefs.Language = Lan;
break; break;
} }
if (Gbl.Prefs.Language == Txt_LANGUAGE_UNKNOWN) // Language stored in database is unknown if (Gbl.Prefs.Language == Lan_LANGUAGE_UNKNOWN) // Language stored in database is unknown
Gbl.Prefs.Language = Cfg_DEFAULT_LANGUAGE; Gbl.Prefs.Language = Cfg_DEFAULT_LANGUAGE;
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
@ -3790,7 +3790,7 @@ int swad__getTests (struct soap *soap,
static int Svc_GetTstTags (long CrsCod,struct swad__getTestsOutput *getTestsOut) static int Svc_GetTstTags (long CrsCod,struct swad__getTestsOutput *getTestsOut)
{ {
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
unsigned NumRow; unsigned NumRow;