Page MenuHomeWildfire Games

use non-breaking space in 0 A.D.
ClosedPublic

Authored by Nescio on Feb 5 2020, 4:17 PM.

Details

Reviewers
Gallaecio
bb
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP27786: Make the space in 0 A.D. non-breaking throughout the codebase.
Summary

This patch replaces the normal space in “0 A.D.” with a non-breaking space to ensure the “0” and the “A” are always together.

Test Plan

Check for completeness (grep -r '0 A.D.'), agree this is an improvement.

Event Timeline

Nescio created this revision.Feb 5 2020, 4:17 PM
Owners added subscribers: Restricted Owners Package, Restricted Owners Package, Restricted Owners Package.Feb 5 2020, 4:17 PM
Vulcan added a comment.Feb 5 2020, 4:22 PM

Build failure - The Moirai have given mortals hearts that can endure.

Linter detected issues:
Executing section Source...
Executing section JS...

binaries/data/mods/public/gui/pregame/userreport/userreport.js
|  81| »   »   »   setStringTags(translate("Thank·you·for·helping·improve·0 A.D.!"),·{·"font":·"sans-bold-16"·})·+·"\n\n"·+
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/pregame/userreport/userreport.js
|  86| »   »   »   setStringTags(translate("Help·improve·0 A.D.!"),·{·"font":·"sans-bold-16"·})·+·"\n\n"·+
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/mod/gui/modmod/validatemod_test.js
|   5| »   »   "label":·"0 A.D.·Empires·Ascendant",
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/mod/gui/modmod/validatemod_test.js
|  13| »   »   "label":·"0 A.D.·Terra·Magna",
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/mod/gui/modmod/validatemod_test.js
|  15| »   »   "description":·"Adds·various·civilizations·to·0 A.D.",
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/mod/gui/modmod/validatemod_test.js
|  21| »   »   "label":·"0 A.D.·Medieval·Extension",
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/pregame/MainMenuItems.js
|   8| »   »   »   »   "tooltip":·translate("Open·the·0 A.D.·Game·Manual."),
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/pregame/MainMenuItems.js
|  25| »   »   »   »   "tooltip":·colorizeHotkey(translate("%(hotkey)s:·View·the·structure·tree·of·civilizations·featured·in·0 A.D."),·"structree"),
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/pregame/MainMenuItems.js
|  37| »   »   »   »   "tooltip":·colorizeHotkey(translate("%(hotkey)s:·Learn·about·the·civilizations·featured·in·0 A.D."),·"civinfo"),
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/pregame/MainMenuItems.js
| 181| »   »   »   »   »   translate("Are·you·sure·you·want·to·quit·0 A.D.·and·open·the·Scenario·Editor?"),
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/pregame/MainMenuItems.js
| 194| »   »   "tooltip":·translate("Show·the·0 A.D.·credits."),
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/pregame/MainMenuItems.js
| 205| »   »   »   »   translate("Are·you·sure·you·want·to·quit·0 A.D.?"),
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/maps/tutorials/Introductory_Tutorial.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/maps/tutorials/Introductory_Tutorial.js
| 381| 381| 	let position = Engine.QueryInterface(target, IID_Position).GetPosition2D();
| 382| 382| 
| 383| 383| 	this.attackers = cmpRangeManager.GetEntitiesByPlayer(this.enemyID).filter(e =>
| 384|    |-			Engine.QueryInterface(e, IID_Identity) && Engine.QueryInterface(e, IID_UnitAI) &&
|    | 384|+		Engine.QueryInterface(e, IID_Identity) && Engine.QueryInterface(e, IID_UnitAI) &&
| 385| 385| 			Engine.QueryInterface(e, IID_Identity).HasClass("CitizenSoldier")
| 386| 386| 		);
| 387| 387| 	this.attackers.forEach(e => { Engine.QueryInterface(e, IID_UnitAI).WalkAndFight(position.x, position.y, { "attack": ["Unit"] }, false); });
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/maps/tutorials/Introductory_Tutorial.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/maps/tutorials/Introductory_Tutorial.js
| 383| 383| 	this.attackers = cmpRangeManager.GetEntitiesByPlayer(this.enemyID).filter(e =>
| 384| 384| 			Engine.QueryInterface(e, IID_Identity) && Engine.QueryInterface(e, IID_UnitAI) &&
| 385| 385| 			Engine.QueryInterface(e, IID_Identity).HasClass("CitizenSoldier")
| 386|    |-		);
|    | 386|+	);
| 387| 387| 	this.attackers.forEach(e => { Engine.QueryInterface(e, IID_UnitAI).WalkAndFight(position.x, position.y, { "attack": ["Unit"] }, false); });
| 388| 388| };
| 389| 389| 

