The translator view...

  • Hi!
    As for the translator point of view, I would like to ask to all enigma2 coders two things, if I could...
    1) The one that for me is the most important, try to make all the stuff that is coded (plugins or e2 core) ready for translation. I do not mean translated (let a bit of glory also to translator work...) but READY to be translated.
    Naturally I'm speaking about new stuff or updates, but if someone would adjust also existing code... :face_with_rolling_eyes:


    2) Avoid, as far as possible, using chained strings if they have to be translated, because they simply can't be localized.
    Just for instance, into /usr/lib/enigma2/python/Components/UsageConfig.py:


    or in /usr/lib/enigma2/python/Components/Task.py

    Code
    ...
    else:
     		Notifications.AddNotification(MessageBox, _("Error") + (': %s') % (problems[0].getErrorMessage(task)), type = MessageBox.TYPE_ERROR )
     ...
    def getErrorMessage(self, task):
     		return _("An unknown error occured!") + " (%s @ task %s)" % (self.__class__.__name__, task.__class__.__name__)
    ...


    These strings could never be translated, as far the strings parsed by gettext results from the combination of the chaining, that is not present into .po file.
    Sometimes could be possible to "guess" all the coincidences, an add by hand the requested strings into .po file, but every time you update from source or from .pot, you have to remember to merge the strings being missing and that xgettext could not extract.
    But in other situation is even not possible to "guess", so the only chance is to edit the source, but normally it isn't translators job, and if the changes aren't permanently fixed into code every update needs the same work.
    Naturally, I think that translators would be very happy to help, if requested!
    That's only my point of view, but I'll be very glad if others translators (and coders, of course) replay here saying what they think about.
    Sorry for the long post...
    Bye
    Spaeleus

    DM 920UHD - DM Two - DM One - DM 7020HD-v2 - DM 7020HD

    2 Mal editiert, zuletzt von Spaeleus ()

  • actually the concatenated strings are supposed to make life easier for translators. you don't need to assume any combinations. i try to fall back on messages that have already been translated. therefore we don't need to define a new string that is partially redundant.

  • Zitat

    Originally posted by Fraxinas
    actually the concatenated strings are supposed to make life easier for translators. you don't need to assume any combinations. i try to fall back on messages that have already been translated. therefore we don't need to define a new string that is partially redundant.


    I perfectly agree with you about avoid redundant strings.
    But, escuse me, if we take the example I've mentioned, the possible combinations are:
    (/usr/lib/enigma2/python/Components/UsageConfig.py)


    Zitat

    no timeout , 1 second , 2 seconds, 3 seconds, ........, 10 seconds.


    Except for "no timeout", no one of these strings is present into today's CVS .pot file.


    Again into the same file:

    Zitat

    no standby, 10 seconds, 30 seconds, 1 minute, 2 minutes, 5 minutes, 10 minutes, 20 minutes, 30 minutes, 1 hour, 2 hours, 4 hours


    In this case the only strings present are "no standby", "5 minutes", "30 minutes"


    Or, into /usr/lib/enigma2/python/Screens/PluginBrowser.py:

    Code
    if self.type == self.DOWNLOAD:
     		                  self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to download\nthe plugin \"" + sel[0].name + "\"?"))
     		elif self.type == self.REMOVE:
     		                  self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to REMOVE\nthe plugin \"" + sel[0].name + "\"?"))


    Into .Pot file I can find

    Zitat

    Do you really want to download\n the plugin \"


    and

    Zitat

    Do you really want to REMOVE\n the plugin \"


    But how these can be translated if the real parsed string have the name of the plugin merged in?
    In fact, these translations won't work, and not only in italian. I'v tried other languages, (non translated by me ;)) and the result is the same: no translation!
    These are just few examples.
    But may be I'm really wrong, and if someone would be so kind to explain to me where is my mistake, I'll be grateful to him for life.
    Thanks!
    PS: I've posted several updates of CVS italian locale on the board: is it possible to update the CVS? Many thanks again to you all! :smiling_face:

    DM 920UHD - DM Two - DM One - DM 7020HD-v2 - DM 7020HD

    Einmal editiert, zuletzt von Spaeleus ()

  • Not "10 seconds" is translated but only "seconds".
    Your previous example with %s is also wrong, as %s is also "translated" (should be translated to %s of course) and the actual text is replaced after translation.


    But you're right about the Plugin-Message - this is a little messy :smiling_face:

    Homescreen eurer Apple-Geräte noch nicht voll genug?


    dreaMote: Fernbedienung für Dreamboxen
    Mobile WOL: Wake-on-LAN Client für iOS mit optionalem Widget
    My Home Remote: Fernkontrolle für Homematic CCU/CCU2 optimiert für mobile Benutzung

  • Zitat

    Originally posted by ritzMo
    Not "10 seconds" is translated but only "seconds".
    Your previous example with %s is also wrong, as %s is also "translated" (should be translated to %s of course) and the actual text is replaced after translation.


    But you're right about the Plugin-Message - this is a little messy :smiling_face:


    I know that only "secons" or "minutes" or "hour" have to be translated, but the fact is that it is NOT translated because in that way gettext parse the whole combined string, that has no correspondence into .po file.
    Be sure that I've tried several times, not only in italian, and it only works if you put into .po all the possible combinations.
    For the other example, if you search in to .pot file for the correspondence, you only find "An unknown error occured!" without any %s, as xgettext is not able to extract that kind of construction.
    And when the string is parsed, it contains "An unknown error occured!"+<error description> that is different with it can find into .po.
    I think it could only work if you have the string translated before having it merged to the rest of the sentence, using a variable also for the text to translate.
    I will do some attempts in that way...
    But many thanks for the replay!


    PS: Another question, but I want to be sure that it could be taken in the righ way, absolutely without any contention, just for me to be sure to work in the right direction:
    You say that so chaining works because was tried and it worked out, or because it is supposed it had to work?
    If the first, please tell me in wich language, I'll try as soon as I can, to better understand where is my mistake.
    If the second, please try yourself and tell me about the results.

    DM 920UHD - DM Two - DM One - DM 7020HD-v2 - DM 7020HD

    2 Mal editiert, zuletzt von Spaeleus ()

  • Zitat

    Originally posted by Fraxinas
    actually the concatenated strings are supposed to make life easier for translators. you don't need to assume any combinations. i try to fall back on messages that have already been translated. therefore we don't need to define a new string that is partially redundant.


    Dear fraxinas, first of all thank you for your work.
    I'm afraid I've been misunderstood.
    If gave the impression of despise your work and what you toghether with the all stuff are doing, please forgive me, nothing was more far in my intention.
    I really do appreciate your efforts, (and I also envy your skills...) :winking_face:
    I was oly trying to give a hand, as far as I can.
    If you are trying to make my life, as a translator, easier, I can only be grateful to you.
    But the problem, at least fo me, is still the same.
    Do you mean that on your box when you go to infobar timeout or to hdd stanby config you have that strings translated?
    I can't believe it, if we are speaking of the same box (7025 and 800) with the same firmware (enigma2 CVS) and the same .pot.
    It doesn't matter wich language you choose, that strings are always in english.
    My translation is always updated (almost daily: today I posted the new release) and it reflects exactly wath conteined into official .pot file attached to CVS: it works fine, apart from the strings that are concatenated.
    I tried to find a workarond, bu even I got some skills into translating stuff, my python skills are not enough to this.
    Escuse me again for boring you... and thank's again.
    Have a fine day.
    Bye

    DM 920UHD - DM Two - DM One - DM 7020HD-v2 - DM 7020HD

  • I still have to disagree, but I'm a little more confused as before.
    Concatenated string get translated properly, but there's something weird about UsageConfig I could not yet find (though I have not really tried - just confirmed that we are right with being confused :)).


    Let's try to make this a little more clear: In Components.UsageConfig (where those string get initialized) no actual translation happens (I verified this by adding debug output to several parts of the code).
    This immediately leads to my confusion: Where are those string translated? My guess would be when opening the Screen though I have not yet found the responsible lines of code (only did some grep'ing).
    If Enigma2 tries to translate these strings after concatenation this would explain why we run into this problem :winking_face:

    Homescreen eurer Apple-Geräte noch nicht voll genug?


    dreaMote: Fernbedienung für Dreamboxen
    Mobile WOL: Wake-on-LAN Client für iOS mit optionalem Widget
    My Home Remote: Fernkontrolle für Homematic CCU/CCU2 optimiert für mobile Benutzung

  • i've never had problems with the translation of concatenated strings when it came to plugins. i'm going to investigate the problem with UsageConfig though. thanks for your report but next time drop the flatterly :smiling_face:

  • Zitat

    Originally posted by ritzMo
    ... If Enigma2 tries to translate these strings after concatenation this would explain why we run into this problem :winking_face:


    I'm not able to add debug output to code, but an empirical prove that into UsageConfig.py enigma2 translated after concatenations is supported by the fact that if you put into .po the resulting strings (1 second, 2 second... etc) it works fine.
    So...
    Thank's again, you are always very kind. I'm waiting for your investigation...

    DM 920UHD - DM Two - DM One - DM 7020HD-v2 - DM 7020HD