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/librccui.c | |
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/librccui.c')
-rw-r--r-- | ui/librccui.c | 28 |
1 files changed, 16 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; |