binaries/data/mods/public/maps/tutorials/Introductory_Tutorial.js
|   3| »   »   "instructions":·markForTranslation("Welcome·to·the·0 A.D.·tutorial."),
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/pregame/ProjectInformation.js
|  34| »   »   "tooltip":·translate("Click·to·open·the·0 A.D.·IRC·chat·in·your·browser.·(#0ad·on·webchat.quakenet.org)"),
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/pregame/ProjectInformation.js
|  42| »   »   "tooltip":·translate("Click·to·visit·0 A.D.·Trac·to·report·a·bug,·crash,·or·error."),
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/pregame/ProjectInformation.js
|  50| »   »   "tooltip":·translate("Click·to·open·the·0 A.D.·translate·page·in·your·browser."),
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/pregame/SplashscreenHandler.js
|  49| »   »   »   sprintf(translate("%(warning)s·You·appear·to·be·using·non-shader·(fixed·function)·graphics.·This·option·will·be·removed·in·a·future·0 A.D.·release,·to·allow·for·more·advanced·graphics·features.·We·advise·upgrading·your·graphics·card·to·a·more·recent,·shader-compatible·model."),·{
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/loadgame/SavegameLoader.js
|  39| »   »   »   »   message·+=·sprintf(translate("This·savegame·needs·0 A.D.·version·%(requiredVersion)s,·while·you·are·running·version·%(currentVersion)s."),·{
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/loadgame/SavegameLoader.js
|  44| »   »   »   »   message·+=·translate("This·savegame·needs·an·older·version·of·0 A.D.")·+·"\n";
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/mod/gui/modmod/validatemod.js
|  20| »   //·example:·"0 A.D.·-·Empires·Ascendant"
|    | [NORMAL] ESLintBear (no-irregular-whitespace):
|    | Irregular whitespace not allowed.

binaries/data/mods/mod/gui/modmod/validatemod.js
|  20| »   //·example:·"0 A.D.·-·Empires·Ascendant"
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/mod/gui/modmod/modmod.js
|    |++++| /zpool0/trunk/binaries/data/mods/mod/gui/modmod/modmod.js
| 381| 381| 
| 382| 382| 	g_ModsEnabled.sort((folder1, folder2) =>
| 383| 383| 		dependencies[folder1].indexOf(g_Mods[folder2].name) != -1 ? 1 :
| 384|    |-		dependencies[folder2].indexOf(g_Mods[folder1].name) != -1 ? -1 : 0);
|    | 384|+			dependencies[folder2].indexOf(g_Mods[folder1].name) != -1 ? -1 : 0);
| 385| 385| 
| 386| 386| 	g_ModsEnabledFiltered = displayModList("modsEnabledList", g_ModsEnabled);
| 387| 387| }

binaries/data/mods/mod/gui/modmod/modmod.js
|  10| ·*»   »   "label":·"0 A.D.·-·Empires·Ascendant",
|    | [NORMAL] ESLintBear (no-irregular-whitespace):
|    | Irregular whitespace not allowed.

binaries/data/mods/mod/gui/modmod/modmod.js
|  10| ·*»   »   "label":·"0 A.D.·-·Empires·Ascendant",
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1716/display/redirect

@elexis Can we disable the “nonbsp” check in Vulcan? I don’t think it applies to us. I think the only non-UTF-8 part we have was the editor or some parts of it, and this check seems to be for JavaScript files.

Gallaecio accepted this revision.Feb 9 2020, 3:09 PM
This revision is now accepted and ready to land.Feb 9 2020, 3:09 PM
Herald added a reviewer: Restricted Owners Package. · View Herald Transcript
bb accepted this revision.Oct 17 2021, 11:36 PM
bb added a subscriber: bb.

Agreeing on the change. Lobby policies need date update and patch needs a rebase. But reconstructing the patch is easier.

Ran the following commands

find ./binaries -name "*.xml" -type f -exec sed -i 's/0 A.D./0 A.D./g' {} \;
find ./binaries -name "*.txt" -type f -exec sed -i 's/0 A.D./0 A.D./g' {} \;
find ./binaries -name "*.js" -type f -exec sed -i 's/0 A.D./0 A.D./g' {} \;
find ./binaries -name "*.json" -type f -exec sed -i 's/0 A.D./0 A.D./g' {} \;

We should add a linter rule for this, so nobody will implement this again.

Silier removed reviewers: Silier, Restricted Owners Package.Nov 13 2021, 1:20 PM
Herald added a reviewer: Restricted Owners Package. · View Herald TranscriptNov 13 2021, 1:20 PM
This revision was landed with ongoing or failed builds.Jul 27 2023, 10:57 PM
This revision was automatically updated to reflect the committed changes.
Owners added subscribers: Restricted Owners Package, Restricted Owners Package, Restricted Owners Package and 2 others.Jul 27 2023, 10:57 PM