The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 [solved] Translation of Texts in GetNBox dialogs
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hofmaale

20 Posts

Posted - 10/26/2016 :  02:29:02 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2015G Sr1
Operating System: Win 7

Hi there,

I have another question to which, I hope, you might have the answer.

I have some OriginC-Scrips that show dialogs to the User when called, created using the GetNBox.h based dialog-functions.
This works quite well. Since I accidentally installed the German version of Origin (I normally use the "original" one), some of the texts i.e. in a ComboBox are translated. This is OK in some cases ("Frequency" e.g. becomes "Frequenz", which is correct), "funny" in others: (electrical) "ćurrent" translates to "Strom" in German, not "Aktuell" - which means "currently" or "up to date".

Is there an option I can pass to the GetNBox to suppress automatic translation? I guess it's done using a standard lookup-type translation table as it's done for the whole Program, but the context is different for my dialog...

Thank you in advance,
Alex

Edited by - hofmaale on 10/28/2016 07:37:50 AM

yuki_wu

896 Posts

Posted - 10/26/2016 :  04:49:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Alex,

Generally speaking, the string will not be translated if you wrote the code by yourself. Only the strings of system function will be translated automatically. I am not sure whether you call some of system functions in your code.

Would you mind posting your code here for further identifying the problem, for example, the piece of code about that ComboBox?

Thanks,
Yuki
OriginLab

Edited by - yuki_wu on 10/26/2016 04:55:50 AM
Go to Top of Page

hofmaale

20 Posts

Posted - 10/27/2016 :  05:09:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Yuki.

Well, I wouldn't mind posting my code, but it's a few hundreds of lines. But I wrote a short "minimal example" which perfectly illustrates the problem:


#include <Origin.h>
#include <GetNbox.h>

void TestUI()
{
	string entries="Frequency|Current|Voltage";
	GETN_BOX(uiBox);
		GETN_LIST(get_Combo, "ComboBox", 1, entries);
		GETN_STR(info_Text1, "(Select an Item)", "hidden"); GETN_HINT_EX(FALSE, FALSE);
		
	if (GetNBox(uiBox))
	{
		out_tree(uiBox);
	}
	else
	{
		printf("Abborted.\n");
		return;
	}
}


The resulting Dialog-Box looks like this:


As you see, the items in the ComboBox are translated. Am I calling the wrong function to display the Dialog?

Thanks in advance,
Alex
Go to Top of Page

folger

China
6 Posts

Posted - 10/27/2016 :  10:27:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Alex,

Origin will try to localize entry strings for GETN_COMBO and GETN_LIST type. You need to explicitly specify option not to do localization for them, as show in following code:

#include <Origin.h>
#include <GetNbox.h>
void TestUI()
{
	string entries="Frequency|Current|Voltage";
	GETN_BOX(uiBox);
	GETN_LIST(get_Combo, "ComboBox", 1, entries);
	octree_modify_attribute(&GETN_CURRENT_SUBNODE, STR_OCNTRL_OPTNS, OCNTRLPARAM1_NOT_LOCALIZED, 0);
	GETN_STR(info_Text1, "(Select an Item)", "hidden"); GETN_HINT_EX(FALSE, FALSE);
		
	if (GetNBox(uiBox))
	{
		out_tree(uiBox);
	}
	else
	{
		printf("Abborted.\n");
		return;
	}
}


Thanks
Folger
Originlab Developer
Go to Top of Page

hofmaale

20 Posts

Posted - 10/28/2016 :  04:19:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much - this of course solved the problem!
Go to Top of Page

VladGets1

Germany
12 Posts

Posted - 11/02/2016 :  04:59:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Its really working
quote:
Originally posted by hofmaale

Thank you very much - this of course solved the problem!

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000