Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 9:00 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Multilanguage publication
PostPosted: January 27th, 2009, 2:21 pm 
Offline

Joined: March 4th, 2007, 7:17 pm
Posts: 132
Apparently, there is only one way to make a publication in different languages - to insert variable into text blocks and to change values depending on the choice of language. The problem of how to write these variables.

There are a few ideas of how this can be implemented:
1. Text file.
2. In the INI file.
3. The database Access
4. The database SQlight

Someone has faced such a challenge?
In what format is better to keep the variables that had easy and fast access and safe storage?

_________________
Opus Pro 5.5
Win XP


For this message Volgar has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: January 27th, 2009, 7:18 pm 
Offline

Joined: November 3rd, 2004, 2:22 pm
Posts: 54
Location: Kent, Ohio, USA
How complex is your publication? If it is simple enough, can you create duplicates in the requisite languages?

_________________
Tom Hutchins
The Davey Institute
Kent, OH
800-445-8733
http://www.davey.com

Opus ProXE 5.5
Windows XP SP2


For this message Tom Hutchins has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 27th, 2009, 9:45 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Volgar wrote:
Quote:
Apparently, there is only one way to make a publication in different languages - to insert variable into text blocks and to change values depending on the choice of language.

'only one way'...is that true? Depending on what you want to do, and what (content, translations, sources,...) you have at hand at development time, the answer is different.

If content not available immediately, or it will change, external files or database has some advantage... maybe.

If you already have your content prepared in, say, 3 languages... and you wanted to embed these in Opus while you are creating the Pub, then there are a couple ways.
1. you could have duplicate Pages in separate chapters. Chap3A, Chap3B, Chap3C,... Chap4A, Chap4B and so on (many pages each chapter). You simply "fill" the copied pages with the alternative language text sections. And of course you would have your code or logic to direct the user to Pages in the alternative Chapter.

another way:
2. You could use MultiFrame feature, and have each FrameA, FrameB, FrameC for that one Page... contain specific language. On-show or pre-show actions can automatically present A, B, or C frame.

Similar to MultiFrame.... you could use standard Frames (A, B, C...) and use Opus "FrameC.SetLayer(3)" to bring just that frame to the forefront at runtime. You're achieving the effects of MF, just managing it more manually. (a small advantage is that it may be easier to work on individual Frames in Opus editor -- my experience).

As for .INI and Databases, both have their merits. INI is almost no-hassle... you just have to get used to the layout pattern and how sections are referenced. I am working on SQLite DB to populate different text objects... not diff languages, but variable selections based on User navigation. There's a definite learning-curve (for me) to understand what's possible and how to get there. Sometimes 'reversing direction' and going back to the 'drawing board'. I'm investing the time, since I want something reusable.

Quote:
to keep the variables that had easy and fast access and safe storage?
I think even if you use Opus' native capability for reading-in from Files (ReadLine or ReadField), it is relatively fast. What do you mean by 'safe'? There have been a few recent, and older, posts about protecting content files and about data encryption.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: January 29th, 2009, 3:57 pm 
Offline

Joined: March 4th, 2007, 7:17 pm
Posts: 132
Tom Hutchins wrote:
How complex is your publication? If it is simple enough, can you create duplicates in the requisite languages?

My publication is quite complex. A lot of graphics, scripts, 10-15 pages. If I create duplicate of pub, the size almost doubled. It is not appropriate.

Thank you

Lar_123, thank you. As usual, you have given detailed advice.

When I spoke "safe storage", I had in mind encryption.

Lar_123, could you put the code or some file with the publication of the most frequently used functions SQLite for display list of data, insert of new records, change, delete, query on the condition?

_________________
Opus Pro 5.5
Win XP


For this message Volgar has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Frames
PostPosted: January 29th, 2009, 4:41 pm 
Offline

Joined: October 25th, 2004, 2:20 pm
Posts: 686
Location: Naperville, Illinois (USA)
Opus: 7.05
OS: Win XP SP3
System: P4 3.2GHz 1GB RAM 2-TB HDs + 4 more
Volgar --

Several years ago I had to build a multi-language presentation. Duplicating Pages (many with large videos) wasn't pratical because of the resulting HUGE Pub size. I created an opening Page which required the viewer to select which language they wanted to see. That set a Variable I called "Language" to either a value of "1" for English, or "2" for French. It would have been easy to set several other options for more languages in the future.

Each Page had an On Show which made a Frame visible for the correct language. I only had to create one set of graphics/videos so the size was compact and maintenance was accomplished on one Page rather than two (or more). A French translator took the English text and converted it, so I could simply Copy & Paste their work into a Text Object within the French Frame. There were usually more than one Text Object on each Page and often graphics were in English or French, which is the reason I used Frames instead of simple Text Objects. Your situtation may allow for using Text Objects rather than Frames.

I highly recommend this method for creating multi-language Publications.

_________________
Fred Harms, Extraordinary Demos
Naperville, Illinois (USA) 630/904-3636
demofred@aol.com


