VectorLinux
April 20, 2014, 04:02:08 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: [almost-SOLVED] gambas internationalization  (Read 1884 times)
Triarius Fidelis
Vecteloper
Vectorian
****
Posts: 2399


Domine, exaudi vocem meam


WWW
« on: July 03, 2007, 07:53:58 am »

Well, as Gambas becomes more and more important to VL I figured it's in my best interest to take out the time to learn it. I have to say I like the facilities a lot, even though the object model is kind of iffy compared to Python and BASIC is an unpleasant reminder of my early youth.

Anyway, I wrote a sample application with a translated label. I was impressed to see that issuing an executable packaged the translation into the binary! But something seemed amiss. Because the widgets in my form are manually arranged (the automatic formatters seemed not to do what I needed), they wouldn't resize at run time.

That's a problem because the way some languages explain things varies in length from English, especially wrt technical topics. Look at some of the .desktop files in /usr/share/applications to see what I mean. To experiment, I typed 'Här är Gambasmaskoten osv. osv. osv. osv. osv. osv.' to make a translated string arbitrarily long and ran it with LANG=sv_SE. To my dismay, the string filled up the label and then some, clipping most of the text.

And that's a disaster in case I ever learn Finnish. Smiley

For those more experienced with Basic and Gambas, what should I do? (*cough*, Joe1962)
« Last Edit: July 06, 2007, 04:45:13 pm by hanumizzle » Logged

"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months
Joe1962
Administrator
Vectorian
*****
Posts: 2498



WWW
« Reply #1 on: July 03, 2007, 03:28:01 pm »

Auto-resizing is one of the biggest PITAs of UI programming. On a project, I try to come to an agreement among the devs and set a max limit for the caption length of certain controls, then stick to that max for each language. This usually requires some tweaking later on, when you find it impossible to condense it within the limit in a certain language. Gambas 2 sort of complicated things somewhat when it started to set the control sizes in different screen resolutions according to the font size ratio. This is optional in the latest releases and now you can again get pixel-perfect designs that survive resolution changes. Something that might also help is this:

http://www.gambasdoc.org/help/comp/gb.qt/font/width

Logged

O'Neill (RE the Asgard): "Usually they ask nicely before they ignore us and do what they damn well please."
http://joe1962.bigbox.info
Running: VL 7 Std 64 + self-cooked XFCE-4.10
Triarius Fidelis
Vecteloper
Vectorian
****
Posts: 2399


Domine, exaudi vocem meam


WWW
« Reply #2 on: July 04, 2007, 04:09:07 pm »

I hope Gambas 2 plans some kind of layout engine. I remember when I used Qt Designer to create the forms for my Swedish program, I arranged usable widgets and abstract 'spacer' widgets, then selected them in order to make vertical and horizontal arrangements. When I coded the backend for the application and ran it, I didn't need to worry about the size of text or even resizing windows, as I knew everything would remain in some degree of proportion.
Logged

"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months
Triarius Fidelis
Vecteloper
Vectorian
****
Posts: 2399


Domine, exaudi vocem meam


WWW
« Reply #3 on: July 06, 2007, 04:44:54 pm »

Oh, duh. V and HBoxes will do...

They're kind of clumsy to design with, but I can't think of anything better atm.
Logged

"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!