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

The language of the epub file defaults to english #7

Closed
fxsmthn opened this issue Jul 30, 2020 · 5 comments
Closed

The language of the epub file defaults to english #7

fxsmthn opened this issue Jul 30, 2020 · 5 comments

Comments

@fxsmthn
Copy link

fxsmthn commented Jul 30, 2020

Greetings,
I think I have found a little "quality of life" issue (for a lack of better term) with this otherwise excellent addon. I save articles in multiple languages, but it seems that Epub Creator defaults to "English" on the epub metadata. This means that Pocketbook (both the reader I use and their Android app) and similar readers that support hyphenation on epub files will hyphenate e.g. finnish text with English ruleset and the results look quite strange for reading.

One way to remedy this issue is to use calibre to switch the language from English to finnish, but this is an extra step I need to repeat for every non-english epub created with Epub Creator.

I'm curious if you think it could be feasible to allow setting the language for the exported file manually within the extension, perhaps in similar way to how it prompts for "author" every time.

@NiklasGollenstede
Copy link
Owner

I am generally not a fan of localization, but this is a valid point.

The extension will now infer the language from: the lang on the <html> or <body> element, and the TLD, and will then fall back to a new configurable value (see options).

I think that should do. It's now in the new -dev release. I did only test this on a single page. Could you maybe check some more to see that it actually captures and sets the language in a way that is processed by your reader? I'll then upload it to AMO.

@fxsmthn
Copy link
Author

fxsmthn commented Aug 5, 2020

Hey,
it works now, for most sites I tested. :)

I did find a site that wont get recognize and defaults to en-US (this may be an issue on the site itself), but I can see it now works with e.g. articles picked from finlex.fi, svt.se, yle.fi, svenska.yle.fi or the finnish or swedish Wikipedia. It correctly recognizes language (fi for finnish, sv for swedish) and the hyphenation looks correct now, tested on the Pocketbook device, Pocketbook app as well as Firefox addon "EPUBReader".

This is the website that doesn't get recognized by Epub Creator correctly: http://www.artotukiainen.net/linkola.html

I'm also not sure if I understand correctly how to configure this value, other than check or uncheck the box. It doesn't seem to make a difference, whether the box is checked or not, it will still default to en-US for that particular website.
Annotation 2020-08-05 204642

It is an improvement nonetheless for those sites that do work (YLE, Wikipedia), which is already huge help, thanks for taking your time looking into this. Another reason why this update is helpful to me, is that sometimes I save articles using the Firefox for Android browser and I haven't been able to find an app to edit metadata on the phone, so now I can send stuff from my phone to my reader without having to first convert them on the PC using calibre. I also tested it on Android and it works now (hyphenation is shown correctly on the files saved using Firefox for Android as well)

As a sidenote, a quirk on the Android side is that it asks to force the reader mode every time you use the addon, but it does work once you click the notification.
IMG_20200805_204205

The options menu is not visible on Android at all.
IMG_20200805_210327

@NiklasGollenstede
Copy link
Owner

Thanks for your feedback, took me a while to get back to this ...

it works now, for most sites I tested. :)

Glad to hear that!

This is the website that doesn't get recognized by Epub Creator correctly: http://www.artotukiainen.net/linkola.html

That site actually explicitly sets its language as lang="en-US". 🤷‍♀️

I'm also not sure if I understand correctly how to configure this value

🤦 I set the wrong data type for that Input. Its supposed to be a text field, not a checkbox. Will fix that.


Unfortunately, Addon support in Firefox for Android (Fennec) was never great. Lot's of halve broken or halve missing APIs.
Now updates for Fennec have been suspended for almost a year, while Mozillais working on a replacement (with currently very selective Addon support).
Debugging extensions for Fennec is quite annoying, especially since there is no good way (anymore, I think) to upload the extensions from a PC directly to the phone.
So I just tried something to circumvent those bugs, and it's kind of working, I think.


While this wasn't much work on the extension code itself, I had to update quite a bit of tooling and framework code, I fear that for the foreseeable future, this is probably about the time I can put into this project. (But feedback is always welcome!)

@fxsmthn
Copy link
Author

fxsmthn commented Sep 3, 2020

Hey,

Apologies for late reply. I tested the latest build on desktop and the settings menu works now as expected. 👍

Meanwhile, on Android side, Fennec F-droid (fork based on Firefox 68.11 that still allow installing of addons outside "recommended" ones) shows the settings menu properly as well, so that is swell! The new setting to "always force reader view" works as well. We'll see, when the addon is available to use on the new GeckoView/Fenix browser...

As a sidenote, GNU IceCatMobile, another fork (based on 68.4.2 ESR) gives fatal error: 500 when trying to access the settings menu, but the basic functionality (saving articles) works there too. As Fennec F-droid does work properly, it's likely something they've changed and not your addon at fault (or maybe 68.4.2 is just too old already). Just thought you might find that interesting, but as you said, Fennec codebase is old, so its probably not worth the time to try to debug that issue. :D

@NiklasGollenstede
Copy link
Owner

Glad to hear that it is generally doing the job!

And yes, in terms of Android support, I'd really wait until there is a properly maintained version of Firefox again.

Since the original issue is solved, I'll close this. Thanks for your filing and testing!

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

No branches or pull requests

2 participants