different languages

11 views
Skip to first unread message

Ramon

unread,
Apr 25, 2008, 4:00:01 AM4/25/08
to sysq...@googlegroups.com
Hi,

I have been trying to use  "beginlanguage" and "endlanguage" to design a sysquake application in different languages.
I have the following doubt :

How do I detect the current language in the function space ?  
For example :
            beginlanguage "cat"
                    figure "Senyal 1"
                    draw drawY_s1(ts,signal_1,mostra,mostra_on_off)
                    mousedrag (signal_1,_msg,_cursor)= dragY(ts,signal_1,_id,_x0,_y1)
                    mouseover (_msg,_cursor) = overY (_id,ts,signal_1,_x0)
           endlanguage
            beginlanguage "cast"
                figure "Senal 1"
                    draw drawY_s1(ts,signal_1,mostra,mostra_on_off)
                    mousedrag (signal_1,_msg,_cursor)= dragY(ts,signal_1,_id,_x0,_y1)
                    mouseover (_msg,_cursor) = overY (_id,ts,signal_1,_x0)
            endlanguage


Latter I need to know which is the figure name to write :
                 subplots('Senyal 1\tSenyal 2\nSenyal de Convolucio');
The figure name are different in different languages, so I need to detect the language and use the correct name.  I have tried to do something like :
                 beginlanguage "cat"
                        subplots('Senyal 1\tSenyal 2\nSenyal de Convolucio')
                endlanguage
                beginlanguage "cast"
                      subplots('Senal 1\tSenal 2\nSenal Convolucion');
                endlanguage

But it does not work.


Detecting the language is also important for text included in the figures and dialog boxes.

I'm I doing something wrong ? How can I address this problem ?



How can I use special caracters (ñ,ó,ç´,ì ....) in figure names ?



Best wishes,
Ramon

Yves Piguet

unread,
Apr 25, 2008, 4:38:27 AM4/25/08
to Sysquake
Hi,

> I have been trying to use  "beginlanguage" and "endlanguage" to design a sysquake application in different languages.
> I have the following doubt :
> How do I detect the current language in the function space ?  

It isn't possible (now). Everything that depends on the language
should be separated at the declaration level. For a subplots command
at init time, you should put different init handler declarations
between beginlanguage and endlanguage. Sysquake will call all init
handlers relevant to the current language and language-neutral, so
typically you can have language-specific init handlers which call
subplots, and language-independent init handlers outside any
beginlanguage/endlanguage.

> Detecting the language is also important for text included in the figures and dialog boxes.

Currently, the only way to do it is to call different functions or
with different arguments.

> How can I use special caracters (ñ,ó,ç´,ì ....) in figure names ?

It should work... Please make sure that Sysquake recognizes correctly
the character set used to encode .sq and .lml files, by adding the
following line at the top of the file:

// charset=charsetname

where "charsetname" is iso-latin-1 for western European languages
encoded as 8-bit characters on Windows and Linux, on Mac OS, and utf-8
for Unicode UTF-8 encoding everywhere. The latter is recommended; most
modern text editors should support it. Please see section "Character
Set" of Sysquake's documentation for more details.

Hope this helps,

Yves

Ramon

unread,
Apr 28, 2008, 5:21:05 AM4/28/08
to sysq...@googlegroups.com
Yves Piguet wrote:
Hi,

  
I have been trying to use  "beginlanguage" and "endlanguage" to design a sysquake application in different languages.
I have the following doubt :
How do I detect the current language in the function space ?  
    
It isn't possible (now). Everything that depends on the language
should be separated at the declaration level. For a subplots command
at init time, you should put different init handler declarations
between beginlanguage and endlanguage. Sysquake will call all init
handlers relevant to the current language and language-neutral, so
typically you can have language-specific init handlers which call
subplots, and language-independent init handlers outside any
beginlanguage/endlanguage.

  
Detecting the language is also important for text included in the figures and dialog boxes.
    
Currently, the only way to do it is to call different functions or
with different arguments.

  
Ok. I will use this approach in my application.
Unfortunatelly this way of handling the languages implies rewriting lots of  code (introducing dummy functions ...) so the final application is difficult to debug and maintain.

In my opinion it would be of great interest if a global variable (or a similar statement) exists which determines the language and can be used in functions (of course other approaches are possible).


Best wishes,
Ramon



Yves Piguet

unread,
Apr 30, 2008, 3:28:09 AM4/30/08
to Sysquake
On Apr 28, 11:21 am, Ramon <ramoncostacaste...@gmail.com> wrote:
> Unfortunatelly this way of handling the languages implies rewriting lots of  code (introducing dummy functions ...) so the final application is difficult to debug and maintain.
> In my opinion it would be of great interest if a global variable (or a similar statement) exists which determines the language and can be used in functions (of course other approaches are possible).

In that case, if you can, please wait for the next version. You can
contact Calerga if you want an early beta version.

Best regards,

Yves

Reply all
Reply to author
Forward
0 new messages