I think the sanity check should be done inside the _ function... and not any time where it could be an empty string...
Language assistance requested...
Re: Language assistance requested... #541
Re: Language assistance requested... #542
Posted 28 August 2018 - 15:27
Hi Huevos,
Don't use _("") for empty strings if they don't have to be translated, it is the _("....") that trigger the fact that this string needs to be translated, and since it is pointless to translate empty string it doesn't make sense to use the "to be translated" syntax. So no sanity check needed, just good programming habits.
If you want to understand how translation work you need to have a view at gettext because it is what is used to get the translatable screen. This is a standard tools so not specific to enigma2.
Re: Language assistance requested... #543
Posted 28 August 2018 - 15:56
Re: Language assistance requested... #544
Re: Language assistance requested... #545
Posted 28 August 2018 - 16:31
Hi Taapat,
I think "" is just a typo error.
Why do you think that someone would use "" if he wants an empty translation?If anyone tried it, it would be logical that he check the result, and see if the translation is not empty, will make corrections.It is the same thing if someone wants to translate, for example, the phrase "Do nothing", but accidentally instead writes "Do nothing" with two empty ones.And what now? Maybe you need to introduce an additional check which replace a lot of spaces with one?Therefore, if it does not call GSOD, but only an unexpected translation, there's no need for additional complication.
I am trying to practice defensive programming. You write code to try and anticipate ANY condition and react in a known and controlled way. The empty string MAY be encountered it is only a small bit of code that can stop the error condition from ever happening.
The example you give simply returns the untranslated string. The result is still potentially meaningful if the person has any understanding of English. Translating the empty string results in a status debug report. It is contextually wrong.
For all the time I have spend explaining the problem I may as well just fix it.
Regards,
Ian.
Re: Language assistance requested... #546
Re: Language assistance requested... #547
Posted 28 August 2018 - 18:41
Also picload svg thumbnail doesn't work right yet.
The thumbnail now works after this: https://github.com/O...ff130e248f8bc94
Saving thumbnail as jpeg, looses in quality, but I guess that's expected.
thumps_jpeg.jpg 71.97KB 1 downloads
vs
thumps_other.jpg 80.55KB 1 downloads
Also by default svg's scaled to fit the screen, maybe that should be done only when resize=1 ?
s5.jpg 92.09KB 1 downloads
s1.jpg 150.25KB 1 downloads
Is there anybody able to explain how an ePtr<gPixmap> should be filed from an "RGBA image (non-premultiplied alpha)"?
result = new gPixmap(width, height, bit_depth * channels, pixmapDisposed, accel); gUnmanagedSurface *surface = result->surface; ...It's just enough to put the rgba image to surface->data?
What data gUnmanagedSurface expects? Anyone knows? Or it's "enigma".
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916
Re: Language assistance requested... #548
Re: Language assistance requested... #549
Posted 29 August 2018 - 17:03
Hi Rob,
I had a long chat to Huevos about the title issue. I added it to the OpenViX copy today as they need to start building their new version ASAP. I will file a pull request on OpenPLi to add the setTitle when I get some sleep. I will find some other way to get the titles the way I want them.
Regards,
Ian.
Re: Language assistance requested... #550
Posted 30 August 2018 - 13:25
Hi Littlesat,
Why was my change reverted? This code is shared elsewhere. The person who broke my changes admitted that my code was better!
Why was I not consulted? I am not happy about these back door changes without consultation with the author of the code!.
Regards,
Ian.
Edited by IanSav, 30 August 2018 - 13:27.
Re: Language assistance requested... #551
Posted 30 August 2018 - 13:26
There is an explaination from Taapat on the way, it was on his request.
Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)
Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.
Many answers to your question can be found in our new and improved wiki.
Re: Language assistance requested... #552
Posted 30 August 2018 - 13:45
Hi WanWizard,
There was no explanation other than he used a different variable name in some unspecified code. The is NO indication that my code caused any crash or malfunction. No examples or details of any problems were presented at all. The change appears to be a personal preference change.
I posted in this thread that I was going to restore my code and NO-ONE posted for me not to do it or engaged me in any discussion. Why was I not consulted before my commit was reverted?
Given that my code is used elsewhere this change has now created a merge issue downstream.
Regards,
Ian.
Edited by IanSav, 30 August 2018 - 13:47.
Re: Language assistance requested... #553
Posted 30 August 2018 - 13:57
Edited by Taapat, 30 August 2018 - 13:57.
Re: Language assistance requested... #554
Posted 30 August 2018 - 14:02
Edited by littlesat, 30 August 2018 - 14:03.
WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W
Re: Language assistance requested... #555
Posted 30 August 2018 - 14:03
Hi Taapat,
Your commit to fix the titles is broken. I did not jump in and change your code. I alerted you to the issue and OFFERED to fix the problem for you. I treated you and your code with respect. I think it appropriate that my code and I also get treated respectfully.
What have I broken? I have asked this question many times and NEVER been given an answer.
Regards,
Ian.
Re: Language assistance requested... #556
Posted 30 August 2018 - 14:35
Edited by Taapat, 30 August 2018 - 14:37.
Re: Language assistance requested... #557
Posted 30 August 2018 - 15:05
I'm planning to make changes in the 'skin' file find resolver so it can find pictures in more different ways with less code in use... So it becomes 'cross' compatible.... And as far I also can see with less (lines) of code in the Directory.py Tool thing...
WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W
Re: Language assistance requested... #558
Re: Language assistance requested... #559
Re: Language assistance requested... #560
Posted 30 August 2018 - 15:25
Can you please post your proposal so other can contribute before you code the final solution.
I'm trying to make code that it does not care of the picture is within the skin, skin/skin_default, skin_default folder and also it does not care of it is in a subdir... It just 'searched' through a path where it simply tries to find the png and also aborts as soon it finds it...
here some Quick and Dirty test code I'm testing with... Instead of the print line it will return the location where it finds the png... It can be in the root of skin_default, in the root of the specific skin directory, in the bottons subdir of the skin directory or in the buttons subdir of skin_default in this example... It simply does not care.... You can give a complete path to the png but it will be removed... Please note for now this is drafted...
skin = 'PLi-FullNightHD' data = 'usr/share/enigma2' file = '/skin_default/buttons/vkey_bg.png' defaultskindir = "%s/%s" % (data, 'skin_default') skindir = "%s/%s" % (data, skin) import os if "skin_default/" in file: file = file.split('skin_default/')[1] if "%s/" % skin in file: file = file.split("%s/" % skin)[1] base = os.path.basename(file) for dir in [skindir, defaultskindir]: for f in [file, base]: if os.path.isfile('/%s/%s' % (dir, f)): print 'picture found in /%s/%s' % (dir, f)
Edited by littlesat, 30 August 2018 - 15:30.
WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W
19 user(s) are reading this topic
0 members, 18 guests, 0 anonymous users
-
Bing (1)