EdgeTX / edgetx

EdgeTX is the cutting edge open source firmware for your R/C radio
https://edgetx.org
GNU General Public License v2.0
1.57k stars 333 forks source link

More bugs with Czech language Radiomaster Zorro 2.8.3 #3526

Closed japanel closed 1 year ago

japanel commented 1 year ago

Is there an existing issue for this problem?

What part of EdgeTX is the focus of this bug?

Transmitter firmware

Current Behavior

Maybe bad translation or bad display of Czech characters with diacritics. First character with diacritics on line missing. Pls see attached pictures. Red text is correct.

Expected Behavior

Right Czech translation, correct displaying characters with diacritics.

Steps To Reproduce

Scroll through the menu with CZ firmware.

Version

Other (Please specify below)

Transmitter

Radiomaster Zorro

Operating System (OS)

No response

OS Version

No response

Anything else?

IMG20230424101254 IMG20230424101337 IMG20230424101350 IMG20230424101426 IMG20230424101503 IMG20230424101544 IMG20230424101638 IMG20230424101652 IMG20230424101727 IMG20230424101744 IMG20230424101853 IMG20230424100928 IMG20230424100946 IMG20230424101042 IMG20230424101111 IMG20230424101122 IMG20230424101136

japanel commented 1 year ago

Hi, I would like to ask, if will be edgetx functional CZ language. Every 2.8 version is bad. It was fine in OpenTx but it is unusable in EdgeTx. Will be it ok in 2.9 or no? Or I must go back to Open? Thank you so much.

mha1 commented 1 year ago

Most likely the special characters are not properly supported in EdgeTX

@3djc this seems to be very similar to the problem you addressed in #3827 for FR

gagarinlg commented 1 year ago

There is a function to map UTF to EdgeTX charset. This has to be extended for the not working characters.

gagarinlg commented 1 year ago

https://github.com/EdgeTX/edgetx/blob/main/radio/src/gui/common/stdlcd/utf8.cpp

Sind the upper case characters seem to be missing, a mapping of the upper case UTF code point to the lower case character from EdgeTX has to be added

japanel commented 1 year ago

https://github.com/EdgeTX/edgetx/blob/main/radio/src/gui/common/stdlcd/utf8.cpp

Sind the upper case characters seem to be missing, a mapping of the upper case UTF code point to the lower case character from EdgeTX has to be added

In some cases lower case characters are bad too. Maybe extra problem with "ž". IMG_20230719_173229

3djc commented 1 year ago

https://github.com/EdgeTX/edgetx/blob/main/radio/src/gui/common/stdlcd/utf8.cpp

Sind the upper case characters seem to be missing, a mapping of the upper case UTF code point to the lower case character from EdgeTX has to be added

At least for the French issue, that is not the right solution, it needs to map the missing character to its 'parent' non accented upper case

mha1 commented 1 year ago

I don't know the Czech language at all but just looked at one of your examples above. The text displayed for Radio Setup is defined as #define TR_RADIO_SETUP "NASTAVENÍ RÁDIA"

The extended ASCII code (like Windows 1250) knows the letter "Í" (Latin capital letter I with acute) but the Czech _utf8_lut doesn't define "'Í ", it only defines "í" (Latin small letter I with acute). Same for the letter "Á".

I think Czech language requires the same exercise @3djc went through for the French language. Change all capital letters with diacritics to lower case letters with diacritics in cz.h. The z issue might be a different problem which needs looking into.

Example: #define TR_RADIO_SETUP "NASTAVENí RáDIA"

@3djc correct?

gagarinlg commented 1 year ago

The issue here is the readability on the B&W when you are trying to display capital letters with the extras above them. There is just not enough room.

Eldenroot commented 1 year ago

I am a Czech guy... yes, we need same treatment - we use special symbols - ĚŠČŘŽÝÁÍÉÓÚŇŮ (I hope that I have covered all :) and non-capitals as well)

mha1 commented 1 year ago

@eldenroot I'm not sure but there might be no visible difference in a capital or lower special symbol. So converting the upper case characters with diacritics to lower case characters with diacritics should solve all problems apart the z problem which needs some analysis. You agree?

