Bug 166477 - No information about "Context" type of numerals in Help
Summary: No information about "Context" type of numerals in Help
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
25.2.3.2 release
Hardware: All All
: medium normal
Assignee: Laurent Balland
URL:
Whiteboard: target:25.8.0
Keywords:
Depends on:
Blocks: HelpGaps-NewFeatures
  Show dependency treegraph
 
Reported: 2025-05-06 11:40 UTC by Tuomas Hietala
Modified: 2025-05-24 12:13 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example of variation of numbering type with "Context" option (14.20 KB, application/vnd.oasis.opendocument.text)
2025-05-13 15:31 UTC, Laurent Balland
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tuomas Hietala 2025-05-06 11:40:07 UTC
Description:
On the Complex Text Layout options page, the "Context" item in the "Numerals" drop-down is lacking documentation in Help. The Help page explains the other three options.


Steps to Reproduce:
1. Go to Tools -> Options -> Languages and Locales -> Complex Text Layout.
2. Click "Help".


Actual Results:
The Help page does not explain the "Context" option.

Expected Results:
The Help page explains the "Context" option.


Reproducible: Always


User Profile Reset: No

Additional Info:
https://help.libreoffice.org/25.2/en-US/text/shared/optionen/01150300.html
Comment 1 Tuomas Hietala 2025-05-06 12:01:28 UTC
On a second look, the Help page also describes a "Hindi" option which doesn't exist in the UI, where there's a "Eastern Arabic" option instead.
Comment 2 Olivier Hallot 2025-05-13 13:51:50 UTC
relevant pointers:

https://bugs.documentfoundation.org/show_bug.cgi?id=102235

tdf@tdf:~/git/core (master)$ git grep -n NUMERALS_CONTEXT
compilerplugins/clang/unusedenumconstants.readonly.results:722:    enum SvtCTLOptions::TextNumerals NUMERALS_CONTEXT
include/svl/ctloptions.hxx:69:        NUMERALS_CONTEXT
sw/source/core/text/inftxt.cxx:1705:    // cannot cache for NUMERALS_CONTEXT because we need to know the string
sw/source/core/text/inftxt.cxx:1707:    if (nTextNumerals != SvtCTLOptions::NUMERALS_CONTEXT)


By reading the C++ code it seems that "Context" means "none of the choice above", being the document default numeral setting.

Need confirmation on this assumption.
Comment 3 Laurent Balland 2025-05-13 15:31:49 UTC
Created attachment 200784 [details]
Example of variation of numbering type with "Context" option

From my tests, this option is inherited from OOo. It seems that:
- Arabic: whatever if you type western or eastern texts, all numbering will use 1, 2, 3... digits
- Eastern Arabic: whatever if you type western or eastern texts, all numbering will use ١‎, ٢‎, ٣... digits
- System: whatever if you type western or eastern texts, all numbering will use the digits defined in your system
- Context: digits are chosen according the surrounding text. It enables to have both type of numbering in the same document

You may test the attached document with various option for Numerals (you need to add or remove a paragraph in the numbered list to update it).
Comment 4 Laurent Balland 2025-05-13 15:41:46 UTC
From my reading of C++ code, language of numbering is chosen here:
https://opengrok.libreoffice.org/xref/core/editeng/source/editeng/impedit3.cxx#4682
As "Context" preserves the current language, it enables to use digit from other alphabets than English or Arabic alphabet (for instance Thai or Tibetan in attachment 200784 [details]).
Comment 5 Caolán McNamara 2025-05-13 16:12:53 UTC
There's always been confusion about the naming of these. This is a feature that if document text has the digits 0-9 in it then they are optionally replaced by alternative digits. This replacement happens in vcl/source/outdev/text.cxx via GetLocalizedChar in that file.

With "Arabic" (the default) then 123... is not replaced by anything else. The reference language is "LANGUAGE_ENGLISH"

With "Eastern Arabic" then 123... is replaced with ١٢٣. The reference language is "LANGUAGE_ARABIC_SAUDI_ARABIA". (Docs that still refer to this as "Hindi" numerals probably should be updated to use this naming.)

With "System", then 123... is replaced by whatever digits are implied as suitable by "Locale Setting" of "tools, options, languages and locales, general, locale setting. Which is retrieved via "Application::GetSettings().GetLanguageTag()" in the code.

With "Context", then as an example pasting this line as plain text into writer:
اَلْعَرَبِيَّةُ123 English123
will try and decide by context what language 123 is in and use that reference language to substitute the digits, so what is displayed in this case is
اَلْعَرَبِيَّةُ١٢٣ English123. Selecting the text and changing via format character, complex, language to other things like Amharic, Burmese, Odia, etc might render it differently by changing the language seen as the context.
Comment 6 Laurent Balland 2025-05-13 16:24:31 UTC
Help text to be fixed:
https://opengrok.libreoffice.org/xref/help/source/text/shared/optionen/01150300.xhp#61
Comment 7 Laurent Balland 2025-05-13 18:24:56 UTC
Is this help text exact and sufficient?
Context: Numbers are shown using Arabic, Eastern Arabic or other numerals, according to the locale settings defined by the context: surrounding text or character format. Digits can then be rendered in other languages (Amharic, Burmese, Odia, etc.).
Comment 8 Commit Notification 2025-05-24 11:41:40 UTC
Laurent Balland committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/c0646cd11e80fda95143a448366ced5f01f79a13

tdf#166477 Add help for "Context" option in numerals