Code Monkey home page Code Monkey logo

Comments (4)

asticode avatar asticode commented on August 25, 2024 1

I've the feeling that adding a Language attribute to Item would do the trick but I may be missing something 🤔 On reading the ttml, language attribute should of an item would be update accordingly and on writing, we could either repeat the xml language attribute for each item (which would be simpler in the code), or add separate divs if we detect an item with a language 🤔

from go-astisub.

NhanNguyen700 avatar NhanNguyen700 commented on August 25, 2024

All the parsing will return the result as object Subtitles, and there is only one master language for the whole object, we can not know which Items belong to which language, that's why. If we want to fix it, we will break the Subtitles object structures and affect user of this library, they need to change their code to adapt with new structure. There is a way to achieve fixing the issue by storing language for each Subtitles Items, yeah, just like what you said, but it sounds inefficiency. But seems like that it is the only way for this current structure. And then, a question pop up. When converting the multiple languages TTML to WebVTT (or other formats), should we output multiple WebVTT files? I think it is yes, we should append the language into the name of WebVTT file for distinguishing them.

from go-astisub.

asticode avatar asticode commented on August 25, 2024

If we want to fix it, we will break the Subtitles object structures and affect user of this library, they need to change their code to adapt with new structure

Which changes are you thinking about? 🤔

from go-astisub.

NhanNguyen700 avatar NhanNguyen700 commented on August 25, 2024

Nothing special, just do not store Items directly in Subtitles, we can have some kind of Wrapper that store metadata (contains languages) and Items, then Subtitles can include that Wrapper. Another way is returning a list of Subtitles objects which different languages when parsing from the input, instead of just returning only one object like what we are doing currently. Those are my thoughts.

from go-astisub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.