150 lines
6.2 KiB
Diff
150 lines
6.2 KiB
Diff
diff --git a/src/SettingsTab.ts b/src/SettingsTab.ts
|
|
index d0d65bb..2a211b0 100644
|
|
--- a/src/SettingsTab.ts
|
|
+++ b/src/SettingsTab.ts
|
|
@@ -33,10 +33,10 @@ export interface LanguageToolPluginSettings {
|
|
staticLanguage?: string;
|
|
motherTongue?: string;
|
|
|
|
- englishVeriety?: undefined | 'en-US' | 'en-GB' | 'en-CA' | 'en-AU' | 'en-ZA' | 'en-NZ';
|
|
- germanVeriety?: undefined | 'de-DE' | 'de-AT' | 'de-CH';
|
|
- portugueseVeriety?: undefined | 'pt-BR' | 'pt-PT' | 'pt-AO' | 'pt-MZ';
|
|
- catalanVeriety?: undefined | 'ca-ES' | 'ca-ES-valencia';
|
|
+ englishVariety?: undefined | 'en-US' | 'en-GB' | 'en-CA' | 'en-AU' | 'en-ZA' | 'en-NZ';
|
|
+ germanVariety?: undefined | 'de-DE' | 'de-AT' | 'de-CH';
|
|
+ portugueseVariety?: undefined | 'pt-BR' | 'pt-PT' | 'pt-AO' | 'pt-MZ';
|
|
+ catalanVariety?: undefined | 'ca-ES' | 'ca-ES-valencia';
|
|
|
|
pickyMode: boolean;
|
|
|
|
@@ -286,13 +286,13 @@ export class LanguageToolSettingsTab extends PluginSettingTab {
|
|
component.onChange(async value => {
|
|
this.plugin.settings.staticLanguage = value;
|
|
if (value !== 'auto') {
|
|
- this.plugin.settings.englishVeriety = undefined;
|
|
+ this.plugin.settings.englishVariety = undefined;
|
|
englishVarietyDropdown?.setValue('default');
|
|
- this.plugin.settings.germanVeriety = undefined;
|
|
+ this.plugin.settings.germanVariety = undefined;
|
|
germanVarietyDropdown?.setValue('default');
|
|
- this.plugin.settings.portugueseVeriety = undefined;
|
|
+ this.plugin.settings.portugueseVariety = undefined;
|
|
portugueseVarietyDropdown?.setValue('default');
|
|
- this.plugin.settings.catalanVeriety = undefined;
|
|
+ this.plugin.settings.catalanVariety = undefined;
|
|
catalanVarietyDropdown?.setValue('default');
|
|
}
|
|
await this.plugin.saveSettings();
|
|
@@ -338,14 +338,14 @@ export class LanguageToolSettingsTab extends PluginSettingTab {
|
|
'en-ZA': 'English (South Africa)',
|
|
'en-NZ': 'English (New Zealand)',
|
|
})
|
|
- .setValue(this.plugin.settings.englishVeriety ?? 'default')
|
|
+ .setValue(this.plugin.settings.englishVariety ?? 'default')
|
|
.onChange(async value => {
|
|
if (value === 'default') {
|
|
- this.plugin.settings.englishVeriety = undefined;
|
|
+ this.plugin.settings.englishVariety = undefined;
|
|
} else {
|
|
this.plugin.settings.staticLanguage = 'auto';
|
|
staticLanguageComponent?.setValue('auto');
|
|
- this.plugin.settings.englishVeriety = value as 'en-US' | 'en-GB' | 'en-CA' | 'en-AU' | 'en-ZA' | 'en-NZ';
|
|
+ this.plugin.settings.englishVariety = value as 'en-US' | 'en-GB' | 'en-CA' | 'en-AU' | 'en-ZA' | 'en-NZ';
|
|
}
|
|
await this.plugin.saveSettings();
|
|
});
|
|
@@ -360,14 +360,14 @@ export class LanguageToolSettingsTab extends PluginSettingTab {
|
|
'de-CH': 'German (Switzerland)',
|
|
'de-AT': 'German (Austria)',
|
|
})
|
|
- .setValue(this.plugin.settings.germanVeriety ?? 'default')
|
|
+ .setValue(this.plugin.settings.germanVariety ?? 'default')
|
|
.onChange(async value => {
|
|
if (value === 'default') {
|
|
- this.plugin.settings.germanVeriety = undefined;
|
|
+ this.plugin.settings.germanVariety = undefined;
|
|
} else {
|
|
this.plugin.settings.staticLanguage = 'auto';
|
|
staticLanguageComponent?.setValue('auto');
|
|
- this.plugin.settings.germanVeriety = value as 'de-DE' | 'de-CH' | 'de-AT';
|
|
+ this.plugin.settings.germanVariety = value as 'de-DE' | 'de-CH' | 'de-AT';
|
|
}
|
|
await this.plugin.saveSettings();
|
|
});
|
|
@@ -383,14 +383,14 @@ export class LanguageToolSettingsTab extends PluginSettingTab {
|
|
'pt-AO': 'Portuguese (Angola)',
|
|
'pt-MZ': 'Portuguese (Mozambique)',
|
|
})
|
|
- .setValue(this.plugin.settings.portugueseVeriety ?? 'default')
|
|
+ .setValue(this.plugin.settings.portugueseVariety ?? 'default')
|
|
.onChange(async value => {
|
|
if (value === 'default') {
|
|
- this.plugin.settings.portugueseVeriety = undefined;
|
|
+ this.plugin.settings.portugueseVariety = undefined;
|
|
} else {
|
|
this.plugin.settings.staticLanguage = 'auto';
|
|
staticLanguageComponent?.setValue('auto');
|
|
- this.plugin.settings.portugueseVeriety = value as 'pt-BR' | 'pt-PT' | 'pt-AO' | 'pt-MZ';
|
|
+ this.plugin.settings.portugueseVariety = value as 'pt-BR' | 'pt-PT' | 'pt-AO' | 'pt-MZ';
|
|
}
|
|
await this.plugin.saveSettings();
|
|
});
|
|
@@ -404,14 +404,14 @@ export class LanguageToolSettingsTab extends PluginSettingTab {
|
|
'ca-ES': 'Catalan',
|
|
'ca-ES-valencia': 'Catalan (Valencian)',
|
|
})
|
|
- .setValue(this.plugin.settings.catalanVeriety ?? 'default')
|
|
+ .setValue(this.plugin.settings.catalanVariety ?? 'default')
|
|
.onChange(async value => {
|
|
if (value === 'default') {
|
|
- this.plugin.settings.catalanVeriety = undefined;
|
|
+ this.plugin.settings.catalanVariety = undefined;
|
|
} else {
|
|
this.plugin.settings.staticLanguage = 'auto';
|
|
staticLanguageComponent?.setValue('auto');
|
|
- this.plugin.settings.catalanVeriety = value as 'ca-ES' | 'ca-ES-valencia';
|
|
+ this.plugin.settings.catalanVariety = value as 'ca-ES' | 'ca-ES-valencia';
|
|
}
|
|
await this.plugin.saveSettings();
|
|
});
|
|
diff --git a/src/api.ts b/src/api.ts
|
|
index 109984c..4cd1700 100644
|
|
--- a/src/api.ts
|
|
+++ b/src/api.ts
|
|
@@ -58,27 +58,27 @@ export async function getDetectionResult(
|
|
params.disabledRules = settings.ruleOtherDisabledRules;
|
|
}
|
|
|
|
- if (settings.englishVeriety) {
|
|
+ if (settings.englishVariety) {
|
|
params.preferredVariants = `${params.preferredVariants ? `${params.preferredVariants},` : ''}${
|
|
- settings.englishVeriety
|
|
+ settings.englishVariety
|
|
}`;
|
|
}
|
|
|
|
- if (settings.germanVeriety) {
|
|
+ if (settings.germanVariety) {
|
|
params.preferredVariants = `${params.preferredVariants ? `${params.preferredVariants},` : ''}${
|
|
- settings.germanVeriety
|
|
+ settings.germanVariety
|
|
}`;
|
|
}
|
|
|
|
- if (settings.portugueseVeriety) {
|
|
+ if (settings.portugueseVariety) {
|
|
params.preferredVariants = `${params.preferredVariants ? `${params.preferredVariants},` : ''}${
|
|
- settings.portugueseVeriety
|
|
+ settings.portugueseVariety
|
|
}`;
|
|
}
|
|
|
|
- if (settings.catalanVeriety) {
|
|
+ if (settings.catalanVariety) {
|
|
params.preferredVariants = `${params.preferredVariants ? `${params.preferredVariants},` : ''}${
|
|
- settings.catalanVeriety
|
|
+ settings.catalanVariety
|
|
}`;
|
|
}
|
|
|