If so I'll do the case conevrsion and make a private build for you and @japanel to check.

Btw: other languages like PL, ES might be affected too

Eldenroot commented 1 year ago

Unfortunately I cannot test it. I do not have working X9D+2019 anymore (SD card issue, cannot boot up the radio - sd card is inserted but it still displays no sd card... tested with at least 10 others cards, formated many way but without any luck). I have now only T16S MKii

mha1 commented 1 year ago

"no visible difference in a capital or lower special symbol." Strike that, of course there is a difference. But I was looking at @japanel's proposal which has a lower case e special symbol in an otherwise all caps word.

image

mha1 commented 1 year ago

It would be the same language file for the TX16s, so texts apart from the ones with short/long versions are the same

mha1 commented 1 year ago

Example: now: #define TR_FSW_RESET_TIMERS "Čas1","Čas2","Čas3" --> not working then: "čas1","čas2","čas3"

gagarinlg commented 1 year ago

Maybe it would be better to convert the characters on the fly to lower case on the B&W radios and keep them in upper case on color LCD?

japanel commented 1 year ago

@Eldenroot I'm not sure but there might be no visible difference in a capital or lower special symbol. So converting the upper case characters with diacritics to lower case characters with diacritics should solve all problems apart the z problem which needs some analysis. You agree?

If so I'll do the case conevrsion and make a private build for you and @japanel to check.

Btw: other languages like PL, ES might be affected too

Hello, if needed I can flash my Zorro with your build and test it.

philmoz commented 1 year ago

In radio/src/gui/common/stdlcd/utf8.cpp the CZ mapping array is missing the 'Á' character, so the subsequent font offsets are wrong.

It should be:

#elif defined(TRANSLATIONS_CZ)
static wchar_t _utf8_lut[] = {
  L'á', L'č', L'é', L'ě', L'í', L'ó', L'ř',
  L'š', L'ú', L'ů', L'ý', L'Á', L'Í', L'Ř',
  L'Ý', L'ž', L'É',
};
philmoz commented 1 year ago

The issue here is the readability on the B&W when you are trying to display capital letters with the extras above them. There is just not enough room.

Not necessarily - the characters Ř, Ý, Á, Í, and É are already in the CZ font for B&W radios as capitals.

mha1 commented 1 year ago

looking at @Eldenroot's list there are still quite a few special characters missing. Adding the accented A is booked. What's the best strategy for the rest of the missing ones? E.g. capital C is used, see example above.

3djc commented 1 year ago

Maybe it would be better to convert the characters on the fly to lower case on the B&W radios and keep them in upper case on color LCD?

Why ? It has never been needed before, there is no reason for that. As said above, it was perfect in Otx, we just have to match that

3djc commented 1 year ago

I think Czech language requires the same exercise @3djc went through for the French language. Change all capital letters with diacritics to lower case letters with diacritics in cz.h. The z issue might be a different problem which needs looking into.

@3djc correct?

I cannot comment for Czech, but for French, the issue is there is a new english bashing trend that recommend using accented capital that nobody uses (I actually have no clue how to make those with my french keyboard, thats how unused they are). So all the non existing upper case accented capital need to be moved to their parent upper case value. So É, È, Ê (there are others but there where no example to copy paste from) need to be mapped to E, same goes for the other voyels and C (with ç). So we need to add conversion table mechanism

mha1 commented 1 year ago

@3djc you did the mapping by changing texts in fr.h, correct?

For CZ: Adding Á to the utf lookup table should fix some of the problems (thanks @philmoz).

But there are still special characters left with no representation in cz fonts to deal with:

The language maintainer for CZ needs to know about which characters can not be used and must be replaced by their lower case counterparts for future translation texts.

Better ideas?

3djc commented 1 year ago

Yes, but that was wrong, I have now added an substitution routine, much better imho

3djc commented 1 year ago

Fixed this issue as part of #3827. thanks @philmoz for https://github.com/EdgeTX/edgetx/issues/3526#issuecomment-1642901806

mha1 commented 1 year ago

The substitute table should take care of all missing capital letters:

