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: 744
Joined: Thu Sep 11, 2014 1:49 pm

Can I acces statements in LC executables?

Post by mrcoollion »

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: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Can I acces statements in LC executables?

Post by richmond62 »

C'est pas un problem.
-
Lingo.png
-
Lingo.livecode.zip
Here's the stack.
(30.3 KiB) Downloaded 311 times
-
Think about this sort of thing:
on openStack
set the title of stack "myStack" to "Fromage Frais"
end openStack
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

Re: Can I acces statements in LC executables?

Post by mrcoollion »

Merci richmond62

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

Thank you richmond62

Regards,

Paul
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can I acces statements in LC executables?

Post by Klaus »

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: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Can I acces statements in LC executables?

Post by richmond62 »

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: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Can I acces statements in LC executables?

Post by richmond62 »

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: 744
Joined: Thu Sep 11, 2014 1:49 pm

Re: Can I acces statements in LC executables?

Post by mrcoollion »

Thanks for the example richmond62.
Post Reply