diff --git a/ext/js/language/la/latin-text-preprocessors.js b/ext/js/language/la/latin-text-preprocessors.js
new file mode 100644
index 0000000000..42ea0c5f80
--- /dev/null
+++ b/ext/js/language/la/latin-text-preprocessors.js
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2024 Yomitan Authors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/** @type {import('language').BidirectionalConversionPreprocessor} */
+export const processDiphtongs = {
+ name: 'Convert æ to ae',
+ description: 'æ → ae, Æ → AE, œ → oe, Œ → OE',
+ options: ['off', 'direct', 'inverse'],
+ process: (str, setting) => {
+ switch (setting) {
+ case 'off':
+ return str;
+ case 'direct':
+ return str.replace(/æ/g, 'ae')
+ .replace(/Æ/g, 'AE')
+ .replace(/œ/g, 'oe')
+ .replace(/Œ/g, 'OE');
+ case 'inverse':
+ return str.replace(/ae/g, 'æ')
+ .replace(/AE/g, 'Æ')
+ .replace(/oe/g, 'œ')
+ .replace(/OE/g, 'Œ');
+ }
+ },
+};
diff --git a/ext/js/language/language-descriptors.js b/ext/js/language/language-descriptors.js
index 4ae43642d2..85976621d6 100644
--- a/ext/js/language/language-descriptors.js
+++ b/ext/js/language/language-descriptors.js
@@ -37,6 +37,7 @@ import {japaneseTransforms} from './ja/japanese-transforms.js';
import {isStringPartiallyJapanese} from './ja/japanese.js';
import {disassembleHangul, reassembleHangul} from './ko/korean-text-processors.js';
import {koreanTransforms} from './ko/korean-transforms.js';
+import {processDiphtongs} from './la/latin-text-preprocessors.js';
import {latinTransforms} from './la/latin-transforms.js';
import {removeRussianDiacritics, yoToE} from './ru/russian-text-preprocessors.js';
import {oldIrishTransforms} from './sga/old-irish-transforms.js';
@@ -206,6 +207,7 @@ const languageDescriptors = [
textPreprocessors: {
...capitalizationPreprocessors,
removeAlphabeticDiacritics,
+ processDiphtongs,
},
languageTransforms: latinTransforms,
},
diff --git a/types/ext/language-descriptors.d.ts b/types/ext/language-descriptors.d.ts
index c1c8d2d89d..82c46acb38 100644
--- a/types/ext/language-descriptors.d.ts
+++ b/types/ext/language-descriptors.d.ts
@@ -129,7 +129,9 @@ type AllTextProcessors = {
pre: CapitalizationPreprocessors & AlphabeticDiacriticsProcessor;
};
la: {
- pre: CapitalizationPreprocessors & AlphabeticDiacriticsProcessor;
+ pre: CapitalizationPreprocessors & AlphabeticDiacriticsProcessor & {
+ processDiphtongs: BidirectionalConversionPreprocessor;
+ };
};
lo: Record;
lv: {