Skip to content

Commit

Permalink
remove redundant strings (#4182)
Browse files Browse the repository at this point in the history
  • Loading branch information
walterbender authored Dec 24, 2024
1 parent 61295c0 commit 721c5cf
Show file tree
Hide file tree
Showing 32 changed files with 99 additions and 98 deletions.
12 changes: 6 additions & 6 deletions js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -5789,11 +5789,11 @@ class Activity {
if (!this.helpfulWheelItems.find(ele => ele.label === "Home [HOME]"))
this.helpfulWheelItems.push({label: "Home [HOME]", icon: "imgsrc:data:image/svg+xml;base64," + window.btoa(base64Encode(GOHOMEFADEDBUTTON)), display: true, fn: findBlocks});

this.hideBlocksContainer = createButton(SHOWBLOCKSBUTTON, _("Show/hide block"),
this.hideBlocksContainer = createButton(SHOWBLOCKSBUTTON, _("Show/hide blocks"),
changeBlockVisibility);

if (!this.helpfulWheelItems.find(ele => ele.label === "Show/hide block"))
this.helpfulWheelItems.push({label: "Show/hide block", icon: "imgsrc:data:image/svg+xml;base64," + window.btoa(base64Encode(SHOWBLOCKSBUTTON)), display: true, fn: changeBlockVisibility});
if (!this.helpfulWheelItems.find(ele => ele.label === "Show/hide blocks"))
this.helpfulWheelItems.push({label: "Show/hide blocks", icon: "imgsrc:data:image/svg+xml;base64," + window.btoa(base64Encode(SHOWBLOCKSBUTTON)), display: true, fn: changeBlockVisibility});

this.collapseBlocksContainer = createButton(COLLAPSEBLOCKSBUTTON, _("Expand/collapse blocks"),
toggleCollapsibleStacks);
Expand Down Expand Up @@ -5837,8 +5837,8 @@ class Activity {
if (!this.helpfulWheelItems.find(ele => ele.label === "Select"))
this.helpfulWheelItems.push({label: "Select", icon: "imgsrc:data:image/svg+xml;base64," + window.btoa(base64Encode(SELECTBUTTON)), display: true, fn: this.selectMode });

if (!this.helpfulWheelItems.find(ele => ele.label === "Clean"))
this.helpfulWheelItems.push({label: "Clean", icon: "imgsrc:data:image/svg+xml;base64," + window.btoa(base64Encode(CLEARBUTTON)), display: true, fn: () => this._allClear(false)});
if (!this.helpfulWheelItems.find(ele => ele.label === "Clear"))
this.helpfulWheelItems.push({label: "Clear", icon: "imgsrc:data:image/svg+xml;base64," + window.btoa(base64Encode(CLEARBUTTON)), display: true, fn: () => this._allClear(false)});

if (!this.helpfulWheelItems.find(ele => ele.label === "Collapse"))
this.helpfulWheelItems.push({label: "Collapse", icon: "imgsrc:data:image/svg+xml;base64," + window.btoa(base64Encode(COLLAPSEBUTTON)), display: true, fn: this.turtles.collapse});
Expand Down Expand Up @@ -7185,4 +7185,4 @@ define(MYDEFINES, (compatibility) =>{
activity.setupDependencies();
activity.doContextMenus();
activity.doPluginsAndPaletteCols();
});
});
8 changes: 4 additions & 4 deletions js/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -3758,20 +3758,20 @@ class Block {
gridLabels = [
_("Cartesian"),
_("polar"),
_("Cartesian+polar"),
_("Cartesian/Polar"),
_("none")
];
gridValues = [
"Cartesian",
"polar",
"Cartesian+polar",
"Cartesian/Polar",
"none"
];
} else {
gridLabels = [
_("Cartesian"),
_("polar"),
_("Cartesian+polar"),
_("Cartesian/Polar"),
_("treble"),
_("grand staff"),
_("mezzo-soprano"),
Expand All @@ -3783,7 +3783,7 @@ class Block {
gridValues = [
"Cartesian",
"polar",
"Cartesian+polar",
"Cartesian/Polar",
"treble",
"grand staff",
"mezzo-soprano",
Expand Down
2 changes: 1 addition & 1 deletion js/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -5088,7 +5088,7 @@ class Blocks {
if (["show", "turtleshell", "customsample"].includes(blockObjs[i][1])) {
switch (blockObjs[i][1]) {
case "show":
name = _("show") + "-" + MathUtility.doRandom(0, 1000);
name = _("Show").toLowerCase() + "-" + MathUtility.doRandom(0, 1000);
break;
case "turtleshell":
name = _("avatar") + "-" + MathUtility.doRandom(0, 1000);
Expand Down
6 changes: 3 additions & 3 deletions js/blocks/ExtrasBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function setupExtrasBlocks(activity) {
* Creates an instance of HideBlocksBlock.
*/
constructor() {
super("hideblocks", _("hide blocks"));
super("hideblocks", _("Hide blocks").toLowerCase());
this.setPalette("extras", activity);
this.setHelpString([_("The Hide blocks block hides the blocks."), "documentation", ""]);
}
Expand Down Expand Up @@ -620,8 +620,8 @@ function setupExtrasBlocks(activity) {
case "polar":
act._showPolar();
break;
case _("Cartesian+polar"):
case "Cartesian+polar":
case _("Cartesian/Polar"):
case "Cartesian/Polar":
act._showPolar();
act._showCartesian();
break;
Expand Down
4 changes: 2 additions & 2 deletions js/blocks/FlowBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function setupFlowBlocks(activity) {

// Form the block with specific parameters
this.formBlock({
name: _("duplicate"),
name: _("Duplicate").toLowerCase(),
args: 1,
defaults: [2]
});
Expand Down Expand Up @@ -601,7 +601,7 @@ function setupFlowBlocks(activity) {

// Form the block with specific parameters
this.formBlock({
name: _("stop"),
name: _("Stop").toLowerCase(),
flows: {
top: true,
bottom: "tail",
Expand Down
2 changes: 1 addition & 1 deletion js/blocks/GraphicsBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ function setupGraphicsBlocks(activity) {
*/
constructor() {
// Call the constructor of the parent class
super("clear", _("clear"));
super("clear", _("Clear").toLowerCase());

// Set the palette and activity for the Clear block
this.setPalette("graphics", activity);
Expand Down
6 changes: 3 additions & 3 deletions js/blocks/MediaBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ function setupMediaBlocks(activity) {
this.formBlock({
args: 2,
defaults: [392, 1000 / 3],
argLabels: [_("frequency"), _("duration (ms)")]
argLabels: [_("frequency"), _("duration (MS)")]
});

// Form block with specified connections
Expand Down Expand Up @@ -885,7 +885,7 @@ function setupMediaBlocks(activity) {
// Form block with name, arguments, default values, and labels
this.formBlock({
//.TRANS: show1 is show as in display an image or text on the screen.
name: this.lang === "ja" ? _("show1") : _("show"),
name: this.lang === "ja" ? _("show1") : _("Show").toLowerCase(),
//.TRANS: a media object
args: 2,
argLabels: [_("size"), _("obj")],
Expand Down Expand Up @@ -927,7 +927,7 @@ function setupMediaBlocks(activity) {
* @constructor
*/
constructor() {
super("media", _("media"));
super("media", _("Media").toLowerCase());

// Set palette and activity for the block
this.setPalette("media", activity);
Expand Down
1 change: 1 addition & 0 deletions js/blocks/MeterBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ function setupMeterBlocks(activity) {
// Form block with name for the beats per minute
this.formBlock({
//.TRANS: number of beats played per minute
//.TRANS: in Japanese: "1分当たりの拍の数"
name: this.lang === "ja" ? _("beats per minute2") : _("beats per minute")
});
}
Expand Down
6 changes: 3 additions & 3 deletions js/blocks/PitchBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ function setupPitchBlocks(activity) {
]);
this.formBlock({
//.TRANS: pitch inversion rotates a pitch around another pitch
name: _("invert"),
name: _("Invert").toLowerCase(),
args: 3,
defaults: ["sol", 4, _("even")],
argTypes: ["solfegein", "anyin", "anyin"],
Expand Down Expand Up @@ -1703,7 +1703,7 @@ function setupPitchBlocks(activity) {
super("scaledegree", _("nth modal pitch"));
this.setPalette("pitch", activity);
this.setHelpString([
_("n^th Modal Pitch takes the pattern of pitches in semitones for a mode and makes each point a degree of the mode,") +
_("nth Modal Pitch takes the pattern of pitches in semitones for a mode and makes each point a degree of the mode,") +
" " +
_("starting from 1 and regardless of tonal framework (i.e. not always 8 notes in the octave)"),
"documentation",
Expand Down Expand Up @@ -1746,7 +1746,7 @@ function setupPitchBlocks(activity) {
this.setPalette("pitch", activity);
this.piemenuValuesC1 = [7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7];
this.setHelpString([
_("N^th Modal Pitch takes a number as an input as the n^th degree for the given mode. 0 is the first position, 1 is the second, -1 is the note before the first etc.") +
_("Nth Modal Pitch takes a number as an input as the nth degree for the given mode. 0 is the first position, 1 is the second, -1 is the note before the first etc.") +
" " +
_("The pitches change according to the mode specified without any need for respellings."),
"documentation",
Expand Down
4 changes: 2 additions & 2 deletions js/blocks/ToneBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function setupToneBlocks(activity) {
* Creates an instance of OscillatorBlock.
*/
constructor() {
super("oscillator", _("oscillator"));
super("oscillator", _("Oscillator").toLowerCase());
this.setPalette("tone", activity);
this.setHelpString();
this.formBlock({
Expand Down Expand Up @@ -627,7 +627,7 @@ function setupToneBlocks(activity) {
name: _("chorus"),
args: 3,
defaults: [1.5, 3.5, 70],
argLabels: [_("rate"), _("delay") + " (MS)", _("depth")]
argLabels: [_("rate"), _("delay (MS)"), _("depth")]
});
}

Expand Down
6 changes: 3 additions & 3 deletions js/blocks/WidgetBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function setupWidgetBlocks(activity) {
*/
constructor() {
//.TRANS: sound envelope (ADSR)
super("envelope", _("envelope"));
super("envelope", _("Envelope").toLowerCase());
this.setPalette("widgets", activity);
this.setHelpString();
this.formBlock({
Expand Down Expand Up @@ -168,7 +168,7 @@ function setupWidgetBlocks(activity) {
*/
constructor() {
//.TRANS: a filter removes some unwanted components from a signal
super("filter", _("filter"));
super("filter", _("Filter").toLowerCase());
this.setPalette("widgets", activity);
this.setHelpString();
this.formBlock({
Expand Down Expand Up @@ -1577,7 +1577,7 @@ function setupWidgetBlocks(activity) {
]);

//.TRANS: AI-generated music
this.formBlock({ name: _("aimusic"), canCollapse: true });
this.formBlock({ name: _("AI Music"), canCollapse: true });
this.makeMacro((x, y) => [
[0, "aimusic", x, y, [null, 1]],

Expand Down
2 changes: 1 addition & 1 deletion js/palette.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ class PaletteModel {
let label = "";
switch (protoBlock.name) {
case "grid":
label = _("grid");
label = _("Grid").toLowerCase();
break;
case "text":
label = _("text");
Expand Down
11 changes: 5 additions & 6 deletions js/piemenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -3582,7 +3582,7 @@ const piemenuGrid = (activity) => {
gridLabels = [
"Blank",
"Cartesian",
"Cartesian Polar",
"Cartesian/Polar",
"Polar",
"Blank"
];
Expand All @@ -3603,7 +3603,7 @@ const piemenuGrid = (activity) => {
gridLabels = [
"Blank",
"Cartesian",
"Cartesian Polar",
"Cartesian/Polar",
"Polar",
"Treble",
"Grand",
Expand Down Expand Up @@ -3848,11 +3848,10 @@ const piemenuKey = (activity) => {
activity.blocks.blockList[activity.blocks.blockList.length - 1].value =
activity.KeySignatureEnv[1];
activity.textMsg(
_("You have chosen key ") +
_("You have chosen key for your pitch preview.") +
activity.KeySignatureEnv[0] +
" " +
activity.KeySignatureEnv[1] +
_(" for your pitch preview.")
activity.KeySignatureEnv[1]
);
}
}
Expand Down Expand Up @@ -4011,4 +4010,4 @@ const piemenuKey = (activity) => {
if (j !== -1) {
modenameWheel.navigateWheel(j);
}
};
};
4 changes: 2 additions & 2 deletions js/rubrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,8 @@ const PALLABELS = [
_("number"),
_("flow"),
_("action"),
_("sensors"),
_("media"),
_("Sensors").toLowerCase(),
_("Media").toLowerCase(),
_("mice")
];

Expand Down
14 changes: 7 additions & 7 deletions js/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Toolbar {
["play", _("Play")],
["stop", _("Stop")],
["record",_("Record")],
["Full Screen", _("Full screen")],
["Full screen", _("Full screen")],
["FullScreen", _("Full screen")],
["Toggle Fullscreen", _("Toggle Fullscreen")],
["newFile", _("New project")],
Expand Down Expand Up @@ -110,8 +110,8 @@ class Toolbar {
_("Play"),
_("Stop"),
_("Record"),
_("Full Screen"),
_("Full Screen"),
_("Full screen"),
_("Full screen"),
_("Toggle Fullscreen"),
_("New project"),
_("Load project from file"),
Expand Down Expand Up @@ -175,8 +175,8 @@ class Toolbar {
["play", _("Play")],
["stop", _("Stop")],
["record", _("Record")],
["Full Screen", _("Full Screen")],
["FullScreen", _("Full Screen")],
["Full screen", _("Full screen")],
["FullScreen", _("Full screen")],
["Toggle Fullscreen", _("Toggle Fullscreen")],
["newFile", _("New project")],
["load", _("Load project from file")],
Expand Down Expand Up @@ -231,8 +231,8 @@ class Toolbar {
_("Play"),
_("Stop"),
_("Record"),
_("Full Screen"),
_("Full Screen"),
_("Full screen"),
_("Full screen"),
_("Toggle Fullscreen"),
_("New project"),
_("Load project from file"),
Expand Down
11 changes: 6 additions & 5 deletions js/turtleactions/IntervalsActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,28 @@ function setupIntervalsActions(activity) {
let os = numberToStringMap[Math.abs(octave) - 1] || Math.abs(octave);
if (totalIntervals % 12 === 0 && letterGap === 0) {
if (octave < 0) {
if (octave === -1) os = _('a')
const a = os + " " + _('perfect') + " " + plural + " " + _("below");
if (octave === -1) os = ""
const a = os + " " + _("perfect") + " " + plural + " " + _("below");
return a.charAt(0).toUpperCase() + a.slice(1);
}
if (octave > 1) {
const a = os + " " + _('perfect') + " " + plural + " " + _("above");
const a = os + " " + _("perfect") + " " + plural + " " + _("above");
return a.charAt(0).toUpperCase() + a.slice(1);
}
}

if (totalIntervals > 21) {
if (octave >= 1) {
lastWord = ", " + _('plus') + " " + os + " " + plural;
lastWord = ", " + _("plus") + " " + os + " " + plural;
}
while (totalIntervals > 12) totalIntervals -= 12;
}

if (octave < 0) {
letterGap = (letterGap !== 0) ? NOTENAMES.length - letterGap : letterGap;
if (octave < -1) lastWord = `, ${os} ${plural}`;
lastWord += _(' below')
lastWord += " "
lastWord += _("below")
}

let interval = (totalIntervals % 12 === 0 && letterGap === 0) ? SEMITONETOINTERVALMAP[totalIntervals][letterGap] : SEMITONETOINTERVALMAP[totalIntervals][letterGap] + lastWord;
Expand Down
Loading

0 comments on commit 721c5cf

Please sign in to comment.