Dat epgimporter translate?

There are 6 replies in this Thread which was already clicked 753 times. The last Post () by Lululla.

  • The holy grail is something that will translate an entire EPG dat and then save it so that the translated EPG then lasts for about a week.


    Now if you could find something to do that then that would be awesome.

    • Official Post

    The holy grail is something that will translate an entire EPG dat and then save it so that the translated EPG then lasts for about a week.


    Now if you could find something to do that then that would be awesome.

    details ??
    :)

  • There are no details to give.


    Basically EPG is downloaded on an E2 box and stored in a .dat file. This file contains loads of different languages, and most users want the entire .dat file translated into English so when E2 loads the file all EPG is in English.


    I was just passing comment that this would be the holy grail. Because still after all of these years no one has managed to do this.

    • Official Post

    well..

    Maybe we can discuss it...

    Google Translate's APIs are slow, translating word by word takes a while...

    But there are so many of us developers, the idea could be feasible.

  • There are no details to give.


    Basically EPG is downloaded on an E2 box and stored in a .dat file. This file contains loads of different languages, and most users want the entire .dat file translated into English so when E2 loads the file all EPG is in English.


    I was just passing comment that this would be the holy grail. Because still after all of these years no one has managed to do this.

    Epgtranslator do that


    Why epgtranslator and not translate the epg.dat


    Cause a lot of channels has eit epg so is not stored in dB but in enigma2 epgcache


    So the best way is using epgtranslator

  • Cause a lot of channels has eit epg so is not stored in dB but in enigma2 epgcache

    Iinitially yes EIT EPG is saved in the cache, but if the user then selects save EPG its then stored in the .dat


    But the user can turn EIT off if he so desires and just download from rytec meaning all various languages are in the .dat right away.


    Its this .dat file that then needs to be translated and the translated .dat saved afterwards to /media/hdd or usb.


    I know this sounds much easier than it is and its this difficulty why so far it hasnt been done, but if someone can do it then as I said its the holy grail.

    • Official Post

    Since I have already worked on epgimporter, after years of not being updated and I see that many teams use it and everyone considers it a good base, I believe that:

    I think it would be enough to modify epgdat_importer.py

    Which is the entry point before creating the epg.dat file ;)

    You don't need to translate epg.dat; it's a binary file.

    An example of code to modify the epgdat_importer.py file to automatically translate titles, subtitles, and descriptions into English, automatically detecting the original language.



    You can add an option in the EPGImport configuration menu to enable or disable English translation, without having to manually edit the code each time.


    The addition should be made at the point where the plugin's other configurations are read, such as `filterCustomChannel`.


    Add the Menu Entry (plugin.py)


    Edit the `plugin.py` file to add the new option to the configuration menu. You can do this inside the function that builds the configuration entries list (`getConfigList`). Insert something like:


    Python
    # In plugin.py, inside the configuration entries list:
    from .EPGConfig import translateToEnglish
    # ...
    config.plugins.epgimport.translate_to_english = ConfigYesNo(default=False)
    config_list.append(
        getConfigListEntry(
            _("Translate EPG to English"),
            config.plugins.epgimport.translate_to_english
        )
    )


    The most important step: modify `epgdat_importer.py` to read this configuration and translate data only if the option is enabled. You will need to import both the translation module and the new configuration variable.




    This is just an example, not tested or anything else. Just to give you a sense of direction.



    Attached my python code translate_epg


Chat about everything else!

A friendly forum for off-topic discussions, random questions, and community bonding. Your space for conversations outside our main categories. Discuss hobbies, news, games, or anything else with the wider community.