Language Support

Post your requests and ideas on the future development of Visual TFT Software.
Post Reply
Author
Message
Findus
Posts: 87
Joined: 05 Oct 2012 15:28

Language Support

#1 Post by Findus » 17 Aug 2016 16:07

Hi,

it is not easy to install language support in our program. The text assignment for every object looks like this

Code: Select all

CheckBox4_Caption          := 'Background';

and this lines are spread over the source code. With some little changes, it get easy to create language support.

first define const strings in the same area

Code: Select all

const
   cL0_CheckBox2_Caption          = 'Color';
   cL0_CheckBox4_Caption          = 'Background';
   .
   .
   .
then create a function to set all text

Code: Select all

procedure SetLanguage0()
   strncpy(CheckBox2_Caption, cL0_CheckBox2_Caption, SizeOf(CheckBox2_Caption));
   strncpy(CheckBox4_Caption, cL0_CheckBox4_Caption, SizeOf(cL0_CheckBox4_Caption));
   .
   .
   .
And call this function in

Code: Select all

procedure InitObjects();
begin
   .
   .
   .
   SetLanguage0();
end;
And now create other language tables 0,1,2,...

Code: Select all

const
   cL1_CheckBox2_Caption          = 'Farbe';
   cL1_CheckBox4_Caption          = 'Hintergrund';
   .
   .
   .
and the a SetLanguage function

Code: Select all

procedure SetLanguage1()
   strncpy(CheckBox2_Caption, cL1_CheckBox2_Caption, SizeOf(CheckBox2_Caption));
   strncpy(CheckBox4_Caption, cL1_CheckBox4_Caption, SizeOf(CheckBox4_Caption));
   .
   .
   .
now we can switch between both language with SetLanguage0() and SetLanguage1()

and with a more robust function

Code: Select all

const
   MaxLanguageNo = 2;
var
   LanguageNo: byte;

procedure SetLanguage(ALanguageNo: byte);
begin
   if ALanguageNo<0 then begin
      ALanguageNo:=0;
   end;
   if ALanguageNo>=MaxLanguageNo then begin
      ALanguageNo:=MaxLanguageNo-1;
   end;
   if LanguageNo<>ALanguageNo then begin
      LanguageNo:=ALanguageNo;
      case LanguageNo of
         0: SetLanguage0();
         1: SetLanguage1();
          .
          .
          .
      end;
   end;
end;
You can change the language with one Click

Code: Select all

procedure EveButton1OnClick();
begin
   SetLanguage(LanguageNo-1);
   DrawScreen(@Screen1);
end;

procedure EveButton2OnClick();
begin
   SetLanguage(LanguageNo+1);
   DrawScreen(@Screen1);
end;

So, in Visual TFT there must be only rearrange some "generate code" lines and a MaxLanguageNo to generate the language string tables and the SetLanguageX function. A Member in the IDE like "Max Length" with the name "LanguageSupport YES/NO" can filter the text witch are not to translate.

Best regards
Thomas

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Language Support

#2 Post by lana.arsic » 19 Aug 2016 08:47

Hi Thomas,

I'm sorry, I have read carefully what you have written,
but I'm not sure if I understand you well.

Do you want to change whole interface according to language
which user can choose with one click? Can you please describe me more the issue?

Best regards,
Lana

Findus
Posts: 87
Joined: 05 Oct 2012 15:28

Re: Language Support

#3 Post by Findus » 19 Aug 2016 10:37

Hi Lana,

See the result in this video
http://bornhaupt.de/tmp/VID_20160819_111252.mp4

regards
Thomas

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Language Support

#4 Post by lana.arsic » 19 Aug 2016 17:07

Hello Thomas,

Your idea is very interesting and thank you for posting it here.

But that option, is tied for one project, and it won't be of use for general purposes,
so unfortunately it would not be added in Visual TFT like an option.

Thank you for understanding.

Best regards,
Lana

Findus
Posts: 87
Joined: 05 Oct 2012 15:28

Re: Language Support

#5 Post by Findus » 22 Aug 2016 07:32

Hi Lana,

we are living in Europa and if your application could not the language English, German, French, Spain then you can stop the development.

best regards
Thomas

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Language Support

#6 Post by lana.arsic » 22 Aug 2016 17:03

Hi Thomas,

I'm sorry for misunderstanding.

At this moment Unicode is not supported in VisualTFT,
but you may find this application useful:

http://libstock.mikroe.com/projects/vie ... -generator

Best regards,
Lana

Findus
Posts: 87
Joined: 05 Oct 2012 15:28

Re: Language Support

#7 Post by Findus » 23 Aug 2016 08:07

Hi Lana,

I does not talk about unicode. I talk about own necessary mapping of the character. FT800 can only 1..127 characters. The character 1..31 are normally not used, so you can map any character to this area. So you can use near all necessary special character for Europas languages.

regards
Thomas

Findus
Posts: 87
Joined: 05 Oct 2012 15:28

Re: Language Support

#8 Post by Findus » 23 Aug 2016 08:13

lana.arsic wrote: but you may find this application useful:

http://libstock.mikroe.com/projects/vie ... -generator
This generator does not character mapping. I wrote my own generator derivat from a 20 years old program for Turbopascal Fonts. ;-)

Have ever open the fonts, I send, and take a look inside?

regards
Thomas

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Language Support

#9 Post by lana.arsic » 23 Aug 2016 15:14

Hi Thomas,

Yes, I have looked into your fonts, I have answered you here:

http://forum.mikroe.com/viewtopic.php?f=162&t=68331

You can try to create your font with some application
and you can save it with different name and then import it into Windows.

Best regards,
Lana

Findus
Posts: 87
Joined: 05 Oct 2012 15:28

Re: Language Support

#10 Post by Findus » 23 Aug 2016 15:36

Hi Lana,

I think you have not understood my wish. It has nothing to do with unicode or windows. It has only do with changing the code generation of VTFT.

regards
Thomas

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Language Support

#11 Post by lana.arsic » 24 Aug 2016 16:03

Hi Thomas,

Can you please clarify me more what is your wish?
Then I could forward it to our developers for consideration.

Best regards,
Lana

Findus
Posts: 87
Joined: 05 Oct 2012 15:28

Re: Language Support

#12 Post by Findus » 25 Aug 2016 08:20

Hi Lana,

I give you all information in the first article of this thread and http://forum.mikroe.com/viewtopic.php?p=274164#p274164. A VTFT programmer would understand it directly.

best regards
Thomas

Post Reply

Return to “Visual TFT Wish List”