Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 9th May 2017, 12:40
schreddermaus schreddermaus is offline
Member
 
Join Date: Mar 2008
Location: Mannheim
Posts: 42
schreddermaus is on a distinguished road
Baan: SSA ERP LN - DB: Oracle - OS: Unix
Create text in multiple languages by script
Baan: ERP LN 6.1 FP10 (Infor ERP 10.4)
C/S: None/Unknown

Hi,

how can I create a text in LN in different languages? I'm reading a XML file with textlines per language, concat the text lines per language and now I have to save the text in LN.

tlbct.dll1000.xmlimage.convert.xml.to.text.for.language() does'nt work for me because I have to concat multiple nodes to get all textlines and this function only reads one node and writes the text.

text.buf.to.field() seems not to let me choose a specific language for the text or to create one textnumber for 2 languages.

Any idea how to solve this problem?
Reply With Quote
Sponsored Links
  #2  
Old 9th May 2017, 14:07
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 445
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
First of all, please concatenate all your different nodes into one string buffer and then copy it to a text field using

Code:
Syntax:
function boolean  text.buf.to.field  (string text_field, string buf)

Description

This function stores the text of a buffer in the specified multiline text formfield. This is only relevant for multiline text formfields in a non-maintable session. An additional 'display' of this field is needed to see the changes on the form. 


Arguments
string text_field The name of the multiline text formfield that must be retrieved. See Text fields overview. 
 
string buf This specifies the buffer to be set in the multiline text formfield. 
 
 
Return values
true        text field changed.

false        field is not a multiline text formfield.

Context
This function is implemented in the 4GL Engine and can be used in all script types.

And after that copy the text field into another language using

Code:
text.copy.language.shared()
Syntax:
function long  text.copy.language.shared  (string text_field, string lang_from, string lang_to)

Description

This copies a specified text from one language to another. This function takes table sharing into account. 


Arguments
string text_field The name of the text field which must be copied. See Text fields overview. If the specified text does not exist, nothing happens and the function returns 0. 
 
string lang_from This specifies the language from which the text must be copied. 
 
string lang_to This specifies the language to which the text must be copied. 
 
 
Return values
>0        success; returns the number of lines copied

0        error; text not found for source language

-1        error; switch to the company that stores the texts failed

Context
This function is implemented in the 4GL Tools and can be used in all script types. This function is available from TIV level 1920.
Reply With Quote
  #3  
Old 9th May 2017, 14:19
schreddermaus schreddermaus is offline
Member
 
Join Date: Mar 2008
Location: Mannheim
Posts: 42
schreddermaus is on a distinguished road
Baan: SSA ERP LN - DB: Oracle - OS: Unix
But if I use text.copy.language.shared() I just copy an existing text to another language. I cannot set my own translated text to this language. (My XML file contains all translated texts)

Does text.buf.to.field() also work if I fill table fields with dal.set.field()?
Reply With Quote
  #4  
Old 9th May 2017, 17:08
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 445
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
WHat about

Suppose there are three languages 2,3 and 4

Step1)
Store the buffer with Description of 4thlanguage, then store in your text field, (That means it will be stored in the default language of the user, lets assume it is Language 2, then copy the text into 4th language using, text.copy.language.shared()


Step2) Repeat the same for 3rd language

Step3) Finally take the description of 2nd language and store in the buffer and transfer it from the buffer to the text field.


I dont think dal.set.field will work.. Text operations are treated seperately in Baan
Reply With Quote
  #5  
Old 9th May 2017, 17:30
schreddermaus schreddermaus is offline
Member
 
Join Date: Mar 2008
Location: Mannheim
Posts: 42
schreddermaus is on a distinguished road
Baan: SSA ERP LN - DB: Oracle - OS: Unix
Will this override the existing text or will this create a new textnumber for each language?

I do this operation in a DLL and use dal.set.field to fill the other table fields. Do I have to select ... From ... Selectdo to pick the dataset I want to set the textfield? Or is text.buf.to.field not working in DLLs?
Reply With Quote
  #6  
Old 10th May 2017, 20:59
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 445
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
Okkk..Using text.buf.to.field would not work because that refers to a Multiline text Form field so its not really applicable to this case.

You could try the below command, text.write

Code:
Syntax:
function long  text.write  (string text_field, string lang, string kw1, string kw2, string kw3, string kw4, string tgroup, string edit_opt, string tmp_file [, long bidi] [, string rtf_file])

Description

This adds a new text to the text manager and assigns a new text number to the text. 


Arguments
string text_field The name of the new text field. See Text fields overview. This returns the text number for the new field. 
 
string lang This specifies the language for the new text.
 
string kw1 Use these arguments to specify key words for the text. 
 
string kw2  
string kw3  
string kw4  
string tgroup This specifies the name of the text group to which the text must be assigned. If you specify an empty string here, the text is assigned to the user's default group. 
 
string edit_opt This specifies the type of window in which the text must be displayed. 
 
string tmp_file The name of the file where the text for the new field is stored. The contents of this file is changed before the text is stored, Long lines are wrapped to meet the line width of the text group to which the text is assigned. 
 
[long bidi]  Use this optional argument to indicate the text alignment. Possible values are: 

true      text is right justified

false    text is left justified; this is the default option
 
[string rtf_file]  The name of the file in which the RTF version of the text must be stored. This is an optional argument. The usage of this argument depends on the settings of the text group as defined in the tgroup argument. If this is an empty string, no text is retrieved and the function returns 0. 
 
 
Return values
>0        success; returns the number of lines written

<0        error
Here you can mention the language specifically as well.. The Only challenge is that you need to create a file with the contents of the different language. Otherwise it looks pretty straightforward..
Reply With Quote
  #7  
Old 11th May 2017, 14:30
schreddermaus schreddermaus is offline
Member
 
Join Date: Mar 2008
Location: Mannheim
Posts: 42
schreddermaus is on a distinguished road
Baan: SSA ERP LN - DB: Oracle - OS: Unix
ok, I'll try this
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text problem (writing to text tables from custom session) Linda Nemitz Blogs and Web links 0 20th February 2009 15:55
Report Printing in Multiple languages baan_player Tools Development 8 22nd June 2008 13:12
how to get multiple text line? marcelo Tools Development 2 24th November 2003 14:27
Text Copying with other languages draeger Tools Administration & Installation 2 7th April 2003 14:25


All times are GMT +2. The time now is 20:41.


©2001-2017 - Baanboard.com - Baanforums.com