https://bugs.documentfoundation.org/show_bug.cgi?id=91665
Bug ID: 91665
Summary: l10n: replace string lists that are groups of
unrelated items by separate strings
Product: LibreOffice
Version: unspecified
Hardware: Other
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: LibreOffice
Assignee: [email protected]
Reporter: [email protected]
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 ).
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs