Define default template date format strings globally and make them translatable

This commit is contained in:
Christian Dywan 2013-03-17 10:37:27 +01:00 committed by Enrico Tröger
parent 7150c63f22
commit a982908bec
2 changed files with 6 additions and 3 deletions

View File

@ -878,9 +878,9 @@ static void load_dialog_prefs(GKeyFile *config)
template_prefs.mail = utils_get_setting_string(config, PACKAGE, "pref_template_mail", tmp_string);
g_free(tmp_string);
g_free(tmp_string2);
template_prefs.year_format = utils_get_setting_string(config, PACKAGE, "pref_template_year", "%Y");
template_prefs.date_format = utils_get_setting_string(config, PACKAGE, "pref_template_date", "%Y-%m-%d");
template_prefs.datetime_format = utils_get_setting_string(config, PACKAGE, "pref_template_datetime", "%d.%m.%Y %H:%M:%S %Z");
template_prefs.year_format = utils_get_setting_string(config, PACKAGE, "pref_template_year", GEANY_TEMPLATES_FORMAT_YEAR);
template_prefs.date_format = utils_get_setting_string(config, PACKAGE, "pref_template_date", GEANY_TEMPLATES_FORMAT_DATE);
template_prefs.datetime_format = utils_get_setting_string(config, PACKAGE, "pref_template_datetime", GEANY_TEMPLATES_FORMAT_DATETIME);
/* tools */
cmd = utils_get_setting_string(config, "tools", "terminal_cmd", "");

View File

@ -31,6 +31,9 @@
G_BEGIN_DECLS
#define GEANY_TEMPLATES_INDENT 3
#define GEANY_TEMPLATES_FORMAT_YEAR C_("DefaultYear", "%Y")
#define GEANY_TEMPLATES_FORMAT_DATE C_("DefaultDate", "%Y-%m-%d")
#define GEANY_TEMPLATES_FORMAT_DATETIME C_("DefaultDateTime", "%d.%m.%Y %H:%M:%S %Z")
enum
{