[jsword-devel] [sword-devel] Japanese Bibles in Beta and some other stuff

DM Smith dmsmith at crosswire.org
Sun Aug 20 19:07:15 MST 2017

I added support to JSword (actually the xslt that lives w/in bibledesktop’s SVN) and BibleDesktop (toggle). So no changes w/in JSword’s git repository.

This solution doesn’t allow for strong’s numbers, morphology, lemmas to be specified in the same w element as the one having gloss.

This builds the same xhtml as SWORD, which Peter supplied below. A browser that is capable of properly showing ruby will not show it inline w/ (…). BibleDesktop isn’t capable. STEP is. AndBible may be.

I recommend not adding it unless you also add a toggle for it. The following shows it by default.

See http://www.crosswire.org/svn/jsword/bibledesktop/src/main/resources/xsl/cswing/simple.xsl <http://www.crosswire.org/svn/jsword/bibledesktop/src/main/resources/xsl/cswing/simple.xsl>

Here are the pertinent changes.
The change was to add a parameter that can be changed when calling xslt:
  <!-- Whether to show glosses as ruby text. -->
  <xsl:param name="Gloss" select="'true'"/>

And then add support for w[@gloss] before <xsl:template match="w">

  <xsl:template match="w[@gloss]">
      <xsl:when test="$Gloss = 'true'">
        <ruby><rb><xsl:apply-templates/></rb><rp>(</rp><rt><xsl:value-of select="@gloss"/></rt><rp>)</rp></ruby>
  <xsl:template match="w[@gloss]" mode="jesus">
      <xsl:when test="$Gloss = 'true'">
        <ruby><rb><xsl:apply-templates mode="jesus"/></rb><rp>(</rp><rt><xsl:value-of select="@gloss"/></rt><rp>)</rp></ruby>
        <xsl:apply-templates mode="jesus"/>

> On Aug 20, 2017, at 5:16 PM, Peter von Kaehne <refdoc at gmx.net> wrote:
> On Sun, 2017-08-20 at 13:01 -0400, DM Smith wrote:
>> My response on JSword-devel mailing list:
>> JSword has no support for ruby markup. I haven’t looked at it for
>> years, but from what I remember, it was experimental, using OSIS in a
>> non-standard way.
> As you have found out by now, acc subsequent posts, the OSIS is
> completely standard using a "gloss" attribute. The only experimental
> part was the (x)html rendering using the ruby tag which for a long time
> remained unsupported in rendering engines and remains apparently
> difficult in Bibledesktops' enginge. As such the ruby tag and its
> subordinate tags are part of xhtml, but most browsers were slow in
> picking up on it. 
> This is the code from osisxhtml.cpp doing the transformation:
>     if ((attrib = tag.getAttribute("gloss"))) {
>                                         // I'm sure this is not the
> cleanest way to do it, but it gets the job done
>                                         // for rendering ruby chars
> properly ^_^
>                                         buf -= lastText.length();
>                                         outText("<ruby><rb>", buf, u);
>                                         outText(lastText, buf, u);
>                                         outText("</rb><rp>(</rp><rt>",
> buf, u);
>                                         val = strchr(attrib, ':');
>                                         val = (val) ? (val + 1) :
> attrib;
>                                         outText(val, buf, u);
>                                         outText("</rt><rp>)</rp></ruby>
> ", buf, u);
> Wrt desirability - the background is the odd nature of Japanese (and to
> some extent Korean) writing systems:
> Japanese uses two syllabic scripts, Hiragana and Katagana which each in
> principle can express the full gammut of the languages, but for
> historical etc reasons every so often Chinese ideographs get thrown in
> (Kanji script, essentially traditional, not simplified Chinese). These
> characters express a complete word and have a Japanese pronounciation -
> but you would need to know the pronounciation and meaning by heart as
> there is nothing in the character which gives it away. So for the less
> educated the Kanji script sign thrown into the stream of syllabics are
> insurmountable obstacles. A well educated Japanese will have no
> difficulty reading a text, even with many Kanji signs, but some less
> might stumble and stall. So for that purpose many educational texts and
> certainly Bibles are using glosses in syllabics to overcome that
> difficulty. 
> So, in summary, our Japanese modules are currently absolutely fine and
> perfectly well useful for anyone with high school or better education,
> but will fail to reach less educated people. I would consider this a
> bug and would like to see it resolved. 
> I would think the best solution in the interim is to make it toggled in
> the engine and if it is impossible to display on a particular engine
> keep it switched off and do not expose the functionality to users. If
> it renders fine everywhere then we need a new debate. 
> As such of course the OSIS and increasingly the related XHTML is
> absolutely standard (and not even specific to Japanese) and could also
> be used just fine for e.g. interlinear texts or other more complicated
> display functionality
> Peter
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20170820/2fbfe25d/attachment-0001.html>

More information about the jsword-devel mailing list