Bug 91665 - l10n: replace string lists that are groups of unrelated items by separate strings
Summary: l10n: replace string lists that are groups of unrelated items by separate str...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.3.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2015-05-27 13:50 UTC by David Tardon
Modified: 2017-02-14 08:57 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Tardon 2015-05-27 13:50:30 UTC
The resource format (.src) used for localization allows to group related strings into lists. These can be used, e.g., to represent values for a list box. However, string lists are sometimes (mis)used to group unrelated items; the advantage(?) being that only one identifier needs to be defined for the whole group. The items are then referenced by index, which is rather fragile when they are used in different parts of UI.

A prime example of this is STR_PRINTOPTUI in sw/source/ui/config/optdlg.src, which contains writer-specific strings for the print dialog. There are ~30 strings in it, including labels, tab headings, items of various list boxes, etc. The string list is then used in sw/source/core/view/printdata.cxx as follows:

ResStringArray aLocalizedStrings( SW_RES( STR_PRINTOPTUI ) );
...
OUString aAppGroupname( aLocalizedStrings.GetString( 0 ) );
...

String lists like this one should be replaced by separate strings. This requires to do the following:

1. Define an identifier for each string in the list in a convenient .hrc file (presumably the one where the string list's identifier is defined). Remove the definition of the string list identifier.
2. Split the StringArray definition in .src into separate String definitions.
3. Replace all uses of the string list in .cxx files by use of the separate strings. E.g., in the above example, aLocalizedStrings.GetString( 0 ) would be replaced by something like SW_RES( STR_PRINTOPTUI_APPGROUPNAME ).
Comment 1 Juergen Funk (CIB) 2015-12-09 21:51:31 UTC
I have solve here https://gerrit.libreoffice.org/20557
Comment 2 Robinson Tryon (qubit) 2015-12-10 11:40:57 UTC Comment hidden (obsolete)
Comment 3 Commit Notification 2015-12-10 13:16:59 UTC
Juergen Funk committed a patch related to this issue.
It has been pushed to "master":

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

tdf#91665 l10n: replace string lists - by separate strings

It will be available in 5.2.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 4 Robinson Tryon (qubit) 2016-02-18 14:52:17 UTC Comment hidden (obsolete)
Comment 5 jani 2016-04-18 07:12:25 UTC
Still working on this?
Comment 6 David Tardon 2016-04-19 07:27:28 UTC
There are more of these, e.g., in basctl/source/basicide/basicrenderable.cxx or starmath/source/unomodel.cxx . To find such lists is a part of the task.
Comment 7 jani 2016-04-19 07:38:19 UTC
Putting it on ASSIGN, as there is an Assigned person
Comment 8 Muhammet Kara 2016-07-29 08:04:34 UTC
I have submitted two patches related to this bug report.[0][1]

[0] https://gerrit.libreoffice.org/#/c/27641/
[1] https://gerrit.libreoffice.org/#/c/27665/
Comment 9 Commit Notification 2016-07-29 21:34:16 UTC
Muhammet Kara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#91665 l10n: Replace string list by separate strings in ScPrintUIOptions

It will be available in 5.3.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 10 Commit Notification 2016-08-01 06:23:03 UTC
Muhammet Kara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#91665 l10n: Replace string list by separate strings in SmPrintUIOptions

It will be available in 5.3.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 11 Commit Notification 2016-08-01 06:23:07 UTC
Muhammet Kara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#91665 l10n: replace string lists - by separate strings

It will be available in 5.3.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 12 Muhammet Kara 2016-08-01 07:52:51 UTC
Is there any other string array to be separated? (I couldn't find any.) If not, this bug seems solved.
Comment 13 jani 2016-08-01 07:54:57 UTC
(In reply to Muhammet Kara from comment #12)
> Is there any other string array to be separated? (I couldn't find any.) If
> not, this bug seems solved.