aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/options.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-03 12:12:55 -0500
committerGitHub <noreply@github.com>2021-01-03 12:12:55 -0500
commit8e304b83c685dde17a00d402877a21303b7c11f2 (patch)
tree0b2123575502c3e3cb5127582b03e9c196c9891d /ext/bg/js/options.js
parenteda8534e195d653ee0dea36f70caed0d8d49acf1 (diff)
Translator regex replacements (#1199)
* Add support for regex replacements during the translation process * Allow assignment of textReplacements * Rename * Set up test data * Write expected data * Set up options * Prevent infinite loop if regex matches empty string * Implement setting controller * Add support for testing pattern replacements
Diffstat (limited to 'ext/bg/js/options.js')
-rw-r--r--ext/bg/js/options.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 5c68e77c..16168e38 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -485,6 +485,10 @@ class OptionsUtil {
{
async: false,
update: this._updateVersion7.bind(this)
+ },
+ {
+ async: false,
+ update: this._updateVersion8.bind(this)
}
];
}
@@ -675,4 +679,16 @@ class OptionsUtil {
}
return options;
}
+
+ _updateVersion8(options) {
+ // Version 8 changes:
+ // Added translation.textReplacements.
+ for (const profile of options.profiles) {
+ profile.options.translation.textReplacements = {
+ searchOriginal: true,
+ groups: []
+ };
+ }
+ return options;
+ }
}