summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-08-05 03:06:50 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-08-05 03:06:50 +0000
commit94ca629ceec7b0dc9f6f724b2e15923d3ec1d5b3 (patch)
tree317019f306f7195c07d3c0d943c829ed11ba8cca /examples
parent50aa5cd62ef4a66da41d68f4a50ddfca97863c38 (diff)
downloadlibrcc-94ca629ceec7b0dc9f6f724b2e15923d3ec1d5b3.tar.gz
librcc-94ca629ceec7b0dc9f6f724b2e15923d3ec1d5b3.tar.bz2
librcc-94ca629ceec7b0dc9f6f724b2e15923d3ec1d5b3.tar.xz
librcc-94ca629ceec7b0dc9f6f724b2e15923d3ec1d5b3.zip
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.
Diffstat (limited to 'examples')
-rw-r--r--examples/input-russian.txt1
-rw-r--r--examples/rcc-example.xml23
-rw-r--r--examples/rcc-gtk-config.c16
3 files changed, 32 insertions, 8 deletions
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 @@
<Charset>MACCYRILLIC</Charset>
</Charsets>
</Language>
- <Language name="ja">
- <FullName>Japanese</FullName>
+ <Language name="uk">
+ <FullName>Ukrainian</FullName>
+ <Engines>
+ <Engine>russian</Engine>
+ </Engines>
<Charsets>
<Charset>UTF-8</Charset>
- <Charset>ISO-2022-JP</Charset>
- <Charset>EUC-JP</Charset>
- <Charset>SHIFT-JIS</Charset>
+ <Charset>KOI8-U</Charset>
+ <Charset>CP1251</Charset>
+ <Charset>IBM865</Charset>
+ <Charset>ISO8859-5</Charset>
+ <Charset>MACCYRILLIC</Charset>
+ <Charset>CP1125</Charset>
</Charsets>
+ <Aliases>
+ <Alias>ru_UA</Alias>
+ </Aliases>
+ <Relations>
+ <Parrent>en</Parrent>
+ <Parrent>ru</Parrent>
+ </Relations>
</Language>
</Languages>
<Options>
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 <stdio.h>
+#include <string.h>
#include <gtk/gtk.h>
#include <librcc.h>
@@ -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<argc;i++) {
+ if (!strcmp(argv[i],"--all")) all_mode = 1;
+ else if (!strcmp(argv[i], "--")) break;
+ else if ((!config)&&(strncmp(argv[i],"-",1))) config = argv[i];
+ }
+ if (i==1)
+ printf("Usage: rcc-config [ --all ] [ <config name> ]\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);