relaton / relaton-render

Gem to render ISO 690 XML serialisation into HTML
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Update Chinese language output to support Traditional and Simplified references #21

Closed ronaldtse closed 1 year ago

ronaldtse commented 2 years ago

Right now Relaton::Render produces this i18n output for Chinese:

RAMSEY, J. K. 和 W. C. MCGREW. Object play in great apes: Studies in nature and captivity. 在: PELLEGRINI, Anthony D. 和 Peter K. SMITH (编辑): <em>The nature of play: Great apes and humans</em> [electronic resource, 8vo]. 第第3版。 New York, NY: Guilford Press. 2005. 第89–112页。【看过: 2019年9月3日】.

The bibliographic practices for Traditional and Simplified Chinese are slightly different:

Traditional:

RAMSEY, J. K. 與 MCGREW, W. C.。〈Object play in great apes: Studies in nature and captivity〉。收錄於: PELLEGRINI, Anthony D.、SMITH, Peter K.(編)。《The nature of play: Great apes and humans》[電子資源,8vo]。第3版。 New York, NY: Guilford Press。 2005。 頁89-112。[閱:2019年9月3日]。

Simplified:

RAMSEY, J. K.,MCGREW, W. C.  Object play in great apes: Studies in nature and captivity. 见: PELLEGRINI, Anthony D.、SMITH, Peter K.(编). <em>The nature of play: Great apes and humans</em>[电子资源,8vo]. 第3版. New York, NY:Guilford Press 2005. 页89~112.[阅:2019年9月3日].
opoudjis commented 2 years ago

This actually raises a lot of questions about Chinese localisation, which I'm trying (obviously) to keep as generic as possible, governed by isodoc-i18n, and which was based on the experience of metanorma-iso

The variation between no-quote, italics and single-guillemot, double-guillemot is something that I think is beyond the scope of localisation; English after all has styles that do different things with quoting journal titles. I see that 《 is specific to titles, so no problem having it globally replace italics -- except that you're allowing cases it doesn't; should I treat 《 as Traditional-only?

And yes, I am studying https://en.wikipedia.org/wiki/Chinese_punctuation and https://www.w3.org/TR/clreq/ :)

opoudjis commented 2 years ago

I think I'll introduce an i18n of primary and secondary quote, specific to each style. There will be a default rendering of primary and secondary quote (empty, <em> in the foregoing), but there can also be language-overrides (〈, 《 for zh-Hant).

So articles would become:

{{ author }}. {{ opensecondaryquote }} {{ title }}} {{ closesecondaryquote }}. {{ openprimaryquote }} {{ series }} {{ closeprimaryquote }}.

Where the stylesheet would have:

opensecondaryquote:
  default: 
  zh-Hant: 〈
openprimaryquote:
  default: <em>
  zh-Hant: 《
opoudjis commented 2 years ago

Ordinals for Traditional Chinese not working with twitter-cldr-rb: the rbnf.yaml files are not defined for locales, but are meant to be generic to the language, so the number localisation needs to be reverted to "generic" Chinese.

This is almost certainly an error for Traditional Chinese, and is a bad way of handling locales even in harmless cases like Flemish vs Dutch—I should not have to undo localisation to get results. But given current events at Twitter, now is not a good time to lodge PRs to enhance their functionality...

opoudjis commented 2 years ago

和 "foreigners' logical and"

與 "together" is more correct, but is more restricted semantically (e.g. authorship), and is Traditional only.

Both appear between two final items.

Simplified ignores enum comma (verify).

Traditional is hollow dot. Simplified is normal dot, but fullwidth (verify).

Chinese citation, use fullwidth punct in citation language.

Lenticular/straight bracket is only style difference.

Is ~ the universal Simplified localisation of en-dash? Yes.

opoudjis commented 2 years ago

So:

opoudjis commented 2 years ago

Not seeing any indication that the enumeration comma is not used in PRC; see e.g. https://books.google.com.au/books?id=pV59EAAAQBAJ&pg=PT252&lpg=PT252&dq=d%C3%B9nh%C3%A0o&source=bl&ots=NL5i7a5WyZ&sig=ACfU3U3Zy2L9i__UM27wZ3MDMwBMU9Txhg&hl=el&sa=X&ved=2ahUKEwjy36Dplcz7AhXFVHwKHa9zBtQ4ChDoAXoECBwQAw#v=onepage&q=d%C3%B9nh%C3%A0o&f=false on its use in PRC legislation.

opoudjis commented 1 year ago

The use of filled dot instead of hollow in technical writing does not appear constrained to Simplified Chinese.

I would feel more comfortable if the choice of full stop was a customisation option, but I'm deferring that extension until it is needed.

opoudjis commented 1 year ago

In order to deal with wavy underline, introducing CSS style attribute to underline element.

opoudjis commented 1 year ago

I am not currently implementing underline style in Asciidoctor markup; underline is marked up as [underline]#xxx#. If this is felt useful, I will introduce hyphenation, e.g. [underline-wavy]#xxx#.