Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improving language support for medias #115

Open
MikeZeDev opened this issue Mar 19, 2023 · 7 comments
Open

improving language support for medias #115

MikeZeDev opened this issue Mar 19, 2023 · 7 comments
Labels
Enhancement New feature or request

Comments

@MikeZeDev
Copy link
Contributor

Some random thoughts on how we could have better language support for medias.

  • Set a default language for a website plugin . Deduced from website unique language tag or manually?

  • By default children inherit the language property from their parent (no need to modify already done plugins). May add a default arguments in constructors?

  • What about Extractors? For now they return only ID and / or title. They should return language too. I think about making them return JSON array

{ id : 1234, title : One Piece, language : en_US }

instead of

{ 1234, "One Piece", en_US }

for clarity. This could help avoid errors because i think further. We may have to extract other things in the future and messing with values order will have disastrous effects.

This could event help in other cases : when you have to return a custom ID in copy/paste decorators, you are forced to rewrite FetchManga to match the rest of the code (think "API"). If extractor value got "id", use it instead of default (pathname or pathname+search according to arguments)

This way is more flexible as we can further expand it with stuff for animes : { audio : jp_JP, subtitles : [])

TLDR : Extractors revamping.

Now there are questions :

  • What to do with multilingual tag?

  • Language normalization : website use custom codes or values. Exactly what are we using, when , what to store,, how to we translate ? dictionary? where to put it? and many other questions

  • UI and settings : Having setting by default for subtitles and audio or per plugin?
    Dont really have ideas here, i need to think further.

@MikeZeDev
Copy link
Contributor Author

MikeZeDev commented May 29, 2023

  • website: Comick,

  • Manga : One Piece.

  • Manga have no language itself

  • Fetching chapters bring chapters for all languages

  • Each chapter get a "lang" property

  • There are more language available for this manga than the one existing in Haruneko tags at the time of writing :)

@MikeZeDev
Copy link
Contributor Author

MikeZeDev commented May 29, 2023

When fetching MANGAS :

  1. Manga does not have a language per se

Manga language can be inferred from website language tag, providing it is UNIQUE and not "Multilingual". Plugins should then have only one language tag : its either "one language" or "multilingual" tag. Manga constructor should be affected.

  1. Manga has language info (unique language) => we just need to set the good tag. Provide a language mapping table in plugin and a fallback just in case. Maybe we need a new "Tags.Language.Unknown"?

  2. Manga has more than one language (when fetching said manga). > just set the "multilingual" tag

when fetching CHAPTERS:

  1. Chapter has no language defined > use parent "Manga" language. If cases has been covered mangas should always have one.

  2. Chapter has one language defined > give it the good tag

  3. Chapter has multiple language : > Multi-language tag. I imagine the website API would provide different pages list for different language

@MikeZeDev
Copy link
Contributor Author

MikeZeDev commented May 29, 2023

There are special cases where external elements (sessions tokens, cookies, account parameters) are affecting content's language.

  • Website API need a language parameter and only return content from said language(s)
  • Website uses (sessions tokens, cookies, account parameters) to choose exactly what to return without changing the API or URL parameters

Such plugins may have language settings (to exclude languages) , custom initialization , a way to switch between languages if possible (for requests). As for tags, website plugin should have Multilingual tag.

Its possible that website use different ID for the same manga in different language, making it two mangas. If its the contrary we should make sure manga id is unique, maybe by adding langage code.

@MikeZeDev MikeZeDev added Enhancement New feature or request Engine and removed Engine labels Jul 25, 2023
@MikeZeDev
Copy link
Contributor Author

Sheep talked about an interesting case : suppose a website add a langage for a manga (not in another manga entry).

  • This should affect manga listing, as langages are supposedly fetched
  • Change manga langage tag to multilingual
  • Chapters are not cached , no problem
  • How would this affect chapters marked as read? same chapter different language should have different identifiers so bookmarks are f* up? Include langage in chapter identifier (JSON ? )
  • What about bookmark?

@ronny1982
Copy link
Contributor

ronny1982 commented Oct 12, 2023

As of now the language and translation group (if present) must be part of the title.
This is by design since the title is used as folder name and should be unique for each manga/chapter.

In addition the Tags can be used to provide such meta information for the UI (maybe for filtering)
e.g.,

const manga = new Manga(plugin, ...);
manga.Tags.push(Tags.Language.English);
manga.Tags.push(Tags.Language.French);

const chapter1 = new Chapter(manga, ...);
chapter1.Tags.push(Tags.Language.English);

const chapter2 = new Chapter(manga, ...);
chapter2.Tags.push(Tags.Language.French);

const chapter3 = new Chapter(manga, ...);
chapter3.Tags.push(...manga.Tags.filter(tag => tag.Category === R.Tags_Language));

Some of the use-cases should already be covered with this existing functionality.

@MikeZeDev
Copy link
Contributor Author

Its good to add language tags to mangas but for now they are not saved, meaning its lost after program is closed.

@Sheepux Sheepux changed the title Feature : improving language support for medias improving language support for medias Feb 7, 2025
@MikeZeDev
Copy link
Contributor Author

related #1034

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants