Skip to content

2. Installation and dependencies

Gary Criblez edited this page Jun 26, 2020 · 7 revisions

Installation of the component

The component can be installed like any 4D component. Simply put the file AJ_Tools_xliff.4dbase inside the "Components" folder of your application.

Dependencies

The component needs 4 tables to be created in your application to be able to work.

This choice was made to allow working in client/server with simultaneous people using the XLIFF Editor.

The XLIFF editor can be used by developers who want to create new strings to insert into the application, as well as by translators who translate these strings. Several translators can be involved and the risk of collision is reduced when working directly on records and tables.

⚠️ Here is the configuration of the tables that must be strickly respected :

Tables can be named according to your choice, however we recommend that you use the following names for each table to differentiate them from your own tables.

The names of fields, relationships and attributes must be respected for the component to be able to work.

Language Table

Name : AJ_Tools_xliff_Language

Fields :

Name Type Index Attributes
UUID UUID B-tree Primary Key
name Alpha B-tree Unique
infos Object - -

File Table

Name : AJ_Tools_xliff_File

Fields :

Name Type Index Attributes
UUID UUID B-tree Primary Key
name Alpha B-tree Unique

Group Table

Name : AJ_Tools_xliff_Group

Fields :

Name Type Index Attributes
UUID UUID B-tree Primary Key
UUID_File UUID Cluster -
resname Alpha B-tree Unique
id Alpha B-tree Unique

String Table

Name : AJ_Tools_xliff_String

Fields :

Name Type Index Attributes
UUID UUID B-tree Primary Key
UUID_Group UUID Cluster -
resname Alpha B-tree Unique
id Alpha B-tree Unique
infos Object - -

Relations

Many to One One to Many Many to One
Name
One to Many
Name
Attributes
[Group]UUID_File [File]UUID file groups Manual, Delete Related Many
[String]UUID_Group [Group]UUID group strings Manual, Delete Related Many

Using the tables (AJ_Tools_xliff_setTables)

To give the component the authorization to use the tables, you must provide the dataClasses to the component. You must use the "AJ_Tools_xliff_setTables" method before to open the editor. This method accepts 4 parameters. The 4 parameters are the 4 dataClasses in this order (Language;File;Group;String).

  AJ_Tools_xliff_setTables (ds.language;ds.file;ds.group;ds.string)

The best way to do it is to execute this method on the "on Startup" database method.

If the component is used in client/server mode, you must also run this method in the "on Server Startup" database method.

Launch the editor

To launch the XLIFF Editor, simply launch the "AJ_Tools_xliff_launchEditor" method.