VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: [almost-SOLVED] gambas internationalization  (Read 2284 times)

Triarius Fidelis

  • Vecteloper
  • Vectorian
  • ****
  • Posts: 2399
  • Domine, exaudi vocem meam
    • my website
[almost-SOLVED] gambas internationalization
« on: July 03, 2007, 08: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. :)

For those more experienced with Basic and Gambas, what should I do? (*cough*, Joe1962)
« Last Edit: July 06, 2007, 05: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: 2499
    • Joe1962's Website
Re: gambas internationalization
« Reply #1 on: July 03, 2007, 04: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
    • my website
Re: gambas internationalization
« Reply #2 on: July 04, 2007, 05: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
    • my website
Re: gambas internationalization
« Reply #3 on: July 06, 2007, 05: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