Opened 12 years ago

Closed 9 years ago

#1029 closed task (fixed)

[PATCH] Spell colour/color properly

Reported by: Philip Taylor Owned by: ben
Priority: Nice to Have Milestone: Alpha 19
Component: Core engine Keywords: patch
Cc: Patch:

Description (last modified by dan_trev)

Currently the code and data files use a random mixture of "colour" and "color". To minimise confusion, we should change everything to use one form of spelling consistently. (Which form?) (There may be some other words with similar spelling problems.) (I don't think spelling in comments is worth caring about; only class names, XML element/attribute names, etc.)

Attachments (1)

VariableNames_Colour_to_Color_15728.diff (63.1 KB ) - added by dan_trev 10 years ago.
First pass / learning chance of colour to color

Download all attachments as: .zip

Change History (11)

comment:1 by Philip Taylor, 12 years ago

(For consistency with glColorPointer, wxColor, etc, maybe American spellings are better.)

in reply to:  1 comment:2 by historic_bruno, 12 years ago

Initialise/Initialize also comes to mind. A search in VS shows 1188 lines matching "color" and 390 matching "colour", maybe relevant if we choose to go with the most common usage. We also use both wxColor and wxColour, so we're not even consistent with library functions :)

comment:3 by Adrián Chaves, 11 years ago

Changes in this regard to user-visible strings have been applied as per #2185.

comment:4 by Josh, 11 years ago

Since we already use "color" more often that would probably be the better choice. And, personally, I would prefer "Initialize".

We will need to watch out for causing global namespace conflicts, but otherwise, simple text replacement should work.

comment:5 by dan_trev, 10 years ago

Description: modified (diff)

Attached is a ridiculously large patch that changes all the variable names (with a few exceptions) from colour to color.

The remaining offenders are in strings and/or reference XML entries.

The main exception is that wxWidgets uses colour. So wxColour and wxColourDialog references must remain unchanged. I changed ColourDialog to ColorDialog but that causes some weird color.colour combinations when calling the parent class wxColourDialog and may need removed.

The string renaming need more attention to get right. I did not observe any namespace issues within the variables - the XML could be different (I simply don't know).

by dan_trev, 10 years ago

First pass / learning chance of colour to color

comment:6 by Stan, 10 years ago

Keywords: review patch added
Summary: Spell colour/color properly[PATCH] Spell colour/color properly

comment:7 by Itms, 10 years ago

Milestone: BacklogAlpha 18

comment:8 by leper, 9 years ago

Keywords: review removed

Some issues (apart from the patch having some conflicts now):

  • Missing renames in simulation components which leads to compilation failures.
  • You change a comment in source/gui/GUIRenderer.cpp about allowed parts in the sprite attribute in the xml files, but you do not change the xml files.
  • You do not touch the JS code at all.
  • Having three patches (cpp, js, xml) or two that depend on each other would be fine, but just changing half of the codebase is a bit strange.
  • wxWidgets actually has both color and colour available (wxColor is defined as wxColour), so are there any specific cases where it does not work? If yes I guess upstream would like to know about those.

comment:9 by Itms, 9 years ago

Milestone: Alpha 18Alpha 19

comment:10 by ben, 9 years ago

Owner: set to ben
Resolution: fixed
Status: newclosed

In 16438:

Fixes inconsistencies in spelling of colour/color by preferring "color" (only wxWidgets remains with some API that requires "colour"), fixes #1029.
NOTE: requires update-workspaces and may require correction of some modded actors/scenarios

Note: See TracTickets for help on using tickets.