diff --git a/swad_agenda.c b/swad_agenda.c index b07a704f..e202eda9 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -399,7 +399,7 @@ void Agd_ShowUsrAgenda (void) void Agd_ShowOtherAgendaAfterLogIn (void) { extern const char *Hlp_PROFILE_Agenda_public_agenda; - extern const unsigned Lan_Current_CGI_SWAD_Language; + extern const unsigned Txt_Current_CGI_SWAD_Language; extern const char *Txt_Public_agenda_USER; extern const char *Txt_User_not_found_or_you_do_not_have_permission_; extern const char *Txt_Switching_to_LANGUAGE[1 + Lan_NUM_LANGUAGES]; @@ -407,7 +407,7 @@ void Agd_ShowOtherAgendaAfterLogIn (void) if (Gbl.Usrs.Me.Logged) { - if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Lan_Current_CGI_SWAD_Language) + if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Txt_Current_CGI_SWAD_Language) { /***** Get user *****/ /* If nickname is correct, user code is already got from nickname */ diff --git a/swad_changelog.h b/swad_changelog.h index 2d7824dc..b12ca067 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -360,10 +360,12 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.21.2 (2018-12-08)" +#define Log_PLATFORM_VERSION "SWAD 18.21.3 (2018-12-08)" #define CSS_FILE "swad18.4.css" #define JS_FILE "swad17.17.1.js" /* + Version 18.21.4: Dec 08, 2018 Check icons replaced by HTML entities in tests. (? lines) + Version 18.21.3: Dec 08, 2018 Fixed bug when changing language, reported by Agostinho Silva. (237044 lines) Version 18.21.2: Dec 08, 2018 Check icons replaced by HTML entities in listing of users. (237039 lines) Version 18.21.1: Dec 08, 2018 Some messages translated to Portuguese (still 464 messages to be translated). (237046 lines) Version 18.21: Dec 08, 2018 Code refactoring related to languages. (237098 lines) diff --git a/swad_global.c b/swad_global.c index d2dd453e..fbf547cd 100644 --- a/swad_global.c +++ b/swad_global.c @@ -81,7 +81,7 @@ void Gbl_InitializeGlobals (void) { extern const char *The_ThemeId[The_NUM_THEMES]; extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS]; - extern const unsigned Lan_Current_CGI_SWAD_Language; + extern const unsigned Txt_Current_CGI_SWAD_Language; Rol_Role_t Role; Lan_Language_t Lan; @@ -129,7 +129,7 @@ void Gbl_InitializeGlobals (void) Gbl.HiddenParamsInsertedIntoDB = false; - Gbl.Prefs.Language = Lan_Current_CGI_SWAD_Language; + Gbl.Prefs.Language = Txt_Current_CGI_SWAD_Language; 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.Menu = Mnu_MENU_DEFAULT; // Default menu diff --git a/swad_language.c b/swad_language.c index d9bf1de1..b052ce7a 100644 --- a/swad_language.c +++ b/swad_language.c @@ -58,7 +58,6 @@ const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES] = // ISO 639-1 language codes "pl", // Lan_LANGUAGE_PL "pt", // Lan_LANGUAGE_PT }; -const unsigned Lan_Current_CGI_SWAD_Language = ((unsigned) L); /*****************************************************************************/ /****************************** Private constants ****************************/ @@ -216,11 +215,11 @@ void Lan_UpdateMyLanguageToCurrentLanguage (void) Lan_Language_t Lan_GetParamLanguage (void) { - extern const unsigned Lan_Current_CGI_SWAD_Language; + extern const unsigned Txt_Current_CGI_SWAD_Language; return (Lan_Language_t) Par_GetParToUnsignedLong ("Lan", 1, Lan_NUM_LANGUAGES, - (unsigned long) Lan_Current_CGI_SWAD_Language); + (unsigned long) Txt_Current_CGI_SWAD_Language); } diff --git a/swad_language.h b/swad_language.h index d7ad58cc..95ddb4e9 100644 --- a/swad_language.h +++ b/swad_language.h @@ -33,10 +33,6 @@ #define Lan_NUM_LANGUAGES 9 // From 1 to 9. 0 is reserved to unknown language -#ifndef L -#define L 3 // English -#endif - /*****************************************************************************/ /******************************* Public types ********************************/ /*****************************************************************************/ diff --git a/swad_layout.c b/swad_layout.c index fe6636e6..91ab043f 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -109,7 +109,7 @@ static void Lay_HelpTextEditor (const char *Text,const char *InlineMath,const ch void Lay_WriteStartOfPage (void) { extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; - extern const unsigned Lan_Current_CGI_SWAD_Language; + extern const unsigned Txt_Current_CGI_SWAD_Language; extern const char *The_TabOnBgColors[The_NUM_THEMES]; extern const char *Txt_NEW_YEAR_GREETING; const char *LayoutMainZone[Mnu_NUM_MENUS] = @@ -237,7 +237,7 @@ void Lay_WriteStartOfPage (void) /* Redirect to correct language */ if (Gbl.Usrs.Me.Logged && // I am logged - Gbl.Usrs.Me.UsrDat.Prefs.Language != Lan_Current_CGI_SWAD_Language) // My language != current language + Gbl.Usrs.Me.UsrDat.Prefs.Language != Txt_Current_CGI_SWAD_Language) // My language != current language { if (Gbl.Action.Act == ActLogIn || // Regular log in Gbl.Action.Act == ActLogInNew) // Log in when checking account diff --git a/swad_text.c b/swad_text.c index 026ed171..6d4993c2 100644 --- a/swad_text.c +++ b/swad_text.c @@ -94,6 +94,12 @@ /******************************** Constants **********************************/ /*****************************************************************************/ +#ifndef L +#define L 3 // English +#endif + +const unsigned Txt_Current_CGI_SWAD_Language = ((unsigned) L); + const char *Txt_NEW_LINE = "\r\n"; // End of line in a file. If we put only \n the file does not look good in some Windows text editors // The HTML entity for "ß" is ß It stands for "S-Z ligature", because this symbol comes from the ligature of a Gothic S and a Z. diff --git a/swad_text_no_html.c b/swad_text_no_html.c index df2ebdcd..ce27a2c9 100644 --- a/swad_text_no_html.c +++ b/swad_text_no_html.c @@ -72,6 +72,10 @@ /******************************** Constants **********************************/ /*****************************************************************************/ +#ifndef L +#define L 3 // English +#endif + const char *Txt_Country_NO_HTML = #if L==1 "País"; diff --git a/swad_user.c b/swad_user.c index 5cac012b..b57be28d 100644 --- a/swad_user.c +++ b/swad_user.c @@ -2506,7 +2506,7 @@ void Usr_WriteFormLogin (Act_Action_t NextAction,void (*FuncParams) ()) void Usr_WelcomeUsr (void) { - extern const unsigned Lan_Current_CGI_SWAD_Language; + extern const unsigned Txt_Current_CGI_SWAD_Language; extern const char *Txt_Happy_birthday; extern const char *Txt_Welcome_X_and_happy_birthday[Usr_NUM_SEXS]; extern const char *Txt_Welcome_X[Usr_NUM_SEXS]; @@ -2516,7 +2516,7 @@ void Usr_WelcomeUsr (void) if (Gbl.Usrs.Me.Logged) { - if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Lan_Current_CGI_SWAD_Language) + if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Txt_Current_CGI_SWAD_Language) { fprintf (Gbl.F.Out,"
");