Skip to content

Commit

Permalink
Fix french text replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmaa committed Oct 17, 2024
1 parent a0ac41b commit 09722e0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
26 changes: 26 additions & 0 deletions ext/data/recommended-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,32 @@
"value": "word"
},
"description": "Lookup whole words in the dictionary."
},
{
"modification": {
"action": "set",
"path": "translation.textReplacements.groups",
"value": [
[
{
"pattern": "l'",
"ignoreCase": true,
"replacement": ""
},
{
"pattern": "j'",
"ignoreCase": true,
"replacement": ""
},
{
"pattern": "d'",
"ignoreCase": true,
"replacement": ""
}
]
]
},
"description": "Separating the l', j', d' from the word."
}
]
}
12 changes: 10 additions & 2 deletions ext/js/pages/settings/recommended-settings-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,15 @@ export class RecommendedSettingsController {
if (typeof setting === 'undefined') { continue; }
modifications.push(setting.modification);
}
void this._settingsController.modifyProfileSettings(modifications);
void this._settingsController.modifyProfileSettings(modifications).then(
(results) => {
results.map((result) => {
if (Object.hasOwn(result, 'error')) {
log.error(new Error(`Failed to apply recommended setting: ${JSON.stringify(result)}`));
}
});
},
);
void this._settingsController.refresh();
}
this._recommendedSettingsModal.hidden = true;
Expand All @@ -114,7 +122,7 @@ export class RecommendedSettingsController {
const pathCodeElement = document.createElement('code');
pathCodeElement.textContent = path;
const valueCodeElement = document.createElement('code');
valueCodeElement.textContent = String(value);
valueCodeElement.textContent = JSON.stringify(value, null, 2);

label.appendChild(document.createTextNode('Setting '));
label.appendChild(pathCodeElement);
Expand Down

0 comments on commit 09722e0

Please sign in to comment.