AndBible / and-bible

AndBible: Bible Study
https://andbible.org
GNU General Public License v3.0
551 stars 193 forks source link

Hyphenation support for other languages than english #204

Open ildar opened 5 years ago

ildar commented 5 years ago

I'd like to re-post the 2015 yr FR, originally discussed here: https://code.google.com/p/and-bible/issues/detail?id=184 The reason for it is that no-hyphen text is very inconvenient for reading, especially on small screens or/and big fonts. I personally still use a book reader (FBReader) for bulk reading, not And-Bible.

tuomas2 commented 5 years ago

Could be implemented on JS side: https://github.com/mnater/Hyphenopoly

https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens

ildar commented 5 years ago

It seems WebKit does hyphenations: https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens Can you turn them on?

tuomas2 commented 5 years ago

Yes! That's my plan.

tuomas2 commented 5 years ago

Unfortunately, with WebView, this is not working for any other languages but english. But I'll enable it anyway.

https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens#Browser_compatibility

tuomas2 commented 5 years ago

Implemented in f567a33d4b0d21ee36c9fb5ec98654c903cfd2ef

tuomas2 commented 5 years ago

I'll re-open this, because I could consider later adding support for other languages via Hyphenopoly.

ildar commented 5 years ago

Unfortunately, with WebView, this is not working for any other languages but english.

Hi Tuomas! Thanks. Could you please give a reference why other languages do not work? May it be that just WebKit input document misses language codes?

tuomas2 commented 5 years ago

Could you please give a reference why other languages do not work? May it be that just WebKit input document misses language codes?

Here's the reference. See the "Android Webview" column. Language code is in place.

https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens#Browser_compatibility

Or actually it says compability is 'unknown'. But it appears that it is not working so I assume that it is not supported.

ildar commented 5 years ago

The column is full with ?s. So "Enemy Unknown" )) Testing the 274 beta, very satisfied with English text. Now please confirm that in 274 for Russian Bibles (like RST):

  1. Language code is set correctly in HTML;
  2. hyphens: auto. Thanks!
tuomas2 commented 5 years ago

@ildar Please take a look at the diff: https://github.com/AndBible/and-bible/commit/f567a33d4b0d21ee36c9fb5ec98654c903cfd2ef?w=1

As you see, hyphens is always enabled (auto) and language code is set according to the document language (it is two letter code, like 'en', 'fi', 'ru' etc.).

tuomas2 commented 5 years ago

This needs to be made configurable (to options menu right-rop corner)

ildar commented 5 years ago

Thanks, agreed

zdposter commented 2 years ago

What is status of this? I tried to use it at Slovak Bible and I see no hyphenation even Slovak is supported by Hyphenopoly. In English/NASB I see hyphenation.

tuomas2 commented 2 years ago

Hyphenopoly would be option, if it is implemented similar way as RefParser, i.e. js files are bundled in a add-on module file. What we are using, is native hyphenation. Chrome / WebView do not seem to implement this still. (https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens#Browser_compatibility)