For this message demofred has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 29th, 2009, 8:04 pm 
Offline

Joined: March 4th, 2007, 7:17 pm
Posts: 132
demofred, thanx.
Yes, and I suppose that this is the most convenient way.

_________________
Opus Pro 5.5
Win XP


For this message Volgar has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: January 30th, 2009, 12:53 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Quote:
Lar_123, could you put the code or some file with the publication of the most frequently used functions SQLite for display list of data, insert of new records, change, delete, query on the condition?

A few months ago I posted a 'Getting Started w SQLite' example (Mackavi hosted the download). At that time I did not have INSERT or UPDATE function working.

That sample Pub had some 'universal' queries built-in. Which was fine for reading from the DB. But I had difficulty editing the DB via 'universal' SQL statements. The point being, the UPDATE or INSERT statements are better done specific to your dataset and current scenario.

Some hints:
-- you'll want the "Getting Started" pubs previously posted, to use the following
-- use the Firefox plugin, SQLite Manager. Under its "Execute SQL" feature it is easy to construct and test an INSERT statement... etc.
-- then Copy & Paste that SQL statement into your OpusScript... and there you modify it with Variables to pick-up the values you need.
Code:
INSERT INTO DBtable1 VALUES( NULL,'James','Nautical','Docking','7842','Sunnyburg')

Code:
var NewRecordSQL = "" ;
NewRecordSQL = "INSERT INTO "+ TableVariable +" VALUES("+anArray1ofVALUES+")" ;
//next let's send the above SQL Statement to Test2, which is a copy of the function Test() (found in ScriptObject TestSQLite_1)
//Test2 should be modified to take a parameter/arg which is the SQL Statement string
Test2( NewRecordSQL )

There is a 'catch' to making the above work. SQLite likes VALUES to be in quotemarks. (except when Primary Key is Integer).
so...before the Insert or Update is sent to SQLite, we prepare Opus data to be SQL 'values'
Code:
RecINSERT_VALUES[0] = 'NULL'  ;   //assumes Autoincrementing PRI KEY.  Do NOT do this if have Text or other key.
//next series is changed 010609 to start with i=1
for ( var i = 1 ; i < NumberofColumns.length ; i++ )
{
RecINSERT_VALUES[i] = "'"+NewRecord_Data[i]+"'" ;
   //now we convert any  Inputing VALUES which are Blank, thus 'undefined', to NULL   
   if ( RecINSERT_VALUES[i] == "'undefined'" )
   {
   RecINSERT_VALUES[i] = 'NULL' ;
   }

}

then you may or may not need to run a Loop to ravel the Array (I use the loop to do other things here as well):
Code:
anArray1ofVALUES[ii]+= ", "+RecINSERT_VALUES[ii] ;



For Updating, start with something simple and test as suggested above. When you want to script it... here is somewhat of a template (again, I had certain things in mind when I constructed this... there ARE simpler ways)
Code:
//Records_Array1 is an Array returned from a current Query SELECT statement. It is two-dimensional... rows and columns. It contains what we're changing and then Updating
//This can be much simplified by hardcoding with Names of Columns and the Changed-Value (but you give up some flexibility)
var usethisSQL = "UPDATE " +TableVariable1+ " SET " +Records_Array1[0][currindex ]+ " = "+"'" + Records_Array1[ EDITEDrecord ][currindex +1] + "'"+  " WHERE ( " + ConstraintFIELD + " = '"+ConstraintVALUE+"' );" ;
//note: I sometimes keep my "'" separate and visible so I do not 'lose' them
//=====================================================
Test2( usethisSQL ) ;



In case anyone has gotten lost trying to follow this, the SQLite demonstration .imp has 3 Script Objects included which do the 'behind the scenes' work of using SQLite DB with Opus. The ScriptObject "TextSQLite_1" or similar named script is a convenient place to create "function Test2()" noted above. I would suggest separate ScriptObject to create these Opus functions:
function dbINSERT1(args)
function dbUPDATE1(args) etc.
and build-in your variables there, including SQL Queries as constructed in examples above... make your function calls to "Test2(arg)" from there. There is a lot of power here... since data read from the Database is placed in a volatile Array named "Rows"... which you can make persistent by making Records_Array1 = Rows ; //(or similar named Array variable)
That's what you are operating on in Opus.


added Hint:
-- when you execute a DB UPDATE or INSERT statement from an Opus Pub, you can immediately go over to SQLite Manager ( Alt+TAB to Firefox/sqlite_manager) and HIT the REFRESH button.... you will see your changes to the Database in the "Browse & Search" Tab in SQLite Manager.


Good cheer.
Lar

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Last edited by Lar_123 on January 30th, 2009, 9:03 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: January 30th, 2009, 2:58 pm 
Offline

Joined: March 4th, 2007, 7:17 pm
Posts: 132
Lar_123, many thanks. Already study.

_________________
Opus Pro 5.5
Win XP


For this message Volgar has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 25 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group