Translations in open9x

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Translations in open9x

Post by bertrand35 »

Hi,

It's now possible to add your own translations to open9x. Here is the way to do it:

1) You download this file:
http://code.google.com/p/open9x/source/ ... tions/en.h

2) You begin translating all the strings "..."
You will find 2 parts in the file:
- the non zero terminated strings at first, define as in this example:
#define LEN_VBEEPER 5
#define TR_VBEEPER "Quiet""NoKey""Norm ""Long ""xLong"
for this kind of strings it's important to keep the same number of chars in all substrings
this length is defined in LEN_VBEEPER, but if you really need, it's possible to increase (a little bit!) this value, careful to the screen which is not so big!
- the zero terminated strings at last as in this example:
#define TR_ELIMITS "E.Limits"
no length to define, the '\0' char at the end of the string is stored in flash for this purpose

3) You post your translations here or you attach it to an issue to the open9x project, I will integrate them and you should be able to retrieve the binary from companion9x in the following version (I plan to add a combo box for the language selection)

----

Not mandatory, but useful, there is a simu (linux only) embedded inside open9x which allows you to "test" your strings. You will need the libfox installed.
- you replace the contents of the file translations/fr.h with your translations
- you execute
make simu TRANSLATIONS=FR
./simu

In the simu you use the arrow keys, Enter and Backspace + 's' for the snapshots you will have these png dumped:
snapshot_06.png
snapshot_06.png (1.5 KiB) Viewed 16042 times
snapshot_12.png
snapshot_12.png (1.43 KiB) Viewed 16042 times

User avatar
dvogonen
Posts: 453
Joined: Tue Jan 31, 2012 9:38 pm
Country: Sweden
Location: Stockholm

Re: Translations in open9x

Post by dvogonen »

Hi,

Since I am planning to start flying helicopters my old flight radio doesn't cut it any more and I have orderd a 9x. One of the things I hate with complex flight radios is that the crampt displays make for use of a lot of abreviations. It is hard enough to understand English flight terms. Understastanding abreviated English flight terms is painful. At least for me, since my native language is Swedish. I would love to have a flight radio with Swedish menues.

Long story short, I looked around yesterday and found that you have made a real effort to make open9x translatable. I have now got a translated Swedsih versino of the ROM running in the simulator (which by the way works great). Would you be interested in the translated files? I have only given them a couple of hours this far, so they are not perfect. Some of the chopper terms are actually new to me, and I have not found good Swedish translations. But I will get there.
In order to translate English into Swedish it is necessary to use the letters å, ä and ö. You really can not replace them with variations of a and o like aa, ae and oe. That would be plain confusing. I have modified the font files and replaced {|} and [\] with åäö and ÅÄÖ, which is the standard way of mapping Swedish characters to single byte ASCII. I have also changed the appearance of the characters ( and ), so that they may be used in stead of [ and ]. The other characters are not used. Although it is perfectly possible to use the resulting font bitmaps for English, I am afraid that every aditional translation will require changes to the font bitmaps. Changes that will probably not fit together in a common file. I believe that it is necessary to use a sepate (or two, since the fonts exist in two sizes) font bitmap for each language. Should be easy enough to set up using the compile time LANGUAGE switch.

When I was at it i threw together a new splash screen, since the original one was kind of plain. I am not sure that mine is any better, but the result is shown below.

Image
Image
Image
Image
Image
Image
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Translations in open9x

Post by bertrand35 »

Nice work!
How many new chars did you introduce?
Right now I am not sure about replacing existing ones, I think I will introduce extra chars for localization to achieve the same result.
In french we could then use the chars éàèêùç and that's interesting!
Bertrand.
User avatar
dvogonen
Posts: 453
Joined: Tue Jan 31, 2012 9:38 pm
Country: Sweden
Location: Stockholm

Re: Translations in open9x

Post by dvogonen »

I have now created separate font bitmap files and attached them to issues in your google code project space.
I understand that you prefer extending the character set instead of using language specific font bitmaps. This is indeed the more ambitious aproach, but it will require quite a bit of work on your side.

I have not looked at the code, but I assume that strings within the hex are represented as single byte characters (everything else would be an unexplicable vaste of space). This means that characters like åäöÅÄÖ and éàèêùç can not be represented. The best way to solve the problem is to use UTF-8 encoding. UTF-8 encoded text displays well in web browsers, which is a big plus.

