Skip to content

Omnis Studio library to manage string table content. Replacing need for stringtable files.

License

Notifications You must be signed in to change notification settings

PISL/omnis-stbeditor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

omnis-stbeditor

STBEDITOR.lbs is an Omnis Studio library and PostgreSQL database to store the Omnis string table entries for all your applications. The library includes an interface to the Google Translate API so basic translations can be obtained for your string tables.

The database entries can be extracted to create an in-memory string table when your application starts up by including a call to the method $buildStringTable, which can be copied from the task class tkSuper.

Dependencies

Omnis Studio version 8.1 or later.

STBEDITOR requires a PostgreSQL database to store the string table entries in. The database can be created from stb.sql but will require that your Postgres instance has the following two group roles created first:

  1. "_developer" which owns the objects and
  2. "regular" which must be granted to the login role you wish to use to connect from Omnis.

NB. The database includes the entries for the CONFERENCE app to get you started.

Installation

Clone this repository.

Copy stbeditor.lbs to a directory of your choice or open Omnis and Import from JSON.

Copy the SQLite initialisation DB STBEDITOR.libini to the same directory as the library.

Create the stb database from the stb.sql script (replacing dBserver/port/dbToConnectTo/userName with your own values):

psql -h dbServer -p port -d dbToConnectTo -U userName -a -f /path/to/stb.sql

Usage

  1. Open stbeditor.lbs, and a login window will open to allow you to choose your database connection.

Instances

  1. Hold down the shift key and click the Quit button.
  2. This will take you to the init configuration editor.

Instances

  1. Select "database connection info" from the drop list
  2. Enter your Postgres server parameters: Host and port. (The "validif" value is used in an Omnis eval() to decide if this connection can be used. If you enter multiple databases and more than one "validif" evaluates to kTrue, the login window will display them in a drop list to be selected by the user.)
  3. Save your changes and close the library.
  4. Reopen the library and you should be able to connect to your stb database.

Note

The editor includes an object class, oTranslate, which interfaces to Google's Translation API. To use this functionality, an API key must be obtained from Google and entered in the global reference table.

  1. Select "reference global" from the String Table Editor menu.
  2. Select GOOGLE from the class drop list.
  3. Select the TRANSLATION_KEY line and enter your API key in the character box to the right. The change will save when you close the window.

Instances

About

Omnis Studio library to manage string table content. Replacing need for stringtable files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published