How tos
How to translate the user interface
This chapter explains how to translate Transcriber
user interface in a new language :
- Make a copy of
transcriber1.5/etc/local_fr.txt
, which is the french translation file, and rename it tolocal_lang.txt
wherelang
is the bigram of the language you want to add
- To add your translation, edit
local_lang.txt
, which contains all the translations of the text of the user interface.
- At the beginning of
local_lang.txt
, replace
array set local_fr
by
array set local_lang
- Then, you just have to remove the french translations and add your own translations
- If your language exists in the array language of
transcriber1.5/etc/default.txt
, then when you launchTranscriber
, it automatically reads your translation file. If it doesn't exist, you have to add your language with its bigram in the array language ofdefault.txt
and remove the line defining the arraylanguage
in yourTranscriber
user's preference file (.transcriber
on Linux,transcriber.pref
on Windows orTranscriber Configuration
on Mac OS).
- To switch
Transcriber
interface to the desired language, launchTranscriber
and set your language in the menu:Option->General->Language
How to make a binary package
How to make a RPM Linux package
This chapter explains how to build a source RPM
and a binary RPM
from a source project:
- Get the file
transcriber.spec
from your lastTranscriber
installation. It should be in the directory :
/usr/src/RPM/SPECS
,
- if you have previously installed
Transcriber
's RPM
.- Move it to
/usr/src/RPM/SPECS
, log as root and modify it to make it correspond to your release.
- Rename
Transcriber
source directory totranscriber-1.5.0
(if your release number is1.5.0
).
- Make an archive (
transcriber-1.5.0.tar.gz
) of it (taking care of removing unwanted directories likeCVS/
) and move it to
/usr/src/RPM/SOURCES
- Move also to that directory the icon of Trancriber,
trans.gif
. You can find it in the directorytranscriber15/doc/img
- Move to
/usr/src/RPM/SPECS
, log as root and build the package
rpm -ba transcriber.spec
- The place of
Transcriber
source and binary package will be displayed at the end of the building. Copy them in a safe place in your home directory.- Install it as root to test it (it should be installed in
/usr/lib/transriber1.5
):
rpm -i transcriber-1.5.0.rpm
How to make a binary Linux package
The Linux binary package has been simply done by :
- Installing
Transcriber
from sources in your home directory (~
).
- Creating the package directory let's say
~/TransPack
and its sub-directories,~/TransPack/lib
and~/TransPack/bin
- Copying the binary libraries (depending on your configuration) just previously installed:
/~/lib/transcriber1.5
,~/lib/tcLex1.2
and~/lib/Snack2.2
in~/TransPack/lib
- Copying
Transcriber
launching script,~/bin/trans
, in~/TransPack/bin
- Just tar and gunzip
TransPack/
directory:
tar -cvf TransPack.tar TransPack > gunzip -c
- You have your binary package !!
How to make a Windows Setup package
The Windows Setup package is done by using a Setup builder called Inno Setup. This tools enables to embed in a single Setup file:
- the
Transcribe
r binary package - a single executable file called tclkit that enables to source Tcl/Tk scripts
- an application to launch Transcriber by sourcing it using
tclkit
- the code necessary to create shortcuts, set registry key values, ...
Creation of the Win32 Transcriber launcher
In order to launch Transcriber
simply by double-clicking on an executable file, a Win32 application, named transwin.exe
has been created. This has been done with the help of Dev-C++ which is an open Integrated Development Environment for the C/C++ programming language that uses Mingw port of GCC (GNU Compiler Collection) as its compiler and that can create Win32 applications.
- The project name is
transwin.dev
. It enables to create a Win32 application namedtranswin.exe
.
- The job of
transwin.exe
, is simply to look forTranscriber
path in the registry and then source
lib/transcriber1.5/tcl/Main.tcl
- from that location with the help of
tclkit.exe
, to launch Transcriber
.- If you changed the path to
Transcriber
, you have to modifyTRANS_TCL_PATH
intranswin.dev
and recompile it
Transcriber
's path is retrieved by reading the registry key
HKEY_CLASSES_ROOT\Transcriber\Directory
- which is set by the
Setup
package during the installation. transwin.exe
can also take a parameter into account. So if a.trs
file is drag-and-dropped ontranswin.exe
, it will be opened usingTranscriber
.
Creation of the setup package
- Get the last
Transcriber
sources on SourceForge's CVS on a Linux platform because, for un unknown reason, images are corrupted when downloaded on Windows with CVS. Then remove the unused directories (CVS\
,contrib\
,lrec\
, ...)
- Compile
Transcriber
sources on Windows in
c:\tmp\transcriber
- Download the last version of tclkit. Recompile it to integrate all unicode encodings. Rename it to
tclkit.exe
if it has another name, and put it in
c:\tmp\transcriber
- Download the last versions of the Snack sound toolkit. Extract it and just copy the content of
bin\windows directory
(which contains dll files), in
c:\tmp\transcriber\lib\Snack
- Download the XML parser tclLex , extract it and copy it to
c:\tmp\transcriber\lib
- Put
Transcriber
icon and the licence filelicence.txt
in
c:\tmp\trancriber
- Check that there's no read-only files (otherwise it can prevent their deletion)
- A relative path from
tclkit.exe
location (TRANS_TCL_PATH
) is defined intranswin.dev
. That path is used bytranswin.exe
to sourceTranscriber
. Check if this path is correct with the modifications that you've done. If it's not, modify it and recompile it.
- Build the setup package using Inno Setup.
Thanks to this tool, a Setup package is created that do the following during the installation process:
- definition of
transwin.exe
as the main executable file of Transcriber - creation of a desktop shortcut
- creation of a quicklaunch shortcut
- association of an icon to the shortcuts
- association of the same icon to
.trs
files - opening of
.trs
files withTranscriber
when they are double-clicked - creation of the registry key
HKEY_CLASSES_ROOT\Transcriber\Directory
which contains the path toTranscriber
installation directory
How to make a Mac OS X binary package
The Mac OS version used to create Transcriber 1.4.6
binary package is Mac OS X 10.3.
The binary version has been created using the standalone version of Tcl/Tk 8.4.4, tcltkaqua ,
which has been modified to integrate Transcriber
's ressources.
Especially, in Contents
directory, the following files have been added:
- librairies and ressources necessary,
lib/{html_library, snack 2.2, tcLex1.2, transcriber 1.4}
- a Tcl script to launch the application,
Ressources/Scripts/AppMain.tcl
- a Transcriber icon,
Ressources/Trans.icns
- and the
Info.plist
file fromWish
package has been modified to application specific settings (new icon file, application name, version,.trs
file extension).
Finally, a compressed version *.dmg
of Transcriber
directory has been created using Disk Utility
application of Mac OS X 10.3
How to edit a new release
- Retrieve the last source code on
CVS
from a Linux platform (for a unkown reason, images are corrupted when downloaded from Windows) and remove all the unused files and directories (CVS/
,contrib/
, ...).
- Compile your code on Linux and Windows, and test all
Transcriber
's functionalities.
- If everything works fine, tag your
CVS
code (for example,Release-1-5-0
if yourTranscriber
version number is 1.5.0).
- Build the following releases:
- RPM
- Linux binary saved as a
tar.gz
- Windows setup
- Mac OS
- Upload those different releases on SourceForge and archive them for yoursel.
How to add a global variable
If you want to add a new element in the array v
, which contains all the global variables, you just have to type in a Tcl
script:
set v(my_ element) value_element
But, if you want it to be saved when you exit Transcriber
, you have to add the following line in etc/default.txt
:
v(my_element) ""
So, when Transcriber
will be launched, it will read that line and create the global variable v(my_element)
with nothing inside.
If during Transcriber
execution, a value is set in the global variable, then when exiting, that value will be saved in the user configuration file (.transcriber
on Linux or transcriber.pref
on Windows or Transcriber Configuration
on Mac), and the next time Transcriber
is launched, that value will be set in v
(it means that it will have a priority on what is defined in etc/default.txt
).