Confusion with an English string in Welcome app

Hi

I was translating to Hindi.
The very last line of /usr/share/endeavouros/scripts/translation-en.bash reads

_tr_add2 after_install_pacdiff_tip "Manage pacnew, pacorig $_and pacsave files with pacdiff $_and"

The actual tooltip reads something different.

Notice that the tooltip pop up has the word “code” at end. That isn’t mentioned in the translation file though.

I verified it on github, where the word “code” is indeed not mentioned in the translation file. So I am wondering how does the welcome app show it?

I have translated all strings. But the label on button shows in English only (the string was not in translations file). Also the tooltip has hindi text followed by the word ‘code’ which magically appears out of nowhere. See screenshot below.

hindi

My guess is that these two things are hardcoded in the app, which if I’m understanding right, can be treated as a bug. No bug here. Its a form of super advance AI.

@manuel could you please look into this, or request someone else who must be knowing about it. I have completed the translation, and I’ll wait for clarity on this bug before creating a pull request.

Thank You :sunflower:

Ps. There is no output in the terminal after launching Welcome app, so it is not seeing any ‘errors’.

It is not a bug. Welcome simply adds the program name (that you actually have configured :wink:) into the tool tip.

Word code in the end of the tool tip means the program name that is used for making the file comparison.

Welcome finds that program name in variable

  EOS_WELCOME_PACDIFFERS=(kdiff3 kompare meld diffuse code diff vim)

of file

  /etc/eos-script-lib-yad.conf

By default, that variable contains a list of programs, and one of them is code.
Welcome looks at the values in the listed order and uses the first program found in your system. In your case it is code.

So if you want to use another program, for example meld, you must install it, and make sure meld is listed before any other currently installed program.

Then you’ll see that the tool tip (and the button label) will change accordingly.

I hope this clarifies the confusion.

1 Like

Okay thank you for the clarification :pray:

If Welcome app appends the application name, then a Hindi translation wont be possible since according to Hindi grammar, “code” (or whatever appication name is configured) should come in between the sentence, not at the end.

Is it possible to replace that text with a generic hard coded string just for Hindi translation? If not, then I’ll have to leave that in English only. (Kinda spoils the look since all button text is center aligned, but English button text is left aligned)

Wow, so when you writing in Hindi it auto-aligns buttons text to center? :astonished:
That’s…weird :upside_down_face: i thought stuff like that should be explicitly set by DE style

2 Likes

Devanagari is written left-to-right (the “normal” direction), so it shouldn’t do this… In languages like Arabic and Hebrew (and Egyptian hieroglyphic, but good luck with that) it should probably align everything to the right.

2 Likes

@keybreak @Kresimir

Yes its kinda weird that the text is auto aligning itself. Similar problem was seen with That translation.

Hindi is left aligned as Kresimir says.

I tied with Japanese text. It shows left align. So all Asian languages are not facing problem. Some are.

1 Like

Although it’s not really a universal solution, maybe there’s some hidden (or semi-hidden like some dot or stuff like that) character in Hindi fonts which can be placed in front of this pure english button, to force it centering?

1 Like

Possibly yes. Hindi has “matra” which are drawn over already typed characters and they could be causing problem. Just a speculation.

Thai translation seems to have three kinda of these “unknown problem” First button is left aligned. In second column, 2nd and 3rd button have some extra left padding. Two buttons have center aligned text.

There’s probably some special character which is causing this.

Edit: In Japanese - the basic Japanese I’ve studied - there are no character which are drawn on top of already printed characters. The Japanese text I tested with did not have the alignment problem. While in Thai and Hindi (and probably more languages), there are characters that need to be drawn over. We cannot really get rid of these characters while writing, so I think we need to live with the fancy aligned text.

1 Like

It’s probably a bug with whatever widget toolkit is used for the Welcome app, that it treats “matra” characters as aligning text.

Somebody should file a bug report about it, as it looks really awful. Which is a pity, because Devanagari is otherwise a gorgeous, exotic-looking script (at least to the eyes of a Westerner), which deserves to be treated properly.

2 Likes

That would be yad i believe?
Or if things are really bad - GTK itself as it uses GTK…

2 Likes

Could there be some way to verify that the problem is with yad? I’d be more than happy to file a bug report even though nobody in my circle -including me- uses Devnagri script on their tech.

You have to identify exactly which character causes the misalignment. That is, provide an example with the character (misaligned) and without it (but otherwise identical).

I think this is enough to file a bug report.

1 Like

There’s more to the button label alignment issue than just yad, although yad is the original source to this problem.

Yad itself provides no option to left align button texts. So Welcome is actually using non-proportinal font for the text, and calculates the maximum length of all button labels under one tab. Then Welcome pads button labels with adequate number of space characters on the right side. This should make button labels appear as left aligned, but as we see, it is not working for every language.

Everything would be so simple if only yad could provide a left alignment option for the button labels.

However, there might be a way to do something, for example by using the HTML code values for the visible characters. This is of course a more laborous way.

1 Like

Does yad support pango markup? I recently used pango markup to center align i3wm titles. Maybe I could explicitly left align Devnagri text.

Also, as of now, I think I should skip translating Pacdiff button :point_down:

That is easiest thing to do now. Maybe we’ll do something to this later.
Yad has some support for pango, but not perfect.

1 Like