diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-29 03:26:28 +0000 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-29 03:26:28 +0000 |
commit | e3f702e83a26468ee44f3f342a7a40a252f4603c (patch) | |
tree | 5ff76e9d11a9fdbdb493683d0f0840f46c67b6f8 /ui | |
parent | cfaef1b6c9f33fbaa114628cf513d129bdff3c1c (diff) | |
download | librcc-e3f702e83a26468ee44f3f342a7a40a252f4603c.tar.gz librcc-e3f702e83a26468ee44f3f342a7a40a252f4603c.tar.bz2 librcc-e3f702e83a26468ee44f3f342a7a40a252f4603c.tar.xz librcc-e3f702e83a26468ee44f3f342a7a40a252f4603c.zip |
Translation
- Language Translation using libtranslate is implemented
- Autoengine sets current charset (option)
Diffstat (limited to 'ui')
-rw-r--r-- | ui/librccui.c | 28 | ||||
-rw-r--r-- | ui/rccnames.c | 3 |
2 files changed, 19 insertions, 12 deletions
diff --git a/ui/librccui.c b/ui/librccui.c index f072c6e..c4ac1c0 100644 --- a/ui/librccui.c +++ b/ui/librccui.c @@ -112,11 +112,12 @@ static xmlNodePtr rccUiNodeFind(xmlXPathContextPtr xpathctx, const char *request fullname = rccUiXmlGetText(node); \ if (fullname) { \ if (icnv) { \ - newsize = rccIConvRecode(icnv, tmpbuf, RCC_UI_MAX_STRING_CHARS, fullname, 0); \ - if (newsize != (size_t)-1) { \ + tmpbuf = rccIConv(icnv, fullname, 0, NULL); \ + if (tmpbuf) { \ cnode = xmlNewChild(node->parent, NULL, "Recoded", tmpbuf); \ fullname = rccUiXmlGetText(cnode); \ if (!fullname) fullname = rccUiXmlGetText(node); \ + free(tmpbuf); \ } \ } \ var = fullname; \ @@ -154,11 +155,12 @@ static xmlNodePtr rccUiNodeFind(xmlXPathContextPtr xpathctx, const char *request fullname = rccUiXmlGetText(node); \ if (fullname) { \ if (icnv) { \ - newsize = rccIConvRecode(icnv, tmpbuf, RCC_UI_MAX_STRING_CHARS, fullname, 0); \ - if (newsize != (size_t)-1) { \ + tmpbuf = rccIConv(icnv, fullname, 0, NULL); \ + if (tmpbuf) { \ cnode = xmlNewChild(node->parent, NULL, "Recoded", tmpbuf); \ fullname = rccUiXmlGetText(cnode); \ if (!fullname) fullname = rccUiXmlGetText(node); \ + free(tmpbuf); \ } \ } \ \ @@ -197,8 +199,7 @@ int rccUiInit() { unsigned int npos; - size_t newsize; - char tmpbuf[RCC_UI_MAX_STRING_CHARS+1]; + char *tmpbuf; char ctype_charset[32]; char locale[32]; rcc_iconv icnv; @@ -271,11 +272,12 @@ int rccUiInit() { if (!fullname) continue; if (icnv) { - newsize = rccIConvRecode(icnv, tmpbuf, RCC_UI_MAX_STRING_CHARS, fullname, 0); - if (newsize != (size_t)-1) { + tmpbuf = rccIConv(icnv, fullname, 0, NULL); + if (tmpbuf) { cnode = xmlNewChild(node->parent, NULL, "Recoded", tmpbuf); fullname = rccUiXmlGetText(cnode); if (!fullname) fullname = rccUiXmlGetText(node); + free(tmpbuf); } } @@ -319,11 +321,12 @@ int rccUiInit() { fullname = rccUiXmlGetText(node); if (fullname) { if (icnv) { - newsize = rccIConvRecode(icnv, tmpbuf, RCC_UI_MAX_STRING_CHARS, fullname, 0); - if (newsize != (size_t)-1) { + tmpbuf = rccIConv(icnv, fullname, 0, NULL); + if (tmpbuf) { cnode = xmlNewChild(node->parent, NULL, "Recoded", tmpbuf); fullname = rccUiXmlGetText(cnode); if (!fullname) fullname = rccUiXmlGetText(node); + free(tmpbuf); } } option_name->name = fullname; @@ -346,11 +349,12 @@ int rccUiInit() { fullname = rccUiXmlGetText(node); if (fullname) { if (icnv) { - newsize = rccIConvRecode(icnv, tmpbuf, RCC_UI_MAX_STRING_CHARS, fullname, 0); - if (newsize != (size_t)-1) { + tmpbuf = rccIConv(icnv, fullname, 0, NULL); + if (tmpbuf) { cnode = xmlNewChild(node->parent, NULL, "Recoded", tmpbuf); fullname = rccUiXmlGetText(cnode); if (!fullname) fullname = rccUiXmlGetText(node); + free(tmpbuf); } } option_name->value_names[k] = fullname; diff --git a/ui/rccnames.c b/ui/rccnames.c index 1e79e5b..b6d08dd 100644 --- a/ui/rccnames.c +++ b/ui/rccnames.c @@ -11,6 +11,7 @@ rcc_name rcc_default_language_names[RCC_MAX_LANGUAGES+1]; rcc_name rcc_default_language_names_embeded[RCC_MAX_LANGUAGES+1] = { {"default", "Autodetect"}, {"off", "Dissable"}, +{"en", "English" }, {"ru","Russian"}, {"uk","Ukrainian"}, {"be","Belarussian"}, @@ -38,6 +39,8 @@ rcc_option_name rcc_default_option_names_embeded[RCC_MAX_OPTIONS+1] = { { RCC_OPTION_AUTODETECT_FS_NAMES, "Autodetect File Names", rcc_default_option_boolean_names }, { RCC_OPTION_AUTODETECT_FS_TITLES, "Autodetect FS Titles", rcc_default_option_boolean_names }, { RCC_OPTION_CONFIGURED_LANGUAGES_ONLY, "Enabled Languages", rcc_default_option_clo_names }, + { RCC_OPTION_TRANSLATE, "Translate Text", rcc_default_option_boolean_names }, + { RCC_OPTION_AUTOENGINE_SET_CURRENT, "AutoEngine Set Current Encoding", rcc_default_option_boolean_names }, { RCC_MAX_OPTIONS } }; |