From 94ca629ceec7b0dc9f6f724b2e15923d3ec1d5b3 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Fri, 5 Aug 2005 03:06:50 +0000 Subject: Language AutoDetection Improvements - Fix: Loading/Saving range options. - Fix: Language AutoDetection. Using locale language instead of selected one. - Support for range options in GTK UI. - Option to control recoding timeout is provided. - LibRCC.h is updated (Translate, Spell, IConv). - Documentation is updated. - Add 'rcc-config' alias to 'rcc-gtk2-config' in spec. - Implemented concept of parrent languages + The concept is used in language autodetection. The string in considered language is permited to have words from all it's parrent languages. + English is assumed to be parrent for all other languages by default. + Russian is parrent language for Ukrainian and Belorussian. - No translation to english if translation between related (one of the languages is parrent for another one) languages is failed. --- examples/input-russian.txt | 1 + examples/rcc-example.xml | 23 ++++++++++++++++++----- examples/rcc-gtk-config.c | 16 +++++++++++++--- 3 files changed, 32 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/input-russian.txt b/examples/input-russian.txt index b89c105..aa60118 100644 --- a/examples/input-russian.txt +++ b/examples/input-russian.txt @@ -4,3 +4,4 @@ привет Good Morning Guten Abend +Çäîðîâåíüê³ Áóëè diff --git a/examples/rcc-example.xml b/examples/rcc-example.xml index 5bf50b6..6bad1f3 100644 --- a/examples/rcc-example.xml +++ b/examples/rcc-example.xml @@ -22,14 +22,27 @@ MACCYRILLIC - - Japanese + + Ukrainian + + russian + UTF-8 - ISO-2022-JP - EUC-JP - SHIFT-JIS + KOI8-U + CP1251 + IBM865 + ISO8859-5 + MACCYRILLIC + CP1125 + + ru_UA + + + en + ru + diff --git a/examples/rcc-gtk-config.c b/examples/rcc-gtk-config.c index 7758f09..b055597 100644 --- a/examples/rcc-gtk-config.c +++ b/examples/rcc-gtk-config.c @@ -1,3 +1,5 @@ +#include +#include #include #include @@ -17,7 +19,7 @@ static rcc_class classes[] = { { NULL } }; -static char *config; +static char *config = NULL; static rcc_context ctx; static rcc_ui_context uictx; @@ -30,13 +32,20 @@ static void apply_cb(GtkWidget * w, gpointer data) int main (int argc, char *argv[]) { + unsigned int i; + unsigned char all_mode = 0; GtkWidget *window1; GtkWidget *save, *close, *hbox; GtkWidget *box; - if (argc<1) config = argv[0]; - else config = argv[1]; + for (i=1;i ]\n"); gtk_set_locale (); gtk_init (&argc, &argv); @@ -46,6 +55,7 @@ int main (int argc, char *argv[]) ctx = rccCreateContext(NULL, 0, 0, classes, 0); rccLoad(ctx, config); uictx = rccUiCreateContext(ctx); + if (all_mode) rccUiUnHideOption(uictx, RCC_OPTION_ALL); window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_policy(GTK_WINDOW (window1), FALSE, FALSE, TRUE); -- cgit v1.2.3