summaryrefslogtreecommitdiff
path: root/ext/bg/data
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/data
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/data')
-rw-r--r--ext/bg/data/options-schema.json43
1 files changed, 42 insertions, 1 deletions
diff --git a/ext/bg/data/options-schema.json b/ext/bg/data/options-schema.json
index a22ae8a1..12c4097d 100644
--- a/ext/bg/data/options-schema.json
+++ b/ext/bg/data/options-schema.json
@@ -592,7 +592,8 @@
"convertAlphabeticCharacters",
"convertHiraganaToKatakana",
"convertKatakanaToHiragana",
- "collapseEmphaticSequences"
+ "collapseEmphaticSequences",
+ "textReplacements"
],
"properties": {
"convertHalfWidthCharacters": {
@@ -624,6 +625,46 @@
"type": "string",
"enum": ["false", "true", "full"],
"default": "false"
+ },
+ "textReplacements": {
+ "type": "object",
+ "required": [
+ "searchOriginal",
+ "groups"
+ ],
+ "properties": {
+ "searchOriginal": {
+ "type": "boolean",
+ "default": true
+ },
+ "groups": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "required": [
+ "pattern",
+ "ignoreCase",
+ "replacement"
+ ],
+ "properties": {
+ "pattern": {
+ "type": "string",
+ "default": ""
+ },
+ "ignoreCase": {
+ "type": "boolean",
+ "default": false
+ },
+ "replacement": {
+ "type": "string",
+ "default": ""
+ }
+ }
+ }
+ }
+ }
+ }
}
}
},