Bug 115319 - Reference fields: support automatic Hungarian article selection
Summary: Reference fields: support automatic Hungarian article selection
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: László Németh
URL:
Whiteboard: target:6.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-30 23:03 UTC by László Németh
Modified: 2018-02-09 22:31 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
ODF test document with text:reference-language attributes (15.59 KB, application/vnd.oasis.opendocument.text)
2018-01-30 23:29 UTC, László Németh
Details
Dialog window Fields with the new reference formats "Article a/az + Page" etc. (71.03 KB, image/png)
2018-01-31 00:43 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description László Németh 2018-01-30 23:03:29 UTC
Description:
OOo Extension Hunart (Hungarian cross-reference toolbar) is an incomplete and fragile workaround for this problem (it supports only sequence types, and it uses hidden, but removable fields).

As a better solution, I propose the following OpenDocument improvement, implemented in LibreOffice:

[text] additional text attribute for alternative language-specific reference formats.

This is an enhancement, described in terms of changes to OpenDocument-v1.2 

1. RATIONALE

1.1 Use cases:

   Reference formats give an incomplete solution for
   Hungarian language, because they don't support
   automatic selection of the frequently used definitive
   articles before the reference.

   Supported (without article):

   "lásd 1. oldal" ("see page 1")
   
   Not supported (article "a" or "az"):

   "*az* 1. oldalon" ("on page 1")
   "*a* 2. oldalon" ("on page 2")

   LaTeX Babel package uses \aref, \apageref etc. commands
   for references with automatic Hungarian articles.
   
   Suggested text:reference-language attribute has
   got the following features:

   – i18n:

     It's possible to add alternative reference formats to
     Hungarian and other languages with similar needs.

   – back-compatibility:

     Only the alternative language-dependent layout,
     – in the case of Hungarian, only the articles – are
     missing in an older application, not the original
     reference format "chapter", "direction", "page" etc.

   – translation support:

     Alternative language-dependent layout of the
     reference fields is visible only in the same
     language text. For example, changing the
     language of a Hungarian document to English
     hides the Hungarian articles, helping
     translators.

1.2 Alternatives considered:
   None.

2. REQUESTED CHANGES TO THE ODF STANDARD

2.1 Text changes/additions:

   The text:reference-language attribute specifies an alternative way
   how information about a reference is displayed.

   The text:reference-language attribute has the data type languageCode.

   If the text:reference-language attribute is not specified, or the
   language of the text, where the reference inserted, is different from
   the specified reference language, common visualization of reference
   formats is used as the default.

   Letter case of the identifier can store the optional capitalization
   of the alternative reference format (like value "a" and "A" of style:num-format).

   Examples

   – text:reference-language is not specified

     Visualizations: "1"; "2"

   – text:reference-language="hu" (Hungarian article "a" or "az")

     Visualizations: "az 1"; "a 2"

   – text:reference-language="Hu" (Hungarian article "A" or "Az")

     Visualizations: "Az 1"; "A 2"
   
   The text:reference-language attribute is usable with the following elements:
   <text:bookmark-ref> 7.7.6, <text:note-ref> 7.7.7, <text:reference-ref> 7.7.5 and
   <text:sequence-ref> 7.7.8.

2.2 Schema changes/additions:

   <rng:define name="text-common-ref-content">
       <rng:interleave>
           ...
           <rng:optional>
               <rng:attribute name="text:reference-language">
                   <rng:ref name="languageCode"/>
               </rng:attribute>
           </rng:optional>
           ...
       </rng:interleave>
   </rng:define>

3. IMPACTS

3.1 Conformance:
   This proposal will not add any mandatory features or behaviors.

3.2 Backwards compatibility:
   This element was not available in previous versions and is
   optional. Existing ODF processors may ignore it.

3.3 Accessibility impact:
   None.


Steps to Reproduce:
-

Actual Results:  
-

Expected Results:
-


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0
Comment 1 László Németh 2018-01-30 23:29:20 UTC
Created attachment 139453 [details]
ODF test document with text:reference-language attributes
Comment 2 László Németh 2018-01-31 00:43:42 UTC
Created attachment 139454 [details]
Dialog window Fields with the new reference formats "Article a/az + Page" etc.
Comment 3 László Németh 2018-01-31 01:01:12 UTC
Patch for the attached test document:

https://gerrit.libreoffice.org/#/c/48944/

Note: choose Hungarian locale setting to show the new "Article a/az + Page" etc. reference formats in dialog window "Fields", as in the attached screen shot.
Comment 4 Commit Notification 2018-02-02 08:07:38 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1037e3759bf178b52d16c12a811717f94ab9950a

tdf#115319 references with Hungarian articles

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 László Németh 2018-02-06 23:38:46 UTC
Fixed in LO, OASIS proposal will be submitted soon.
Comment 6 Commit Notification 2018-02-08 20:19:11 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e102432173c257cbbb7e368d784a54a1667bd622

tdf#115319 use loext namespace for reference-language

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2018-02-09 22:31:57 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=48cf115778b29ab916dd884d0bfcfeffd03e7603

tdf#115319 unit test for references with Hungarian articles

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.