If characters are represented as Unicode two byte characters, your only problem will be to discover "non standard" characters and retrieve bitmaps from your extended bitmap for these. You will need some kind of cross reference table. Should not be to difficult.
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Translations in open9x

Post by bertrand35 »

You will have to use these chars \200 .. \205 for these 6 new chars.
Some more work, that's true, but worth the case.
It works in my workspace, I will commit tomorrow with some other features. More on that later...
Bertrand.

bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Translations in open9x

Post by bertrand35 »

Today a lot of emails. Including commit logs for Italian translations from Romolo's team and Czech translations. It means that today we have:
- french
- swedish
- italian
- czech
snapshot_03.png
snapshot_03.png (1.32 KiB) Viewed 15690 times
snapshot_04.png
snapshot_04.png (1.88 KiB) Viewed 15690 times
I do like the idea used for the "Delta Zvuku" parameter. If some graphic designers have a look to it, I would be happy to have a "non text" version of that! (at least for the ersky9x board)

Bertrand.
User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

Translations in open9x

Post by cre8tiveleo »

Are you looking for a slider type incramental thing?




---
I am here: http://tapatalk.com/map.php?gl3vpa
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Translations in open9x

Post by bertrand35 »

Yes, why not? At least for ersky9x board I would see it for Brightness / Sound volume / Haptic length / Audio length / Antenna length / ...
Bertrand.
User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

Translations in open9x

Post by cre8tiveleo »

I'll send you something later today, i'm at work.

I've always thought it should be sliders, looks cooler.

:)


---
I am here: http://tapatalk.com/map.php?gg2nvc
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Translations in open9x

Post by bertrand35 »

<nagging>days are looong in ontario ;) </nagging>
Bertrand.
User avatar
dvogonen
Posts: 453
Joined: Tue Jan 31, 2012 9:38 pm
Country: Sweden
Location: Stockholm

Re: Translations in open9x

Post by dvogonen »

Are you looking for something like this:
Image
Or this:

Image
User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

Re: Translations in open9x

Post by cre8tiveleo »

I like those, but I always liked a pop up window, makes the option have a finer feel. Something like...

Image

Image
User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

Re: Translations in open9x

Post by cre8tiveleo »

and error message pages..

Image
Image
Image
Image
Image
Image

Just something a little different.. I am going out to fly now, it's beautiful weather today!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Translations in open9x

Post by jhsa »

