mirror of https://github.com/nirenjan/libx52.git
Make daemon use libx52 stringification functions
parent
018852a012
commit
d003e7f7c4
|
@ -31,7 +31,8 @@ void x52d_cfg_set_Clock_Enabled(bool enabled)
|
|||
|
||||
void x52d_cfg_set_Clock_PrimaryIsLocal(bool param)
|
||||
{
|
||||
PINELOG_DEBUG(_("Setting primary clock timezone to %s"),
|
||||
PINELOG_DEBUG(_("Setting %s clock timezone to %s"),
|
||||
libx52_str_clock_id(LIBX52_CLOCK_1),
|
||||
param ? _("local") : _("UTC"));
|
||||
clock_primary_is_local = !!param;
|
||||
}
|
||||
|
@ -106,48 +107,48 @@ cleanup:
|
|||
return offset;
|
||||
}
|
||||
|
||||
static void set_clock_offset(libx52_clock_id id, const char *param)
|
||||
{
|
||||
PINELOG_DEBUG(_("Setting %s clock timezone to %s"),
|
||||
libx52_str_clock_id(id), param);
|
||||
x52d_dev_set_clock_timezone(id, get_tz_offset(param));
|
||||
}
|
||||
|
||||
void x52d_cfg_set_Clock_Secondary(char* param)
|
||||
{
|
||||
PINELOG_DEBUG(("Setting secondary clock timezone to %s"), param);
|
||||
x52d_dev_set_clock_timezone(LIBX52_CLOCK_2, get_tz_offset(param));
|
||||
set_clock_offset(LIBX52_CLOCK_2, param);
|
||||
}
|
||||
|
||||
void x52d_cfg_set_Clock_Tertiary(char* param)
|
||||
{
|
||||
PINELOG_DEBUG(_("Setting tertiary clock timezone to %s"), param);
|
||||
x52d_dev_set_clock_timezone(LIBX52_CLOCK_3, get_tz_offset(param));
|
||||
set_clock_offset(LIBX52_CLOCK_3, param);
|
||||
}
|
||||
|
||||
static void set_clock_format(const char *name, libx52_clock_id id, libx52_clock_format fmt)
|
||||
static void set_clock_format(libx52_clock_id id, libx52_clock_format fmt)
|
||||
{
|
||||
PINELOG_DEBUG(_("Setting %s clock format to %s"), name,
|
||||
fmt == LIBX52_CLOCK_FORMAT_12HR ? _("12 hour") : _("24 hour"));
|
||||
PINELOG_DEBUG(_("Setting %s clock format to %s"),
|
||||
libx52_str_clock_id(id), libx52_str_clock_format(fmt));
|
||||
x52d_dev_set_clock_format(id, fmt);
|
||||
}
|
||||
|
||||
void x52d_cfg_set_Clock_FormatPrimary(libx52_clock_format fmt)
|
||||
{
|
||||
set_clock_format("primary", LIBX52_CLOCK_1, fmt);
|
||||
set_clock_format(LIBX52_CLOCK_1, fmt);
|
||||
}
|
||||
|
||||
void x52d_cfg_set_Clock_FormatSecondary(libx52_clock_format fmt)
|
||||
{
|
||||
set_clock_format("secondary", LIBX52_CLOCK_2, fmt);
|
||||
set_clock_format(LIBX52_CLOCK_2, fmt);
|
||||
}
|
||||
|
||||
void x52d_cfg_set_Clock_FormatTertiary(libx52_clock_format fmt)
|
||||
{
|
||||
set_clock_format("tertiary", LIBX52_CLOCK_3, fmt);
|
||||
set_clock_format(LIBX52_CLOCK_3, fmt);
|
||||
}
|
||||
|
||||
void x52d_cfg_set_Clock_DateFormat(libx52_date_format fmt)
|
||||
{
|
||||
static const char *formats[] = {
|
||||
"dd-mm-yy",
|
||||
"mm-dd-yy",
|
||||
"yy-mm-dd"
|
||||
};
|
||||
PINELOG_DEBUG(_("Setting date format to %s"), formats[fmt]);
|
||||
PINELOG_DEBUG(_("Setting date format to %s"), libx52_str_date_format(fmt));
|
||||
x52d_dev_set_date_format(fmt);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#define X52D_SYS_CFG_FILE SYSCONFDIR "/" X52D_APP_NAME "/" X52D_APP_NAME ".conf"
|
||||
|
||||
#include "gettext.h"
|
||||
#define N_(x) gettext_noop(x)
|
||||
#define _(x) gettext(x)
|
||||
|
||||
#endif // !defined X52D_CONST_H
|
||||
|
|
|
@ -18,12 +18,10 @@
|
|||
#include "x52d_const.h"
|
||||
#include "x52d_device.h"
|
||||
|
||||
static const char *TRACE_led_states[] = {
|
||||
"off", "on", "red", "amber", "green"
|
||||
};
|
||||
|
||||
#define SET_LED_STATE(led, state) \
|
||||
PINELOG_TRACE("Setting LED " #led " state to %s", TRACE_led_states[state]); \
|
||||
PINELOG_TRACE("Setting LED %s state to %s", \
|
||||
libx52_str_led_id(LIBX52_LED_ ## led), \
|
||||
libx52_str_led_state(state)); \
|
||||
x52d_dev_set_led_state(LIBX52_LED_ ## led, state);
|
||||
|
||||
void x52d_cfg_set_LED_Fire(libx52_led_state state)
|
||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: x52pro-linux 0.2.1\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/nirenjan/x52pro-linux/issues\n"
|
||||
"POT-Creation-Date: 2021-07-27 01:56-0700\n"
|
||||
"POT-Creation-Date: 2021-07-27 02:07-0700\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
@ -112,11 +112,11 @@ msgstr ""
|
|||
msgid "Unknown clock format %d"
|
||||
msgstr ""
|
||||
|
||||
#: lib/libx52/x52_stringify.c:36 daemon/x52d_clock.c:124
|
||||
#: lib/libx52/x52_stringify.c:36
|
||||
msgid "12 hour"
|
||||
msgstr ""
|
||||
|
||||
#: lib/libx52/x52_stringify.c:37 daemon/x52d_clock.c:124
|
||||
#: lib/libx52/x52_stringify.c:37
|
||||
msgid "24 hour"
|
||||
msgstr ""
|
||||
|
||||
|
@ -557,57 +557,52 @@ msgstr ""
|
|||
msgid "Setting clock enable to %s"
|
||||
msgstr ""
|
||||
|
||||
#: daemon/x52d_clock.c:34
|
||||
#: daemon/x52d_clock.c:34 daemon/x52d_clock.c:112
|
||||
#, c-format
|
||||
msgid "Setting primary clock timezone to %s"
|
||||
msgid "Setting %s clock timezone to %s"
|
||||
msgstr ""
|
||||
|
||||
#: daemon/x52d_clock.c:35
|
||||
#: daemon/x52d_clock.c:36
|
||||
msgid "local"
|
||||
msgstr ""
|
||||
|
||||
#: daemon/x52d_clock.c:35
|
||||
#: daemon/x52d_clock.c:36
|
||||
msgid "UTC"
|
||||
msgstr ""
|
||||
|
||||
#: daemon/x52d_clock.c:52
|
||||
#: daemon/x52d_clock.c:53
|
||||
msgid "Unable to allocate memory for timezone. Falling back to UTC"
|
||||
msgstr ""
|
||||
|
||||
#: daemon/x52d_clock.c:62
|
||||
#: daemon/x52d_clock.c:63
|
||||
msgid "Unable to backup timezone environment. Falling back to UTC"
|
||||
msgstr ""
|
||||
|
||||
#: daemon/x52d_clock.c:117
|
||||
#, c-format
|
||||
msgid "Setting tertiary clock timezone to %s"
|
||||
msgstr ""
|
||||
|
||||
#: daemon/x52d_clock.c:123
|
||||
#: daemon/x52d_clock.c:129
|
||||
#, c-format
|
||||
msgid "Setting %s clock format to %s"
|
||||
msgstr ""
|
||||
|
||||
#: daemon/x52d_clock.c:150
|
||||
#: daemon/x52d_clock.c:151
|
||||
#, c-format
|
||||
msgid "Setting date format to %s"
|
||||
msgstr ""
|
||||
|
||||
#: daemon/x52d_clock.c:160
|
||||
#: daemon/x52d_clock.c:161
|
||||
msgid "Starting X52 clock manager thread"
|
||||
msgstr ""
|
||||
|
||||
#: daemon/x52d_clock.c:171
|
||||
#: daemon/x52d_clock.c:172
|
||||
#, c-format
|
||||
msgid "Error %d retrieving current time: %s"
|
||||
msgstr ""
|
||||
|
||||
#: daemon/x52d_clock.c:192
|
||||
#: daemon/x52d_clock.c:193
|
||||
#, c-format
|
||||
msgid "Error %d initializing clock thread: %s"
|
||||
msgstr ""
|
||||
|
||||
#: daemon/x52d_clock.c:199
|
||||
#: daemon/x52d_clock.c:200
|
||||
msgid "Shutting down X52 clock manager thread"
|
||||
msgstr ""
|
||||
|
||||
|
|
39
po/xx_PL.po
39
po/xx_PL.po
|
@ -7,8 +7,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: x52pro-linux 0.2.1\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/nirenjan/x52pro-linux/issues\n"
|
||||
"POT-Creation-Date: 2021-07-27 01:56-0700\n"
|
||||
"PO-Revision-Date: 2021-07-27 01:59-0700\n"
|
||||
"POT-Creation-Date: 2021-07-27 02:07-0700\n"
|
||||
"PO-Revision-Date: 2021-07-27 02:08-0700\n"
|
||||
"Last-Translator: Nirenjan Krishnan <nirenjan@gmail.com>\n"
|
||||
"Language-Team: Dummy Language for testing i18n\n"
|
||||
"Language: xx_PL\n"
|
||||
|
@ -112,11 +112,11 @@ msgstr "ertiarytay"
|
|||
msgid "Unknown clock format %d"
|
||||
msgstr "Unknownay ockclay ormatfay %d"
|
||||
|
||||
#: lib/libx52/x52_stringify.c:36 daemon/x52d_clock.c:124
|
||||
#: lib/libx52/x52_stringify.c:36
|
||||
msgid "12 hour"
|
||||
msgstr "12 ourhay"
|
||||
|
||||
#: lib/libx52/x52_stringify.c:37 daemon/x52d_clock.c:124
|
||||
#: lib/libx52/x52_stringify.c:37
|
||||
msgid "24 hour"
|
||||
msgstr "24 ourhay"
|
||||
|
||||
|
@ -602,60 +602,55 @@ msgstr "Uttingshay ownday X52 aemonday"
|
|||
msgid "Setting clock enable to %s"
|
||||
msgstr "Ettingsay ockclay enableay otay %s"
|
||||
|
||||
#: daemon/x52d_clock.c:34
|
||||
#: daemon/x52d_clock.c:34 daemon/x52d_clock.c:112
|
||||
#, c-format
|
||||
msgid "Setting primary clock timezone to %s"
|
||||
msgstr "Ettingsay imarypray ockclay imezonetay otay %s"
|
||||
msgid "Setting %s clock timezone to %s"
|
||||
msgstr "Ettingsay %s ockclay imezonetay otay %s"
|
||||
|
||||
#: daemon/x52d_clock.c:35
|
||||
#: daemon/x52d_clock.c:36
|
||||
msgid "local"
|
||||
msgstr "ocallay"
|
||||
|
||||
#: daemon/x52d_clock.c:35
|
||||
#: daemon/x52d_clock.c:36
|
||||
msgid "UTC"
|
||||
msgstr "UTCay"
|
||||
|
||||
#: daemon/x52d_clock.c:52
|
||||
#: daemon/x52d_clock.c:53
|
||||
msgid "Unable to allocate memory for timezone. Falling back to UTC"
|
||||
msgstr ""
|
||||
"Unableay otay allocateay emorymay orfay imezonetay. Allingfay ackbay otay "
|
||||
"UTCay"
|
||||
|
||||
#: daemon/x52d_clock.c:62
|
||||
#: daemon/x52d_clock.c:63
|
||||
msgid "Unable to backup timezone environment. Falling back to UTC"
|
||||
msgstr ""
|
||||
"Unableay otay ackupbay imezonetay environmentay. Allingfay ackbay otay UTCay"
|
||||
|
||||
#: daemon/x52d_clock.c:117
|
||||
#, c-format
|
||||
msgid "Setting tertiary clock timezone to %s"
|
||||
msgstr "Ettingsay ertiarytay ockclay imezonetay otay %s"
|
||||
|
||||
#: daemon/x52d_clock.c:123
|
||||
#: daemon/x52d_clock.c:129
|
||||
#, c-format
|
||||
msgid "Setting %s clock format to %s"
|
||||
msgstr "Ettingsay %s ockclay ormatfay otay %s"
|
||||
|
||||
#: daemon/x52d_clock.c:150
|
||||
#: daemon/x52d_clock.c:151
|
||||
#, c-format
|
||||
msgid "Setting date format to %s"
|
||||
msgstr "Ettingsay ateday ormatfay otay %s"
|
||||
|
||||
#: daemon/x52d_clock.c:160
|
||||
#: daemon/x52d_clock.c:161
|
||||
msgid "Starting X52 clock manager thread"
|
||||
msgstr "Artingstay X52 ockclay anagermay eadthray"
|
||||
|
||||
#: daemon/x52d_clock.c:171
|
||||
#: daemon/x52d_clock.c:172
|
||||
#, c-format
|
||||
msgid "Error %d retrieving current time: %s"
|
||||
msgstr "Erroray %d etrievingray urrentcay imetay: %s"
|
||||
|
||||
#: daemon/x52d_clock.c:192
|
||||
#: daemon/x52d_clock.c:193
|
||||
#, c-format
|
||||
msgid "Error %d initializing clock thread: %s"
|
||||
msgstr "Erroray %d initializingay ockclay eadthray: %s"
|
||||
|
||||
#: daemon/x52d_clock.c:199
|
||||
#: daemon/x52d_clock.c:200
|
||||
msgid "Shutting down X52 clock manager thread"
|
||||
msgstr "Uttingshay ownday X52 ockclay anagermay eadthray"
|
||||
|
||||
|
|
Loading…
Reference in New Issue