Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/blockly/core/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import * as utilsXml from './utils/xml.js';
import type {Workspace} from './workspace.js';
import type {WorkspaceSvg} from './workspace_svg.js';

const nameComparisonCollator = new Intl.Collator(undefined, {
sensitivity: 'base',
});

/**
* String for use in the "custom" attribute of a category in toolbox XML.
* This string indicates that the category should be dynamically populated with
Expand Down Expand Up @@ -805,9 +809,7 @@ export function compareByName(
var1: IVariableModel<IVariableState>,
var2: IVariableModel<IVariableState>,
): number {
return var1
.getName()
.localeCompare(var2.getName(), undefined, {sensitivity: 'base'});
return nameComparisonCollator.compare(var1.getName(), var2.getName());
}

/**
Expand Down
Loading