lucky you.. ;) raining here.. :(
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Translations in open9x

Post by bertrand35 »

Excellent, thanks you both, I will see what I can do with it!
Bertrand.
gbirkus
Posts: 97
Joined: Sat Jan 07, 2012 4:15 pm
Country: -

Re: Translations in open9x

Post by gbirkus »

"0----""=0---""==0--""===0-""====0"

")----"":)---""=:)--""==:)-""===:)" but then we must do a wiki explanation.
User avatar
dvogonen
Posts: 453
Joined: Tue Jan 31, 2012 9:38 pm
Country: Sweden
Location: Stockholm

Re: Translations in open9x

Post by dvogonen »

I really like the idea of a graphical slider presentation. It would be possible to acomplish a semi-graphical slider in the standard firmware, without sacrificing any space at all. To do this one would redefine an unused character as slider character and use minus signs to indicate the length of the slider. The result could look like this:
Image
or
Image
Looking at the character map, the most obvious character for replacement is the dollar sign, which I have not seen used anywhere.

If another character was redefined as a longer minus sign the result could be as nice as this:
Image
Romolo
9x Developer
Posts: 1109
Joined: Sat Dec 31, 2011 12:11 am
Country: -
Location: Massa (MS), Tuscany, Italy

Re: Translations in open9x

Post by Romolo »

another possible one is to close the # on top and bottom using = for the remaining part of the bar
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Translations in open9x

Post by bertrand35 »

I have chosen to spare some flash - exactly 28bytes - to have this result:
snapshot_02.png
snapshot_02.png (1.76 KiB) Viewed 15474 times
snapshot_03.png
snapshot_03.png (1.75 KiB) Viewed 15474 times
Bertrand.
User avatar
MikeB
9x Developer
Posts: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Translations in open9x

Post by MikeB »

Is that a graphic, or text characters? I wondered if the graphic for the trim positions could be re-used.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Translations in open9x

Post by bertrand35 »

The horizontal line is graphics and the square is the $ char. You cannot have a line without any holes using only the chars.
And yes the trim could be reused, but I prefer the slider ...
Bertrand.
martinJhenne
Posts: 7
Joined: Sun May 13, 2012 6:48 pm
Country: -

German Translation (Start ...)

Post by martinJhenne »

Hi Folks,

i just started a german translation. Not everything can be translated due to space limitations. But i think it is a good beginning.

The files are attached.
Attachments
font.zip
(650 Bytes) Downloaded 153 times
de.h
(12.85 KiB) Downloaded 168 times
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Translations in open9x

Post by bertrand35 »

Thanks! Too late for this release, it will be in the next one ...
Bertrand.
martinJhenne
Posts: 7
Joined: Sun May 13, 2012 6:48 pm
Country: -

German Translation (Start ...) Bugs

Post by martinJhenne »

I renamed the Switches for private purposes. By mistake i posted this file. Sorry.
Fixed this mistake and optimized a little - I also rearranged the german fontgraphics. Small and caps are grouped together.

I just have trouble generating the .lbm files with Windows 7. These packages are installed:
  • PyQt-Py3.2-x86-gpl-4.9.1-1
  • python-3.2.3
  • rubyinstaller-1.9.3-p194
Error is:

Code: Select all

    f = file(sys.argv[2], "w")
NameError: name 'file' is not defined
So someone else has to create them. Sorry.
Attachments
fonts.zip
Updated 2012-05-17
(705 Bytes) Downloaded 137 times
de.h
Updated 2012-05-17
(12.85 KiB) Downloaded 164 times
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Translations in open9x

Post by bertrand35 »

Ruby is not needed for open9x. I am more used to Python, that's the reason.
But I never tried the Python v3.x versions, would you try with version 2.7?
Could you send me a PM with your google mail, I will add you as a commiter as the other translations contributors.
Bertrand.
martinJhenne
Posts: 7
Joined: Sun May 13, 2012 6:48 pm
Country: -

Re: Translations in open9x

Post by martinJhenne »

With Python 2.7 it worked :-)
User avatar
dvogonen
Posts: 453
Joined: Tue Jan 31, 2012 9:38 pm
Country: Sweden
Location: Stockholm

Sv: Translations in open9x

Post by dvogonen »

You can install Gimp on Windows 7 and edit both xbm and lbm files.
I am not a huge fan of Gimp, but it gets the job done and is open source, so I use it from time to time.
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Translations in open9x

Post by bertrand35 »

Only the xbm files are editable under gimp, the lbm are open9x only (not compatible with er9x).
Bertrand.
User avatar
AlexCalibur
Posts: 18
Joined: Thu May 17, 2012 1:37 pm
Country: -
Location: France, @Clermont-Ferrand in the center or @Annecy, near Switzerland

Re: Translations in open9x

Post by AlexCalibur »

I'm actually try to working on French translation, but I don't find the way out to convert xbm to lbm.

There is a util/img2lbm.py script, but it doesn't seems to give me the expected result...

or maybe, my xbm file (font_fr.xbm), producted with The GIMP, is not correct.

Can you confirm if the following should work ...?
$ python img2lbm.py font_fr.xbm font_fr.lbm

The script fail on line 9 "f = file(sys.argv[2], "w")" with the following error :
IndexError: list index out of range

I've tried to install python-pyside-qtgui
I've tried with the font_de.xbm from svn without succes...

After more source code reading, it seems to have size parameters in img2lbm
After many try, no result

>>> What is the img2lbm usage/syntax ??? <<< (maybe it can be usefull to add it in comment inside the script :D...)

Is someone can give me more precise instructions for font_XX.xbm generating and lbm conversion ? (Is it the same for boot spalsh screen ?)

I'm interrested too by the ttf file for the 'generic font' (maybe UTF-8 font....?)
GNU/Linux user since 2005
Debian (testing) and ubuntu (12.04), some Linux Mint on netbook.
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Translations in open9x

Post by bertrand35 »

Here is the syntax:

python ../util/img2lbm.py ./font_6x1.xbm /tmp/test.lbm char

and

python ../util/translate.py ./translations/fr.h fr
python ../util/translate.py ./translations/fr.h.fr fr

Bertrand.

Post Reply

Return to “openTx”