Apache OpenOffice (AOO) Bugzilla – Issue 40720
The name of default color schems not localizable
Last modified: 2005-04-10 21:15:16 UTC
Hi, the name of the default color schema (Tools - Options - OpenOffice.org - Appearance) is always "Default". The string "Default" is not localizable. See the attached screenshot of Czech version. Is it possible to make it localizable?
Created attachment 21545 [details] String "Default" is not localizable
This is rather hard to do: The list of color schema names is editable. Arbitrary entry names can be supplied by the user. Entries (including the "Default" one) can be removed, as long as at least one entry remains. In multi-lingual installs the list of color schemes and the setting that selects a color scheme are shared between languages. Without a major change in the way the color schemes are managed and referenced, the only way to add localizability to the Default color scheme name is to put this into the UI layer: The well-known stored name "Default" is recognized and remapped to a translated name for display. But that creates several problem scenarios: What happens, if the user has (in a different locale) created a color scheme named the same as the mapped name in the current locale? And what happens, if the user attempts to create a custom scheme named "Default"? The collision is not visible to the user. Please provide a specification for the desired behavior, particularly considering multi-lingugal installs and language packs. Examples of what to consider: If I (as a user) add a Color Scheme called "Standard" and delete the "Default" one and then start the application in a Czech locale, what should happen? What if I happen to use the name that "Default" is translated to in Czech for my private color scheme (while running under a non-Czech version)? What if I modify the "Default" scheme and then switch languages? If you want to have a look at fixing this yourself, the relevant files are: - officecfg/registry/schema/org/openoffice/Office.UI.xcs - officecfg/registry/data/org/openoffice/Office/UI.xcu - svtools/source/config/colorcfg.cxx - svx/source/dialogs/optcolor.cxx
jb: thanks for your insight! I'll try to think about it soon.
After discussing this with jb on IRC, I'd like to propose the following solution for now: Change the name of the default scheme from "Default" to %PRODUCTNAME. What this means? + Localized versions won't see the name "Default" in their UI. Even German version have the word "Default" in the UI. - This is UI change though small. - Help is affected: pavel@linux:~/.ooo/ooo_SRC680_m72_src/helpcontent2> grep Default source/text/sha red/optionen/01012000.xhp <paragraph role="paragraph" id="par_id3150400" xml-lang="en-US" l10n="U" oldref="12"><ahelp hid="SVX_PUSHBUTTON_RID_SVXPAGE_COLORCONFIG_PB_DELETESCHEME">Deletes the color scheme shown in the <emph>Scheme</emph> box. You cannot delete the Default scheme.</ahelp></paragraph> pavel@linux:~/.ooo/ooo_SRC680_m72_src/helpcontent2> JoergB confirmed that he can delete the schema "Default": <JoergB> paveljanik: I tried and I could. Might be a bug. I had a very quick look at optcolor.cxx and did not see a check for this either. <JoergB> paveljanik: same in 1.1.3: You can delete the "Default" scheme although the help tells otherwise. <JoergB> paveljanik: In reality the restriction is that you have to leave at least 1 scheme. So you cannot delete the *last* scheme remaining. <JoergB> paveljanik: So the only reference to this in the help is wrong :-o -> help is wrong anyway. So, I'd like to propose this: - rename Default to %PRODUCTNAME (to be tested) - rewriting this help string accordingly This all is doable for 2.0 because it doesn't have large impact. Is it ok?
Hi Christian, After talking to Liz, it appears you should have a look at this issue. The current actual behavior is, that we have a completely user-editable list of schemes. The default entry is not treated specially in any way: it can be modified or removed completely. The only constraint is that at least one scheme remains. The default entry has the name "Default" - in any language. This name is not hardcoded in the code. It is present only in the configuration data. As schemes are referred to by name, these names also act as 'programmatic names'. This means they can't easily be made localizable directly in the configuration. The least invasive technical solution would be to choose a language-neutral name for the default entry. I mentioned some problems with camouflaging the programmatic name with a language-dependent one above (concerning in particular multi-lingual installations). Interestingly the help states that 'the Default scheme cannot be removed', where "Default" is treated as translatable string ("Das Standardschema kann nicht gelöscht werden.") This deviates from the real behavior and has no connection to the locale-independent naming "default". I think "default" is a word that most people not speaking English (and even some that think they do) don't know at all, so I think any change to get rid of it in localized versions would be useful. Pavel's proposal addresses this without requiring changes to the existing implementation (only configuration data needs to be changed).
So, I'd like to propose this: - rename Default to %PRODUCTNAME (to be tested) - rewriting this help string accordingly This all is doable for 2.0 because it doesn't have large impact. Is it ok? CJ: It seems OK, but must be tested. However, we found some more issues in the functionality of the scheme dialog. But they are for Office Later.
jb: I have tried changing the string Default in UI.xcu: Index: UI.xcu =================================================================== RCS file: /cvs/util/officecfg/registry/data/org/openoffice/Office/UI.xcu,v retrieving revision 1.30 diff -u -r1.30 UI.xcu --- UI.xcu 17 Nov 2004 08:17:07 -0000 1.30 +++ UI.xcu 18 Jan 2005 20:48:25 -0000 @@ -326,7 +326,7 @@ </node> <node oor:name="ColorScheme"> <node oor:name="ColorSchemes"> - <node oor:name="Default" oor:op="replace"> + <node oor:name="${PRODUCTNAME}" oor:op="replace"> <node oor:name="DocColor"> <prop oor:name="Color"> <value xsi:nil="true"/> But it doesn't work, it is not replaced. I have also tried %PRODUCTNAME but it seems that %PRODUCTNAME expansion doesn't take place here. Can you help?
Created attachment 21764 [details] Proposed patch
The attached patch contains the following changes: - replace "Default" with "${PRODUCTNAME}" in officecfg/registry/data/org/openoffice/Office/UI.xcu This means that the "Default" color scheme will be named according to the PRODUCTNAME ("OpenOffice.org" for OpenOffice.org). - replace "Default" with "${PRODUCTNAME}" in officecfg/registry/schema/org/openoffice/Office/UI.xcs This means that The new color scheme named OpenOffice.org (in case of OpenOffice.org) will be also pre-selected in Tools - Options - OpenOffice.org - Appearance dialog. - adding SCPZIP_REPLACE style for both files to actually make the replacement I have tested these patches on all platforms I build on (Windows, GNU/Linux/x86 and Solaris/SPARC). jb: do you have any cws into which you can incorporate this change?
Sorry, I don't currently have a matching CWS. A comment on the patch: A default in a schema (xcs) file should never be changed. It certainly should not depend on the product, version or environment it is in. Such customizations belong in the xcu file. Thus an xcs file should never have the SCPZIP_REPLACE flag set. If a customizable default is misplaced in a xcs file today, it should at most be removed. Thus the patch should be changed as follows: - In scp2/source/ooo/file_ooo.scp add the SCPZIP_REPLACE only to the xcu file - Drop the xcs diff, or change it so that it just removes the default - Change the xcu diff, so that it sets the current scheme to match the scheme that it adds The resulting patch in officecfg, that results in a selfsustained xcu file, could be (untested!): Index: registry/data/org/openoffice/Office/UI.xcu =================================================================== RCS file: /cvs/util/officecfg/registry/data/org/openoffice/Office/UI.xcu,v retrieving revision 1.30 diff -u -r1.30 UI.xcu --- registry/data/org/openoffice/Office/UI.xcu 17 Nov 2004 08:17:07 -0000 1.30 +++ registry/data/org/openoffice/Office/UI.xcu 24 Jan 2005 13:49:30 -0000 @@ -325,8 +325,11 @@ </node> </node> <node oor:name="ColorScheme"> + <prop oor:name="CurrentColorScheme"> + <value>${PRODUCTNAME}</value> + </prop> <node oor:name="ColorSchemes"> - <node oor:name="Default" oor:op="replace"> + <node oor:name="${PRODUCTNAME}" oor:op="replace"> <node oor:name="DocColor"> <prop oor:name="Color"> <value xsi:nil="true"/> Index: registry/schema/org/openoffice/Office/UI.xcs =================================================================== RCS file: /cvs/util/officecfg/registry/schema/org/openoffice/Office/UI.xcs,v retrieving revision 1.25 diff -u -r1.25 UI.xcs --- registry/schema/org/openoffice/Office/UI.xcs 25 Oct 2004 10:36:43 -0000 1.25 +++ registry/schema/org/openoffice/Office/UI.xcs 24 Jan 2005 13:49:34 -0000 @@ -597,7 +597,6 @@ <info> <desc>Specifies the name of the columns selected for inserting data into text or fields, plus inserted text and line breaks.</desc> </info> - <value>Default</value> </prop> <set oor:name="ColorSchemes" oor:node-type="ColorScheme"> <!-- UIHints: Tools / Options / Star|OpenOffice / Appearance -->
Created attachment 22004 [details] New patch according to jb's comments
jb: new version attached. OK to commit?
Looks good. Go ahead.
OK, fixed in pj18.
verified in pj18.
Closing.