Skip to content

Commit

Permalink
Desktop: Fixes #10058: OCR does not start when German language is sel…
Browse files Browse the repository at this point in the history
…ected
  • Loading branch information
laurent22 committed Mar 5, 2024
1 parent d9a16b5 commit a1cea67
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/lib/locale.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { closestSupportedLocale, parsePluralForm, setLocale, _n } from './locale';
import { closestSupportedLocale, parsePluralForm, setLocale, _n, toIso639 } from './locale';

describe('locale', () => {

Expand Down Expand Up @@ -91,4 +91,14 @@ describe('locale', () => {
}
});

test.each([
['en_GB', 'eng'],
['en', 'eng'],
['de', 'deu'],
['fr_FR', 'fra'],
])('should convert to ISO-639', (input, expected) => {
const actual = toIso639(input);
expect(actual).toBe(expected);
});

});
1 change: 1 addition & 0 deletions packages/lib/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ const iso639Map_ = [
['cos', 'co'],
['cre', 'cr'],
['dan', 'da'],
['deu', 'de'],
['div', 'dv'],
['dzo', 'dz'],
['eng', 'en'],
Expand Down

0 comments on commit a1cea67

Please sign in to comment.