static wchar_t _utf8_substitution_lut[] = {
    L'Ě', L'ě',
    L'Š', L'š',
    L'Č', L'č',
    L'Ž', L'ž',
    L'Ú', L'ú',
    L'Ů', L'ů',
    L'Ó', L'ó',
    L'Ň', L'N'
};

The last entry is replaced with a standard N because there is no lower case n with hat avilable, all other missing capital letters have a lower case counterpart.

Eldenroot commented 1 year ago

But we use lower case ň in Czech

mha1 commented 1 year ago

I guessed so. Maybe I'm wrong but there is no ň in the CZ fonts. And you are right, ň is used on two occasions in cz.h.

Until ň is part of the CZ font ň should also be replaced by a standard n.

Is Ň used in your language? It doesn't show up in cz.h.

@3djc update:

static wchar_t _utf8_substitution_lut[] = {
    L'Ě', L'ě',
    L'Š', L'š',
    L'Č', L'č',
    L'Ž', L'ž',
    L'Ú', L'ú',
    L'Ů', L'ů',
    L'Ó', L'ó',
    L'Ň', L'N'
    L'ň', L'n'  
};
3djc commented 1 year ago

@Eldenroot are some of this list unused ?

mha1 commented 1 year ago
Ě,Š,Č,Ž,Ú,Ů, - used in cz.h -> could be replaced in cz.h with their existing lower case counterparts
Ó - **not used in cz.h** - could be replaced in cz.h with its existing lower case counterparts if ever needed
Ň - **not used in cz.h** - no replacement possible, needs font
Eldenroot commented 1 year ago

Ň could be replaced by N, ň by n

mha1 commented 1 year ago

static wchar_t _utf8_substitution_lut[] = { L'Ě', L'ě', L'Š', L'š', L'Č', L'č', L'Ž', L'ž', L'Ú', L'ú', L'Ů', L'ů', L'Ó', L'ó', L'Ň', L'N' L'ň', L'n'
};

This was my proposal as long as the special N's are not in the fonts

philmoz commented 1 year ago

Adding 'ň' to the font is easy enough; but when I opened the 5x7 font image source for CZ there is 'speaker' icon in the image??? It also exists in the PL font; but no others.

Anyone know if this is used anywhere?

Screenshot 2023-07-21 at 7 55 30 am

japanel commented 1 year ago

Hello guys, I would like to ask if there is a version to test or not, if so I can do it. Thank you.

3djc commented 1 year ago

What radio do you use ? Still the Zorro ?

firmware.zip

Beware that this is a 2.10 nightly, please use with a backup copy of your sd

japanel commented 1 year ago

What radio do you use ? Still the Zorro ?

firmware.zip

Beware that this is a 2.10 nightly, please use with a backup copy of your sd

I can use new sdcard, which sd content is right for me? Nightly? Can I use bootloader method for flashing this version? Thank you

3djc commented 1 year ago

bootloader flashing is fine, any sd content for 128 is fine, just copy your current one for example

japanel commented 1 year ago

bootloader flashing is fine, any sd content for 128 is fine, just copy your current one for example

And firmware you sent me is in CZ right?

3djc commented 1 year ago

It should

japanel commented 1 year ago

It should

@3djc I flash your version and quick look and czech language look amazing, very good job thank you. Only I found problem with contrast on some pages, I tried make fotos. In reality it looks even worse than in the picture. This is how bad the contrast is on pages that don't contain many characters. Maybe I can report it like new issue? What you mean? I dont see this issue in previous version. Thank you for your time. IMG20230726214703 IMG20230726214651

japanel commented 1 year ago

@mha1 @philmoz Good evening guys, I find one more czech symbol is missing Ď and ď. I thing not used now, but maybe in futuru it will be needed.

Eldenroot commented 1 year ago

Good catch

3djc commented 1 year ago

Nothing can be done on our end for the screen contrast issue, it is a hardware issue on screen themselves, that cannot drive power correctly depending on what is displayed

japanel commented 1 year ago

Nothing can be done on our end for the screen contrast issue, it is a hardware issue on screen themselves, that cannot drive power correctly depending on what is displayed

Ok, thank for your reply.