TABLE OF CONTENTS


MsgCat/MsgCatAda [ Packages ]

[ Top ] [ MsgCat ] [ Packages ]

FUNCTION

 Provide code for manipulate Tcl package msgcat

SOURCE

package Tcl.MsgCat.Ada with
   SPARK_Mode
is

MsgCatAda/MsgCatAda.Mc [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Get the translation for the selected string

SOURCE

   function Mc
     (Interp: Tcl_Interp; Src_String: in String; Arguments: in String := "")
      return String with
      Pre => Src_String /= "";

PARAMETERS

 Interp     - Tcl interpreter on which translation will be get
 Src_String - Source string which for which translation will be get
 Arguments  - Additional arguments. If not empty, command format will be
              used for format translation result and Arguments will be
              passed to it. Default value is empty.

RESULT

 String with translation of Src_String. If no translation string exists,
 it return result string from routine mcunknown

EXAMPLE

   -- Get the translation for string hello world in My_Interp Tcl interpreter
   Translation: constant String := Mc(My_Interp, "{hello world}");

COMMANDS

 ::msgcat::mc src-string ?arguments?

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_Exists [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Check it translation for the selected string exists

SOURCE

   function Mc_Exists
     (Interp: Tcl_Interp; Src_String: in String; Options: in String := "")
      return String with
      Pre => Src_String /= "";

PARAMETERS

 Interp     - Tcl interpreter on which translation will be looking for
 Src_String - Source string for which translation will be looking for
 Options    - Additional options, can be "-exactnamespace" or
              "-exactlocale" or both. Default value is empty
 Result
 True if translation for the selected string exists, otherwise false

EXAMPLE

      -- Check if translation for string hello world exists in My_Interp interpreter
      Is_Translated: constant String := Mc_Exists(My_Interp, "{hello world}");

COMMANDS

 ::msgcat::mcexists ?options? src-string

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_Forget_Package [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Clear all msgcat settings and translations at the selected interpreter

SOURCE

   procedure Mc_Forget_Package(Interp: in Tcl_Interp);

PARAMETERS

 Interp - Tcl interpreter on which current state of mgscat will be
          cleared
 8.6.7 - Added

EXAMPLE

      -- Clear all msgcat settings on My_Interp Tcl interpreter
      Mc_Forget_Package(My_Interp);

COMMANDS

 ::msgcat::mcforgetpackage

MsgCatAda/MsgCatAda.Mc_Load_(function) [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Load the translations for the currently set locale from the selected
 directory

SOURCE

   function Mc_Load
     (DirName: in String; Interp: in Tcl_Interp) return String with
      Pre => DirName /= "";

PARAMETERS

 DirName - The name of the directory which will be scanned for the
           translations and if found anything, loaded
 Interp  - Tcl interpreter on which the locations will be loaded

RESULT

 Amount of loaded translation files

EXAMPLE

      -- Load translations from directory messages to My_Interp interpreter
      Loaded_Files: constant String := Mc_Load("messages", My_Interp);

SEE ALSO

 MsgCatAda.Mc_Load_(procedure)

COMMANDS

 ::msgcat::mcload dirname

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_Load_(procedure) [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Load the translations for the currently set locale from the selected
 directory

SOURCE

   procedure Mc_Load(DirName: in String; Interp: in Tcl_Interp) with
      Pre => DirName /= "";

PARAMETERS

 DirName - The name of the directory which will be scanned for the
           translations and if found anything, loaded
 Interp  - Tcl interpreter on which the locations will be loaded

EXAMPLE

      -- Load translations from directory messages to My_Interp interpreter
      Mc_Load("messages", My_Interp);

SEE ALSO

 MsgCatAda.Mc_Load_(function)

COMMANDS

 ::msgcat::mcload dirname

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_LoadedLocales_Clear [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Remove locales and their data, which are not in the current
 preferences list

SOURCE

   procedure Mc_LoadedLocales_Clear(Interp: in Tcl_Interp);

PARAMETERS

 Interp - Tcl interpreter on which locales will be cleared

EXAMPLE

      -- Remove all locales and their data from My_Interp interpreter
      Mc_LoadedLocales_Clear(My_Interp);

COMMANDS

 ::msgcat:mcloadedlocales clear

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_LoadedLocales_Get [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Get the list of the currently loaded locales

SOURCE

   function Mc_LoadedLocales_Get(Interp: in Tcl_Interp) return String;

PARAMETERS

 Interp - Tcl interpreter on which the loaded locales will be queried

RESULT

 The list of the currently loaded locales

EXAMPLE

   -- Get the list of currently loaded locales in My_Interp Tcl interpreter
   Loaded_Locales: constant String := Mc_LoadedLocales_Get(My_Interp);

COMMANDS

 ::msgcat:mcloadedlocales get

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_LoadedLocales_Present [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Check if the selected locale was loaded in the selected interpreter

SOURCE

   function Mc_LoadedLocales_Present
     (Interp: in Tcl_Interp; Locale: in String) return String with
      Pre => Locale /= "";

PARAMETERS

 Interp - Tcl interpreter on which locale will be check
 Locale - The name of the locale to check

RESULT

 True if the selected Locale was loaded, otherwise false

EXAMPLE

   -- Check if locale pl was loaded to My_Interp Tcl interpreter
   Is_Loaded: constant String := Mc_LoadedLocales_Present(My_Interp, "pl");

COMMANDS

 ::msgcat:mcloadedlocales present locale

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_Locale_(function) [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Get the default locale for the selected interpreter

SOURCE

   function Mc_Locale(Interp: in Tcl_Interp) return String;

PARAMETERS

 Interp - Tcl interpreter from which locale will be get

RESULT

 The name of the currently set locale

EXAMPLE

      -- Get the name of default locale for My_Interp Tcl interpreter
      Locale_Name: constant String := Mc_Locale(My_Interp);

SEE ALSO

 MsgCatAda.Mc_Locale_(procedure)

COMMANDS

 ::msgcat::mclocale

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_Locale_(procedure) [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Set the new default locale for the selected interpreter

SOURCE

   procedure Mc_Locale(NewLocale: in String; Interp: in Tcl_Interp) with
      Pre => NewLocale /= "";

PARAMETERS

 NewLocale - The name of the new default locale for the selected
             Tcl interpreter
 Interp    - Tcl interpreter on which locale will be set

RESULT

 Number of translation files loaded

EXAMPLE

      -- Set default locale to en_US on My_Interp Tcl interpreter
      Mc_Locale("en_US", My_Interp);

SEE ALSO

 MsgCatAda.Mc_Locale_(function)

COMMANDS

 ::msgcat::mclocale newlocale

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_Max [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Get the longest translated string for selected values.

SOURCE

   function Mc_Max
     (Strings: in String; Interp: in Tcl_Interp) return String with
      Pre => Strings /= "";

PARAMETERS

 Strings - Source strings which translations will be check for length
 Interp  - Tcl interpreter on which length check will be done

RESULT

 Length of the longest translated string for selected Strings

EXAMPLE

   -- Get the longest translation length for string my word and hello world in My_Interp interpreter
   Max_Length: constant String := Mc_Max("{my word} {hello word}", My_Interp);

COMMANDS

 ::msgcat::mcmax strings

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_Mset_(function) [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Set the translations for the multiple source strings for the selected
 locale in the selected interpreter

SOURCE

   function Mc_Mset
     (Interp: in Tcl_Interp; Locale, List: in String) return String with
      Pre => Locale /= "" and List /= "";

PARAMETERS

 Interp - Tcl interpreter in which translations will be set
 Locale - The name of the locale in which translations will be added
 List   - List of source translation source translation ... to add

RESULT

 Number of translations set

EXAMPLE

      -- Set the translations hello world to helloword and my word to myword in locale en_US in My_Interp interpreter
      Translations_Amount: constant String := Mc_Mset(My_Interp, "en_US", "[list {hello world} {helloword} {my word} {myword}]");

SEE ALSO

 MsgCatAda.Mc_Mset_(function)

COMMANDS

 ::msgcat::mcmset locale list

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_Mset_(procedure) [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Set the translations for the multiple source strings for the selected
 locale in the selected interpreter

SOURCE

   procedure Mc_Mset(Interp: in Tcl_Interp; Locale, List: in String) with
      Pre => Locale /= "" and List /= "";

PARAMETERS

 Interp - Tcl interpreter in which translations will be set
 Locale - The name of the locale in which translations will be added
 List   - List of source translation source translation ... to add

EXAMPLE

      -- Set the translations hello world to helloword and my word to myword in locale en_US in My_Interp interpreter
      Mc_Mset(My_Interp, "en_US", "[list {hello world} {helloword} {my word} {myword}]");

SEE ALSO

 MsgCatAda.Mc_Mset_(function)

COMMANDS

 ::msgcat::mcmset locale list

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_Preferences [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Get the list with locales preferred by the user, based on the user's
 language specification

SOURCE

   function Mc_Preferences(Interp: in Tcl_Interp) return String;

PARAMETERS

 Interp - Tcl interpreter on which locales will be get

RESULT

 List with locales preferred by the user

EXAMPLE

      -- Get the list of locales for the user on My_Interp Tcl interpreter
      Languages_List: constant String := Mc_Preferences(My_Interp);

COMMANDS

 ::msgcat::mcpreferences

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_Set_(function) [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Set the translation for the selected string for the selected locale in
 the selected interpreter

SOURCE

   function Mc_Set
     (Interp: in Tcl_Interp; Locale, Src_String: in String;
      Translate_String: in String := "") return String with
      Pre => Locale /= "" and Src_String /= "";

PARAMETERS

 Interp           - Tcl interpreter on which translation will be set
 Locale           - The name of locale in which the translation will be
                    set
 Src_String       - The string which will be translated
 Translate_String - The translation of the Src_String. If empty,
                    Src_String will be used as translation. Default value
                    is empty

RESULT

 Value of Translate_String

EXAMPLE

      -- Set the translation of hello world to helloword1 in locale en_US on My_Interp interpreter
      Translation: constant String := Mc_Set(My_Interp, "en_US", "{hello world}", "{helloword1}");

SEE ALSO

 MsgCatAda.Mc_Set_(procedure)

COMMANDS

 ::msgcat::mcset locale src-string ?translate-string?

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.Mc_Set_(procedure) [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Set the translation for the selected string for the selected locale in
 the selected interpreter

SOURCE

   procedure Mc_Set
     (Interp: in Tcl_Interp; Locale, Src_String: in String;
      Translate_String: in String := "") with
      Pre => Locale /= "" and Src_String /= "";

PARAMETERS

 Interp           - Tcl interpreter on which translation will be set
 Locale           - The name of locale in which the translation will be
                    set
 Src_String       - The string which will be translated
 Translate_String - The translation of the Src_String. If empty,
                    Src_String will be used as translation. Default value
                    is empty

EXAMPLE

   -- Set the translation of hello world to helloword1 in locale en_US on My_Interp interpreter
   Mc_Set(My_Interp, "en_US", "{hello world}", "{helloword1}");

SEE ALSO

 MsgCatAda.Mc_Set_(function)

COMMANDS

 ::msgcat::mcset locale src-string ?translate-string?

HISTORY

 8.6.7 - Added

MsgCatAda/MsgCatAda.MsgCat_Init [ Subprograms ]

[ Top ] [ MsgCatAda ] [ Subprograms ]

FUNCTION

 Load package msgcat. Raise Program_Error if package can't be loaded

SOURCE

   procedure MsgCat_Init(Interp: in Tcl_Interp);

PARAMETERS

 Interp - Tcl interpreter to which msgcat package will be added

EXAMPLE

   -- Init msgcat package on My_Interp Tcl interpreter
   MsgCat_Init(My_Interp);

COMMANDS

 package require msgcat

HISTORY

 8.6.7 - Added