Skip to content

Releases: dita-community/org.dita-community.i18n

OT 3.3, Saxon 9.8

02 Mar 13:49
Compare
Choose a tag to compare

Requires Saxon 9.8. OT plug-in requires OT 3.3, which provides new dynamic Saxon configuration features for integrating extension functions and collation URI resolvers.

No functional change from 1.0.0

Plug-in can now be installed directly from the Open Toolkit plug-in repository:

dita --install org.dita-community.i18n --force

Now with docs and easier configuration. Ready to use.

20 Nov 16:39
Compare
Choose a tag to compare

Ready to use and fully documented. Please see the project Web site for details.

This version should work with OT version 1.8.5 and newer using Saxon 9.1. It will not work with Saxon 9.6+ at this time. If you need to use this transform with transformations run by OxygenXML, see the documentation for setup details.

Starting about OT 2.2.x you can install the plugin directly from GitHub using the OT's -install command:

bin\dita -install https://github.com/dita-community/org.dita-community.i18n/releases/download/version-1.0.0/org_dita-community_i18n_plugin_1.0.0.zip

You can verify that the plugin is working correctly by using the fake transtype "dci18n-test" to run the jar and XSLT tests:

2.x:

bin\dita -f dci18n-test -i foo.xml -v

The -i parameter has to be specified but you can put any value in there--the test doesn't actually use the input file.

1.8.5:

ant -Dtranstype=dci18n-test

You should see output like:

Buildfile: /Users/ekimber/dita-ot/DITA-OT1.8.5-d4p/build.xml

init:

dita2dci18n-test:

org.dita-community.i18n-jar-test:
     [echo] org.dita-community.i18n jar test for zh-CN:
     [java] Collation report for language 
     [java] Input terms:
     [java] 
     [java] [ 1] Term: "8点40分"
     [java]        Words and pinyin:
     [java]          "点"  : dian3"
     [java]          "分"  : fen4"
     [java] [ 2] Term: "2009年7月6日"
     [java]        Words and pinyin:
     [java]          "年"  : nian2"
     [java]          "月"  : yue4"
     [java]          "日"  : ri4"
... (lots more stuff) ...

org.dita-community.i18n-xslt-test:
     [echo] org.dita-community.i18n XSLT collator test
     [xslt] Processing /Users/ekimber/dita-ot/DITA-OT1.8.5-d4p/plugins/org.dita-community.i18n/test/resources/source-data/test-zh-cn.xml to /Users/ekimber/dita-ot/DITA-OT1.8.5-d4p/out/zh-cn-xslt-test.html
     [xslt] Loading stylesheet /Users/ekimber/dita-ot/DITA-OT1.8.5-d4p/plugins/org.dita-community.i18n/test/xsl/test-collator.xsl
     [xslt] DCI18nSaxonTransformerFactoryImpl: Setting collation URI resolver to DCI18nCollationUriResolver91
     [xslt]  + [INFO] Processing source document file:/Users/ekimber/dita-ot/DITA-OT1.8.5-d4p/plugins/org.dita-community.i18n/test/resources/source-data/test-zh-cn.xml...
     [xslt]  + [INFO] Using collator "http://org.dita-community.i18n.zhCNawareCollator?lang=zh-CN"
     [xslt] DCI18nCollationUriResolver91 version 1.0.0
     [xslt] + [DEBUG] DCI18nCollationUriResolver91.resolve(): Collation URI="http://org.dita-community.i18n.zhCNawareCollator?lang=zh-CN"
     [xslt] + [DEBUG] DCI18nCollationUriResolver91.resolve():   Returning ZhCnAwareCollator
     [xslt] + [DEBUG] splitWords(): text="从前有一位楚国人, 他非常爱惜他的宝剑。", debug=false
     [xslt]  + [INFO] Document processed.

clean-temp:

BUILD SUCCESSFUL
Total time: 2 seconds

If you see any kind of Java errors it means the class path or system properties are not configured correctly.

dci18n:get*SortKeyForTopic() XSLT Functions

02 Nov 22:32
Compare
Choose a tag to compare

Added new XSLT functions for getting the primary and base sort keys that take topics rather than topicrefs as input. Useful for contexts where you have a topic but not a topicref or where normal topicref resolution won't work, such as the PDF2 topicmerge processing (where the @href values have already been changed to something not useful).

zh-CN analysis utility, refined zh-CN collation behavior.

27 Oct 14:22
Compare
Choose a tag to compare

Added a new command-line utility, org.ditacommunity.i18n.collation.CollationAnalyzer, that takes as input a data file with the locale code on the first line and then one line for each zh-CN text to be processed and produces a report that shows the input text, the words it's broken into, and the resulting pinyin and then produces the sorted result. Useful for debugging Simplified Chinese sorting.

Typical command line is:

java org.ditacommunity.i18n.collation.CollationAnalyzer zh-cn-data.txt > report-result.txt

Where the icu4j.jar, saxon.jar, and dita-community-i18n-saxon91.jar jars are in your classpath.

This utility is not yet integrated with the OT (that is, there's no Ant target in the plugin for using it yet)

Word and line break support, XSLT API refinement

20 Oct 06:32
Compare
Choose a tag to compare

Release 0.2.0 adds new XSLT functions for doing word and line splitting backed by the ICU4J word and line break iterators.

The XSLT functions in i18n-utils.xsl have been refined to make it easier to get primary and secondary sort keys for use in XSLT by making the function names more obvious and the behavior more convenient. In particular, the new getPrimarySortKeyForTopic() function will use any sort-as value if specified otherwise uses the topic title.

Rendered text length function

24 Oct 23:06
Compare
Choose a tag to compare

Adds a new XSLT function to get the rendered length of a string of text. Uses Java2D to get a fairly accurate rendered length.

Support for sorting English before, after, or within non-English

23 Oct 14:07
Compare
Choose a tag to compare

New parameter to getPrimarySortKey() XSLT function to indicate whether you want English words sorted before, after, or with non-English words. Default is "before".

Fixed configuration bug, show versions

14 Oct 11:12
Compare
Choose a tag to compare

Fixed a bug in the configuration loading. Show the release version when constructing a new collator.

See notes for version 0.1.1 for usage details.

Initial release. Barely tested but seems to work.

13 Oct 18:25
Compare
Choose a tag to compare

Initial release. zh-CN collation works, other collations should be using the configured ICU collators.

Code to support constructing localized groups still waiting to be implemented.

Does not work with Saxon 9.6+, only Saxon 9.1 as shipped with the Open Toolkit.

To use it modify the ANT_OPTS environment variable in whatever environment runs the OT to set the javax.xml.transform.TransformerFactory system property to "org.ditacommunity.i18n.saxon.DCI18nSaxonTransformerFactoryImpl91", e.g.:

ANT_OPTS=-Xmx512m  -Djavax.xml.transform.TransformerFactory=org.ditacommunity.i18n.saxon.DCI18nSaxonTransformerFactoryImpl91

You can use the custom collator by using a collation URI on xsl:sort like so:

<xsl:sort collation="http://org.dita-community.i18n.zhCNawareCollator?lang={$lang}"
          select="dci18n:getSortKeyForTopicref(.)"
        />

The dci18n:getSortKeyForTopicref() function is defined in the i18n-utils.xsl module included with the plugin.

For zh-CN content it uses the plugin's dictionary-based Simplified Chinese collator to get the pin-yin transliteration for Simplified Chinese words. For all languages it will use any <sort-as> (or <data name="sort-as">) value in addition to the referenced topic's title as the sort key.