From
Dmitry A. Kazakov@21:1/5 to
All on Sun Jan 30 14:59:22 2022
On 2022-01-30 14:20, ldries46 wrote:
I like the way Glade can be used for designing a gtk GUI. But There is a problem I cannot do what I like to do. The best way to illustrate that
is when I want to design a multi language program. I than need the
string variables in some kind of array. For instance Language_Open(lan) instead of Language_Open where:
Language_Open(English) := To_Unbounded_String("Open");
Language_Open(Deutsch) := To_Unbounded_String("Offnen");
etc,
where lan := (English, Deutsch, ...);
This can be reached if Glade can also produce an Ada program output
where you can edit output simply or when a program Glade2Ada would be
created which translates the Glade Output to Ada, where you can edit the
Ada program accordingly.
The latest version can also be transfered to other language, so Glade2C, Glade2python etc.
The question is is something like that available or is it an idea to
create such a thing for the people who created Glad
[ Necessary litany: never ever use Glade ]
Regarding localization I am using widget style properties for the purpose:
1. All application widgets are derived, usually from grid or dialog etc.
2. All widgets define a new class:
Initialize_Class_Record
3. All texts (and other parameters) of a widget are style properties
from the class:
Install_Style_Property
( Class_Ref (... the widget's type ...),
Gnew_String
( Name => "hello-label",
Nick => "hello",
Blurb => "The label 'hello'",
Default => "Hello"
) );
4. Provide Style_Updated to handle style-updated:
procedure Style_Updated
( Widget : access My_Custom_Widget
) is
begin
Widget.Hello_Label.Set_Text
( Style_Get (Widget, "hello-label")
);
...
From there you set all texts of the widget and all other properties.
E.g. the label text is set from the value of the "hello-label".
5. Connect to Style_Updated
Connect
( Widget,
"style-updated",
To_Marshaller (Style_Updated'Access)
);
6. Call to Style_Updated at the end of Initialize (called from Gtk_New)
7. Upon application start load a CSS file from some predefined location,
e.g. from user directory:
Load_CSS_File
This is basically all. If you want to change a text, e.g. from English
to German, you simply edit the CSS file.
MyCustomWidget {
-MyCustomWidget-hello-label: "Hallo";
You can reload CSS any time, the widgets will get the "style-updated"
event and Style_Updated will change the texts.
No texts in the application code, except for the English default
fallback, of course.
BTW, in GTK it is possible to walk down the widget tree and generate a
CSS template with all style properties of. I add this to command-line arguments. So adding a new language you will not miss a text (a poor
man's safety you would get in Ada for free if an enumeration type were
used for the texts).
The GTK CSS overview is here:
https://docs.gtk.org/gtk3/css-overview.html
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
From
ldries46@21:1/5 to
All on Mon Jan 31 11:47:52 2022
This is a multi-part message in MIME format.
At this moment I am using the following three packages: /-------------------------------------------------------------------------------------------------------------------------------//
//pragma License(Unrestricted);//
//with Glib;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â use Glib;//
//with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;//
//
//package Sudoku_Languages is//
//
//Â Â type Language is (GB_USA, NL_B, F_B, D, ES);//
//
//Â Â Â Â Â Lan_IDÂ Â Â Â Â Â Â Â : Gint := 0;//
// //-----------------------------------------------------------------------------//
//-- --//
//  -- If not all languages are wanted nr_languages must be altered and in    --//
//  -- CH_Lanuages CH_Languages the not wanted languages must be deleted      --//
//-- --// //-----------------------------------------------------------------------------//
//  nr_languages    : constant integer := 5;//
//
//Â Â type ar_lan is array (0 .. nr_languages - 1) of Language;//
//
//  Lan             : Language := GB_USA;//
//  CH_Languages    : constant ar_lan := (GB_USA, NL_B, F_B, D, ES);// //
//Â Â -- Languages Names//
//  Language_Names  : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("English"), To_Unbounded_String("Nederlands"),//
//Â Â Â Â Â To_Unbounded_String("Francais"), To_Unbounded_String("Deutsch"),// //Â Â Â Â Â To_Unbounded_String("Espagnol"));//
//Â Â -- Titles//
//Â Â Lan_Window_Title : constant array(GB_USA .. ES) of Unbounded_String
:=//
//Â Â Â Â (To_Unbounded_String("Sudoku Program"),//
//Â Â Â Â Â To_Unbounded_String("Sudoku Programma"),//
//Â Â Â Â Â To_Unbounded_String("Programme Sudoku"), To_Unbounded_String("Sudoku-Programm"),//
//Â Â Â Â Â To_Unbounded_String("Programa de Sudoku"));//
//Â Â Lan_Dialog_Title : constant array(GB_USA .. ES) of Unbounded_String
:=//
//Â Â Â Â (To_Unbounded_String("Grid Dialog"),//
//Â Â Â Â Â To_Unbounded_String("Grid Dialoog"),//
//     To_Unbounded_String("Boîte de dialogue Grille"), To_Unbounded_String("Rasterdialog"),//
//     To_Unbounded_String("Diálogo de cuadrÃcula"));//
//
//Â Â -- Menu//
//  Lan_File          : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("_File"), To_Unbounded_String("_Bestanden"),// //Â Â Â Â Â To_Unbounded_String("Fichier"), To_Unbounded_String("Datei"),// //Â Â Â Â Â To_Unbounded_String("Archivo"));//
//  Lan_Edit          : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("_Edit"), To_Unbounded_String("Be_werken"),// //Â Â Â Â Â To_Unbounded_String("Modifier"), To_Unbounded_String("Bearbeiten"),//
//Â Â Â Â Â To_Unbounded_String("Editar"));//
//|//
//| etc.//
//|//
//  Lan_Help          : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("_Help"), To_Unbounded_String("Hulp"),// //Â Â Â Â Â To_Unbounded_String("Aide"), To_Unbounded_String("Hilfe"),// //Â Â Â Â Â To_Unbounded_String("Ayuda"));//
//  Lan_New           : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("New"), To_Unbounded_String("Nieuw"),// //Â Â Â Â Â To_Unbounded_String("Nouveau"), To_Unbounded_String("Neu"),// //Â Â Â Â Â To_Unbounded_String("Nuevo"));//
//  Lan_Open          : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("Open"), To_Unbounded_String("Open"),// //Â Â Â Â Â To_Unbounded_String("Ouvrir"), To_Unbounded_String("Ofnen"),// //Â Â Â Â Â To_Unbounded_String("Abierto"));//
//  Lan_Save          : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("Save"), To_Unbounded_String("Opslaan"),// //Â Â Â Â Â To_Unbounded_String("Sauvegarder"), To_Unbounded_String("Speichern"),//
//Â Â Â Â Â To_Unbounded_String("Guardar"));//
//  Lan_Save_As       : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("Save As"), To_Unbounded_String("Opslaan Als"),//
//Â Â Â Â Â To_Unbounded_String("Enregistrer sous"), To_Unbounded_String("Speichern unter"),//
//Â Â Â Â Â To_Unbounded_String("Guardar como"));//
//|//
//|etc.//
//|//
//  Lan_About         : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("About"), To_Unbounded_String("Over"),// //Â Â Â Â Â To_Unbounded_String("Sur"), To_Unbounded_String("Ãœber"),// //Â Â Â Â Â To_Unbounded_String("Acerca de"));//
//
//Â Â --Buttons//
//Â Â Lan_OKÂ Â Â Â Â Â Â Â Â Â Â Â : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("OK"), To_Unbounded_String("OK"),// //Â Â Â Â Â To_Unbounded_String("OK"), To_Unbounded_String("OK"),// //Â Â Â Â Â To_Unbounded_String("OK"));//
//  Lan_Cancel        : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("Cancel"), To_Unbounded_String("Annuleren"),// //Â Â Â Â Â To_Unbounded_String("Annuler"), To_Unbounded_String("Abbrechen"),//
//Â Â Â Â Â To_Unbounded_String("Cancelar"));//
//  Lan_Open_But      : constant array(GB_USA .. ES) of Unbounded_String :=//
//    (To_Unbounded_String("Open"), To_Unbounded_String("Open"),// //     To_Unbounded_String("Ouvrir"), To_Unbounded_String("Öffnen"),// //     To_Unbounded_String("Abierto"));//
//  Lan_Save_but      : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("Save"), To_Unbounded_String("Opslaan"),// //Â Â Â Â Â To_Unbounded_String("Sauvegarder"), To_Unbounded_String("Speichern"),//
//Â Â Â Â Â To_Unbounded_String("Guardar"));//
//  Lan_Set           : constant array(GB_USA .. ES) of Unbounded_String :=//
//Â Â Â Â (To_Unbounded_String("Set"), To_Unbounded_String("Zet"),// //Â Â Â Â Â To_Unbounded_String("Tourner"), To_Unbounded_String("Wende an"),// //Â Â Â Â Â To_Unbounded_String("Vuelta"));//
//
//Â Â -- Various Labels//
//  Lan_Hgrid       : constant array(GB_USA .. ES) of Unbounded_String
:=//
//Â Â Â Â (To_Unbounded_String("Height of a Box"),
To_Unbounded_String("Hoogte van een Box"),//
//     To_Unbounded_String("Hauteur d'une boîte"), To_Unbounded_String("Höhe einer Box"),//
//Â Â Â Â Â To_Unbounded_String("Altura de una caja"));//
//  Lan_VGrid       : constant array(GB_USA .. ES) of Unbounded_String
:=//
//Â Â Â Â (To_Unbounded_String("Width of a Box"),
To_Unbounded_String("Breedte van een Box"),//
//     To_Unbounded_String("Largeur d'une boîte"), To_Unbounded_String("Breite einer Box"),//
//Â Â Â Â Â To_Unbounded_String("Ancho de una caja"));//
//|//
//|etc.//
//|//
//Â Â Lan_Gray_Squares : constant array(GB_USA .. ES) of Unbounded_String
:=//
//Â Â Â Â (To_Unbounded_String("Gray Squares"), To_Unbounded_String("Grijze Vlakken"),//
//     To_Unbounded_String("Carrés gris"), To_Unbounded_String("Graue Quadrate"),//
//Â Â Â Â Â To_Unbounded_String("Cuadrados grises"));//
////
//Â procedure Reload_Language(l : Language);//
//
//end Sudoku_Languages;// //-------------------------------------------------------------------------------------------------------------------------------//
//pragma License(Unrestricted);//
//with Gdk.Event;Â Â Â Â use Gdk.Event;//
//with Gtk.Dialog;Â Â Â use Gtk.Dialog;//
//with Gtk.Button;Â Â Â use Gtk.Button;//
//with Gtk.Menu_Item; use Gtk.Menu_Item;//
//
//package Sudoku_Languages_Dialog_CB is//
//
//
//Â Â procedure On_Lan_End (Object : access Gtk_Button_Record'Class);//
//Â Â procedure On_Lan_Set (Object : access Gtk_Button_Record'Class);//
//Â Â function On_Dialog_Delete_Event (Object : access Gtk_Dialog_Record'Class;// //Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Event : Gdk.Event.Gdk_Event)
return boolean;//
//
//end Sudoku_Languages_Dialog_CB;// //-------------------------------------------------------------------------------------------------------------------------------//
//pragma License(Unrestricted);//
//with Glib;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â use Glib;//
//with Gtk.Dialog;Â Â Â Â Â Â Â Â Â Â Â use Gtk.Dialog;//
//with Gtk.Box;Â Â Â Â Â Â Â Â Â Â Â Â Â Â use Gtk.Box;//
//with Gtk.Label;Â Â Â Â Â Â Â Â Â Â Â Â use Gtk.Label;//
//with Gtk.Combo_Box_Text;Â Â Â use Gtk.Combo_Box_Text;//
//with Gtk.Button;Â Â Â Â Â Â Â Â Â Â Â use Gtk.Button;//
//with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;//
//
//package Sudoku_Languages_Dialog_Init is//
//
//  type Lan_Dialog_Record is new Gtk_Dialog_Record with record// //     Dialog_Box  : Gtk_Box;//
//     Input_Box   : Gtk_Box;//
//     Combo_Box   : Gtk_Box;//
//     Combo_Label : Gtk_Label;//
//     Combo_Inp   : Gtk_Combo_Box_Text;//
//     Button_Box  : Gtk_Box;//
//Â Â Â Â Â OKÂ Â Â Â Â Â Â Â Â Â : Gtk_Button;//
//     Cancel      : Gtk_Button;//
//Â Â end record;//
//Â Â type Lan_Dialog_Access is access all Lan_Dialog_Record'Class;//
//
//Â Â Dialogsize_H : Gint := 150;Â -- Width of the dialog window//
//Â Â Dialogsize_V : Gint := 80;Â Â -- Height of the dialog window//
//  Lan_Dialog  : Lan_Dialog_Access;//
//
//Â Â procedure Gtk_New(LanDialog : out Lan_Dialog_Access);//
//Â Â procedure Init(LanDialog : access Lan_Dialog_Record'Class);//
//
//end Sudoku_Languages_Dialog_Init;// /-------------------------------------------------------------------------------------------------------------------------------
In some cases the various items are part of the program but in other
cases the items can be part of a file somewhere on your system.
This system creates the possibility to change the language while running
the program (procedure reload). Loading the lan parameter from an .ini
file starts the program in that language.
Using a GUI editor like Glade makes it easier to develop such a program
on the condition that it is easy to change all text variables in
elements of the of the constant arrays.
I have been looking at the Glade files but at the moment I don't have information enough to create a conversion program to ada myself, that is
the reason of my question
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
At this moment I am using the following three packages:<br>
<i>-------------------------------------------------------------------------------------------------------------------------------</i><i><br>
</i><i>pragma License(Unrestricted);</i><i><br>
</i><i>with Glib;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â use Glib;</i><i><br>
</i><i>with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;</i><i><br>
</i><i><br>
</i><i>package Sudoku_Languages is</i><i><br>
</i><i><br>
</i><i>Â Â type Language is (GB_USA, NL_B, F_B, D, ES);</i><i><br>
</i><i><br>
</i><i>Â Â Â Â Â Lan_IDÂ Â Â Â Â Â Â Â : Gint := 0;</i><i><br>
</i><i><br>
</i><i>Â Â -----------------------------------------------------------------------------</i><i><br>
</i><i>Â Â --Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
--</i><i><br>
</i><i>Â Â -- If not all languages are wanted nr_languages must be
altered and in    --</i><i><br>
</i><i>Â Â -- CH_Lanuages CH_Languages the not wanted languages must
be deleted      --</i><i><br>
</i><i>Â Â --Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
--</i><i><br>
</i><i>Â Â -----------------------------------------------------------------------------</i><i><br>
</i><i>  nr_languages    : constant integer := 5;</i><i><br>
</i><i><br>
</i><i>Â Â type ar_lan is array (0 .. nr_languages - 1) of Language;</i><i><br>
</i><i><br>
</i><i>  Lan             : Language := GB_USA;</i><i><br>
</i><i>  CH_Languages    : constant ar_lan := (GB_USA, NL_B, F_B,
D, ES);</i><i><br>
</i><i><br>
</i><i>Â Â -- Languages Names</i><i><br>
</i><i>  Language_Names  : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("English"),
To_Unbounded_String("Nederlands"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Francais"),
To_Unbounded_String("Deutsch"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Espagnol"));</i><i><br>
</i><i>Â Â -- Titles</i><i><br>
</i><i>Â Â Lan_Window_Title : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("Sudoku Program"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Sudoku Programma"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Programme Sudoku"),
To_Unbounded_String("Sudoku-Programm"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Programa de Sudoku"));</i><i><br>
</i><i>Â Â Lan_Dialog_Title : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("Grid Dialog"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Grid Dialoog"),</i><i><br>
</i><i>     To_Unbounded_String("Boîte de dialogue Grille"),
To_Unbounded_String("Rasterdialog"),</i><i><br>
</i><i>     To_Unbounded_String("Diálogo de cuadrÃcula"));</i><i><br>
</i><i><br>
</i><i>Â Â -- Menu</i><i><br>
</i><i>  Lan_File          : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("_File"),
To_Unbounded_String("_Bestanden"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Fichier"),
To_Unbounded_String("Datei"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Archivo"));</i><i><br>
</i><i>  Lan_Edit          : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("_Edit"),
To_Unbounded_String("Be_werken"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Modifier"),
To_Unbounded_String("Bearbeiten"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Editar"));</i><i><br>
</i><i>|</i><i><br>
</i><i>| etc.</i><i><br>
</i><i>|</i><i><br>
</i><i>  Lan_Help          : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("_Help"),
To_Unbounded_String("Hulp"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Aide"),
To_Unbounded_String("Hilfe"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Ayuda"));</i><i><br>
</i><i>  Lan_New           : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("New"),
To_Unbounded_String("Nieuw"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Nouveau"),
To_Unbounded_String("Neu"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Nuevo"));</i><i><br>
</i><i>  Lan_Open          : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("Open"),
To_Unbounded_String("Open"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Ouvrir"),
To_Unbounded_String("Ofnen"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Abierto"));</i><i><br>
</i><i>  Lan_Save          : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("Save"),
To_Unbounded_String("Opslaan"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Sauvegarder"),
To_Unbounded_String("Speichern"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Guardar"));</i><i><br>
</i><i>  Lan_Save_As       : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("Save As"),
To_Unbounded_String("Opslaan Als"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Enregistrer sous"),
To_Unbounded_String("Speichern unter"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Guardar como"));</i><i><br>
</i><i>|</i><i><br>
</i><i>|etc.</i><i><br>
</i><i>|</i><i><br>
</i><i>  Lan_About         : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("About"),
To_Unbounded_String("Over"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Sur"),
To_Unbounded_String("Ãœber"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Acerca de"));</i><i><br>
</i><i><br>
</i><i>Â Â --Buttons</i><i><br>
</i><i>Â Â Lan_OKÂ Â Â Â Â Â Â Â Â Â Â Â : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("OK"), To_Unbounded_String("OK"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("OK"), To_Unbounded_String("OK"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("OK"));</i><i><br>
</i><i>  Lan_Cancel        : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("Cancel"),
To_Unbounded_String("Annuleren"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Annuler"),
To_Unbounded_String("Abbrechen"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Cancelar"));</i><i><br>
</i><i>  Lan_Open_But      : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("Open"),
To_Unbounded_String("Open"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Ouvrir"),
To_Unbounded_String("Öffnen"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Abierto"));</i><i><br>
</i><i>  Lan_Save_but      : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("Save"),
To_Unbounded_String("Opslaan"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Sauvegarder"),
To_Unbounded_String("Speichern"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Guardar"));</i><i><br>
</i><i>  Lan_Set           : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("Set"), To_Unbounded_String("Zet"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Tourner"),
To_Unbounded_String("Wende an"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Vuelta"));</i><i><br>
</i><i><br>
</i><i>Â Â -- Various Labels</i><i><br>
</i><i>  Lan_Hgrid       : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("Height of a Box"),
To_Unbounded_String("Hoogte van een Box"),</i><i><br>
</i><i>     To_Unbounded_String("Hauteur d'une boîte"),
To_Unbounded_String("Höhe einer Box"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Altura de una caja"));</i><i><br>
</i><i>  Lan_VGrid       : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("Width of a Box"),
To_Unbounded_String("Breedte van een Box"),</i><i><br>
</i><i>     To_Unbounded_String("Largeur d'une boîte"),
To_Unbounded_String("Breite einer Box"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Ancho de una caja"));</i><i><br>
</i><i>|</i><i><br>
</i><i>|etc.</i><i><br>
</i><i>|</i><i><br>
</i><i>Â Â Lan_Gray_Squares : constant array(GB_USA .. ES) of
Unbounded_String :=</i><i><br>
</i><i>Â Â Â Â (To_Unbounded_String("Gray Squares"),
To_Unbounded_String("Grijze Vlakken"),</i><i><br>
</i><i>     To_Unbounded_String("Carrés gris"),
To_Unbounded_String("Graue Quadrate"),</i><i><br>
</i><i>Â Â Â Â Â To_Unbounded_String("Cuadrados grises"));</i><i><br>
</i><i>Â </i><i><br>
</i><i>Â procedure Reload_Language(l : Language);</i><i><br>
</i><i><br>
</i><i>end Sudoku_Languages;</i><i><br>
</i><i>-------------------------------------------------------------------------------------------------------------------------------</i><i><br>
</i><i>
pragma License(Unrestricted);</i><i><br>
</i><i>with Gdk.Event;Â Â Â Â use Gdk.Event;</i><i><br>
</i><i>with Gtk.Dialog;Â Â Â use Gtk.Dialog;</i><i><br>
</i><i>with Gtk.Button;Â Â Â use Gtk.Button;</i><i><br>
</i><i>with Gtk.Menu_Item; use Gtk.Menu_Item;</i><i><br>
</i><i><br>
</i><i>package Sudoku_Languages_Dialog_CB is</i><i><br>
</i><i><br>
</i><i><br>
</i><i>Â Â procedure On_Lan_End (Object : access
Gtk_Button_Record'Class);</i><i><br>
</i><i>Â Â procedure On_Lan_Set (Object : access
Gtk_Button_Record'Class);</i><i><br>
</i><i>Â Â function On_Dialog_Delete_Event (Object : access
Gtk_Dialog_Record'Class;</i><i><br>
</i><i>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Event :
Gdk.Event.Gdk_Event) return boolean;</i><i><br>
</i><i><br>
</i><i>end Sudoku_Languages_Dialog_CB;</i><i><br>
</i><i>-------------------------------------------------------------------------------------------------------------------------------</i><i><br>
</i><i>
pragma License(Unrestricted);</i><i><br>
</i><i>with Glib;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â use Glib;</i><i><br>
</i><i>with Gtk.Dialog;Â Â Â Â Â Â Â Â Â Â Â use Gtk.Dialog;</i><i><br>
</i><i>with Gtk.Box;Â Â Â Â Â Â Â Â Â Â Â Â Â Â use Gtk.Box;</i><i><br>
</i><i>with Gtk.Label;Â Â Â Â Â Â Â Â Â Â Â Â use Gtk.Label;</i><i><br>
</i><i>with Gtk.Combo_Box_Text;Â Â Â use Gtk.Combo_Box_Text;</i><i><br>
</i><i>with Gtk.Button;Â Â Â Â Â Â Â Â Â Â Â use Gtk.Button;</i><i><br>
</i><i>with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;</i><i><br>
</i><i><br>
</i><i>package Sudoku_Languages_Dialog_Init is</i><i><br>
</i><i><br>
</i><i>Â Â type Lan_Dialog_Record is new Gtk_Dialog_Record with
record</i><i><br>
</i><i>     Dialog_Box  : Gtk_Box;</i><i><br>
</i><i>     Input_Box   : Gtk_Box;</i><i><br>
</i><i>     Combo_Box   : Gtk_Box;</i><i><br>
</i><i>     Combo_Label : Gtk_Label;</i><i><br>
</i><i>     Combo_Inp   : Gtk_Combo_Box_Text;</i><i><br>
</i><i>     Button_Box  : Gtk_Box;</i><i><br>
</i><i>Â Â Â Â Â OKÂ Â Â Â Â Â Â Â Â Â : Gtk_Button;</i><i><br>
</i><i>     Cancel      : Gtk_Button;</i><i><br>
</i><i>Â Â end record;</i><i><br>
</i><i>Â Â type Lan_Dialog_Access is access all
Lan_Dialog_Record'Class;</i><i><br>
</i><i><br>
</i><i>Â Â Dialogsize_H : Gint := 150;Â -- Width of the dialog window</i><i><br>
</i><i>Â Â Dialogsize_V : Gint := 80;Â Â -- Height of the dialog
window</i><i><br>
</i><i>  Lan_Dialog  : Lan_Dialog_Access;</i><i><br>
</i><i><br>
</i><i>Â Â procedure Gtk_New(LanDialog : out Lan_Dialog_Access);</i><i><br>
</i><i>Â Â procedure Init(LanDialog : access
Lan_Dialog_Record'Class);</i><i><br>
</i><i><br>
</i><i>end Sudoku_Languages_Dialog_Init;</i><i><br>
</i>-------------------------------------------------------------------------------------------------------------------------------<br>
In some cases the various items are part of the program but in other
cases the items can be part of a file somewhere on your system.<br>
This system creates the possibility to change the language while
running the program (procedure reload). Loading the lan parameter
from an .ini file starts the program in that language.<br>
<br>
Using a GUI editor like Glade makes it easier to develop such a
program on the condition that it is easy to change all text
variables in elements of the of the constant arrays.<br>
<br>
I have been looking at the Glade files but at the moment I don't
have information enough to create a conversion program to ada
myself, that is the reason of my question<br>
<br>
</body>
</html>
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)