Jump to content


Photo

Language assistance requested...


  • Please log in to reply
998 replies to this topic

Re: Language assistance requested... #541 littlesat

  • PLi® Core member
  • 57,198 posts

+700
Excellent

Posted 28 August 2018 - 15:26

I think the sanity check should be done inside the _ function... and not any time where it could be an empty string...


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Language assistance requested... #542 IanSav

  • PLi® Contributor
  • 1,491 posts

+51
Good

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.

 

https://github.com/O...ateallpo.sh#L30

 

This is what I originally proposed and wanted to do.  Littlesat suggested we make the change "at a "deeper" level so everything is protected" so I was exploring that option..
 
Regards,
Ian.


Re: Language assistance requested... #543 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 28 August 2018 - 15:56

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.


Re: Language assistance requested... #544 Huevos

  • PLi® Contributor
  • 4,668 posts

+163
Excellent

Posted 28 August 2018 - 16:29

You are all missing the point. These strings are being dynamically sent to the translation engine. They are not coding errors.



Re: Language assistance requested... #545 IanSav

  • PLi® Contributor
  • 1,491 posts

+51
Good

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 Huevos

  • PLi® Contributor
  • 4,668 posts

+163
Excellent

Posted 28 August 2018 - 16:33

I think you all need to read the links Ian posted above that explain why _("") is necessary.



Re: Language assistance requested... #547 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

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.

Attached File  thumps_jpeg.jpg   71.97KB   1 downloads
vs
Attached File  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 ?

Attached File  s5.jpg   92.09KB   1 downloads
Attached File  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".
Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: Language assistance requested... #548 Rob van der Does

  • Senior Member
  • 7,766 posts

+184
Excellent

Posted 29 August 2018 - 16:17

I don't see a conclusion being drawn to the title issue.

IMHO selftitle should be used, for the arguments given.



Re: Language assistance requested... #549 IanSav

  • PLi® Contributor
  • 1,491 posts

+51
Good

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 IanSav

  • PLi® Contributor
  • 1,491 posts

+51
Good

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 WanWizard

  • PLi® Core member
  • 70,554 posts

+1,813
Excellent

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 IanSav

  • PLi® Contributor
  • 1,491 posts

+51
Good

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 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 30 August 2018 - 13:57

And why are you not consulted before offering such changes?
You have forgotten that you are not the only developer.
You can not ignore other developers and users.
 
The fact that you have created something different in OpenViX and Beyonwiz is not an argument to break everything into OpenPLi.

Edited by Taapat, 30 August 2018 - 13:57.


Re: Language assistance requested... #554 littlesat

  • PLi® Core member
  • 57,198 posts

+700
Excellent

Posted 30 August 2018 - 14:02

Your name is better indeed, but it seems to break a number of plug-ins regarding Taapat... sometimes you can’t make it better as Some things depend on other things....

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 IanSav

  • PLi® Contributor
  • 1,491 posts

+51
Good

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 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 30 August 2018 - 14:35

You just think it's broken because you can not imagine that someone might want to use the trnslation header for the title.
Users do not use only your images, only in the same way as you.
 
I have not changed your "prompt" to"header". It breaks the ability to use identical skins on develop and release images.
 
I do not change using images from skin_default, because you images do not use skin_default.
 
I only changed the name of this function.
I already mentioned in my commit that it breaks my plugin and possibly also others. I alredy gave you a specific link before: https://github.com/T...beSearch.py#L32
My plugin is used also on many other images, as for example in openatv.
Why need break it into all images just because you have changed something in yours?
 
I already wrote before. I myself have changed the buttons of the screens, but only when I do not see other options.
If it is possible to maintain compatibility, then this is most important for me.

Edited by Taapat, 30 August 2018 - 14:37.


Re: Language assistance requested... #557 littlesat

  • PLi® Core member
  • 57,198 posts

+700
Excellent

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 IanSav

  • PLi® Contributor
  • 1,491 posts

+51
Good

Posted 30 August 2018 - 15:12

Hi Littlesat,

 

Can you please post your proposal so other can contribute before you code the final solution.

 

Regards,

Ian.



Re: Language assistance requested... #559 IanSav

  • PLi® Contributor
  • 1,491 posts

+51
Good

Posted 30 August 2018 - 15:13

Hi Taapat,

 

I am helping an OpenViX user at the moment.  I will look at your code in a moment.

 

Regards,

Ian.



Re: Language assistance requested... #560 littlesat

  • PLi® Core member
  • 57,198 posts

+700
Excellent

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



12 user(s) are reading this topic

0 members, 12 guests, 0 anonymous users