Can I acces statements in LC executables?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mrcoollion
Posts: 709
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Can I acces statements in LC executables?

Post by mrcoollion » Fri Jun 29, 2018 8:50 am

I am working on a translation application that enables me to change the language of an application build in LC.
I am wondering if the following would work in a LC executable?

1 - Change Stack Title
2 - Change labels of buttons DataGrid columns Widgets and so on.
3 - Let say I have a statement 'put "the to translate text" into tMSG ' Is it possible to go through the (compiled) executable with code that is part of this executable (e.g. sub stack) and change the text into the translated text? So it becomes 'put "the translated text" into tMSG' for as long as the executable is running of course.

Or is there a better way to do this?

Regards,

Paul

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Can I acces statements in LC executables?

Post by richmond62 » Fri Jun 29, 2018 9:18 am

C'est pas un problem.
-
Lingo.png
-
Lingo.livecode.zip
Here's the stack.
(30.3 KiB) Downloaded 174 times
-
Think about this sort of thing:
on openStack
set the title of stack "myStack" to "Fromage Frais"
end openStack

mrcoollion
Posts: 709
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: Can I acces statements in LC executables?

Post by mrcoollion » Fri Jun 29, 2018 9:30 am

Merci richmond62

This is as far as my French language skills can be stretched :wink:

Thank you richmond62

Regards,

Paul

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Can I acces statements in LC executables?

Post by Klaus » Fri Jun 29, 2018 9:40 am

Hi Paul,
3 - Let say I have a statement 'put "the to translate text" into tMSG ' Is it possible to go through the (compiled) executable with code that is part of this executable (e.g. sub stack) and change the text into the translated text? So it becomes 'put "the translated text" into tMSG' for as long as the executable is running of course.
this is also doable but you need to put -> the to tranlate text
into a field, custom property or variable and change that according to the selected language.

Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Can I acces statements in LC executables?

Post by richmond62 » Fri Jun 29, 2018 9:44 am

Your French language skills don't really need stretching until
you find yourself in a Francophone country or stuck in an elevator
with a load of French-language chauvinists!

What you DO NEED TO REMEMBER is that each object has a
LABEL/TITLE as well as a NAME,
so you can mess around with the label
to your heart's content without it throwing
your program into the left field.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Can I acces statements in LC executables?

Post by richmond62 » Fri Jun 29, 2018 9:50 am

Here's another thought:
on openStack
put "I'm a little teapot, short and stout." into ENG
put "Аз съм един нисък и дебел чайник." into BG
answer "Language ?" with "BG" or "ENG"
if it is "ENG" then
put ENG into field "NONSENSE"
else
put BG into field "NONSENSE"
end if
end openStack

mrcoollion
Posts: 709
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: Can I acces statements in LC executables?

Post by mrcoollion » Wed Jul 04, 2018 3:57 pm

Thanks for the example richmond62.

Post Reply

Return to “Talking LiveCode”