diff --git a/.gitignore b/.gitignore index bc8a670..e3a3ed6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ -.idea/* \ No newline at end of file +.idea/* + +.DS_Store +.DS_Store? +node_modules/ +package-lock.json diff --git a/README.md b/README.md index b2c5de3..3e2f26f 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ Run the following command at the root of your documentation (where docs.json is) mintlify dev ``` +It may take you directly to `localhost:3000` which has no content. Nav to `http://localhost:3000/docs/getting-started/intro` to see our docs page. + ### Publishing Changes Install our Github App to auto propagate changes from your repo to your deployment. Changes will be deployed to production automatically after pushing to the default branch. Find the link to install on your dashboard. diff --git a/docs/getting-started/supported-languages.mdx b/docs/getting-started/supported-languages.mdx index 3d3b342..e8f7ad8 100644 --- a/docs/getting-started/supported-languages.mdx +++ b/docs/getting-started/supported-languages.mdx @@ -2,106 +2,19 @@ title: "Languages supported" description: "The DeepL API supports the following languages. We will update this list as we introduce new languages." public: true +sidebarTitle: "Languages supported" +mode: "wide" --- - Please note that Hebrew, Latin American Spanish, Thai and Vietnamese have not been added to the `/languages` endpoint as they are only available in the text translation API using next-gen models. When these languages are available for all translation endpoints (including document translation) they will be added to the `/languages` endpoint and this note will be removed. - - -### Translation source languages - -- `AR` - Arabic -- `BG` - Bulgarian -- `CS` - Czech -- `DA` - Danish -- `DE` - German -- `EL` - Greek -- `EN` - English _(all English variants)_ -- `ES` - Spanish _(all Spanish variants)_ -- `ET` - Estonian -- `FI` - Finnish -- `FR` - French -- `HE` - Hebrew _(text translation via next-gen models only)_ -- `HU` - Hungarian -- `ID` - Indonesian -- `IT` - Italian -- `JA` - Japanese -- `KO` - Korean -- `LT` - Lithuanian -- `LV` - Latvian -- `NB` - Norwegian Bokmål -- `NL` - Dutch -- `PL` - Polish -- `PT` - Portuguese _(all Portuguese variants)_ -- `RO` - Romanian -- `RU` - Russian -- `SK` - Slovak -- `SL` - Slovenian -- `SV` - Swedish -- `TH` - Thai _(text translation via next-gen models only)_ -- `TR` - Turkish -- `UK` - Ukrainian -- `VI` - Vietnamese _(text translation via next-gen models only)_ -- `ZH` - Chinese _(all Chinese variants)_ - -### Translation target languages + Some languages are currently only available for text translation via our next-generation models and do not yet support glossaries or tag handling. You'll find these languages below under the "Text Translation Only Languages" subheadings for both source and target language lists. -- `AR` - Arabic -- `BG` - Bulgarian -- `CS` - Czech -- `DA` - Danish -- `DE` - German -- `EL` - Greek -- `EN` - English _(unspecified variant for backward compatibility; we recommend using_`EN-GB` _or_ `EN-US` _instead)_ -- `EN-GB` - English (British) -- `EN-US` - English (American) -- `ES` - Spanish -- `ES-419` - Spanish (Latin American) _(text translation via next-gen models only)_ -- `ET` - Estonian -- `FI` - Finnish -- `FR` - French -- `HE` - Hebrew _(text translation via next-gen models only)_ -- `HU` - Hungarian -- `ID` - Indonesian -- `IT` - Italian -- `JA` - Japanese -- `KO` - Korean -- `LT` - Lithuanian -- `LV` - Latvian -- `NB` - Norwegian Bokmål -- `NL` - Dutch -- `PL` - Polish -- `PT` - Portuguese _(unspecified variant for backward compatibility; we recommend using_ `PT-BR` _or_ `PT-PT` _instead)_ -- `PT-BR` - Portuguese (Brazilian) -- `PT-PT` - Portuguese _(all Portuguese variants excluding Brazilian Portuguese)_ -- `RO` - Romanian -- `RU` - Russian -- `SK` - Slovak -- `SL` - Slovenian -- `SV` - Swedish -- `TH` - Thai _(text translation via next-gen models only)_ -- `TR` - Turkish -- `UK` - Ukrainian -- `VI` - Vietnamese _(text translation via next-gen models only)_ -- `ZH` - Chinese _(unspecified variant for backward compatibility; we recommend using_ `ZH-HANS` _or_ `ZH-HANT` _instead)_ -- `ZH-HANS` - Chinese (simplified) -- `ZH-HANT` - Chinese (traditional) - - - As of April 2025, supported languages for [text improvement](/api-reference/improve-text) (DeepL API for Write) have not yet been added to the `/languages` endpoint; we'll be extending the `/languages` endpoint in the near future to include this information. + Please note that only fully-featured languages will be returned by calls to the `/languages` endpoint. -### Text improvement languages (DeepL API for Write) +## API Supported Languages -- `DE` (German) -- `EN-GB` (British English) -- `EN-US` (American English) -- `ES` (Spanish) -- `FR` (French) -- `IT` (Italian) -- `PT-BR` (Brazilian Portuguese) -- `PT-PT` (Portuguese) +import { LanguageTable } from "/snippets/language-table.jsx" + + - - For the `/write` endpoint, `writing_style` and `tone` currently work in `DE`, `EN-GB`, and `EN-US`. - \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..6403608 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@tanstack/react-table": "^8.21.3" + } +} diff --git a/snippets/language-table.jsx b/snippets/language-table.jsx new file mode 100644 index 0000000..aa5acd8 --- /dev/null +++ b/snippets/language-table.jsx @@ -0,0 +1,351 @@ +export const LanguageTable = () => { + const [searchTerm, setSearchTerm] = useState('') + const [sortBy, setSortBy] = useState('name') + const [sortOrder, setSortOrder] = useState('asc') + const [featureFilters, setFeatureFilters] = useState({ + translation: false, + glossaries: false, + tagHandling: false, + textImprovement: false + }) + + // Language data with individual feature support + const languageData = [ + // Fully supported languages (source + target + glossaries + tag handling) + { code: 'AR', name: 'Arabic', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'BG', name: 'Bulgarian', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'CS', name: 'Czech', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'DA', name: 'Danish', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'DE', name: 'German', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: true }, + { code: 'EL', name: 'Greek', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'EN', name: 'English (all variants)', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'ES', name: 'Spanish', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: true }, + { code: 'ET', name: 'Estonian', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'FI', name: 'Finnish', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'FR', name: 'French', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: true }, + { code: 'HU', name: 'Hungarian', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'ID', name: 'Indonesian', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'IT', name: 'Italian', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: true }, + { code: 'JA', name: 'Japanese', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'KO', name: 'Korean', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'LT', name: 'Lithuanian', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'LV', name: 'Latvian', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'NB', name: 'Norwegian Bokmål', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'NL', name: 'Dutch', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'PL', name: 'Polish', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'PT', name: 'Portuguese (unspecified variant)', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'RO', name: 'Romanian', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'RU', name: 'Russian', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'SK', name: 'Slovak', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'SL', name: 'Slovenian', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'SV', name: 'Swedish', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'TR', name: 'Turkish', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'UK', name: 'Ukrainian', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'ZH', name: 'Chinese (unspecified variant)', translation: true, isVariant: false, glossaries: true, tagHandling: true, textImprovement: false }, + + // Target-only language variants (cannot be used as source) + { code: 'EN-GB', name: 'English (British)', translation: true, isVariant: true, glossaries: true, tagHandling: true, textImprovement: true }, + { code: 'EN-US', name: 'English (American)', translation: true, isVariant: true, glossaries: true, tagHandling: true, textImprovement: true }, + { code: 'PT-BR', name: 'Portuguese (Brazilian)', translation: true, isVariant: true, glossaries: true, tagHandling: true, textImprovement: true }, + { code: 'PT-PT', name: 'Portuguese (European)', translation: true, isVariant: true, glossaries: true, tagHandling: true, textImprovement: true }, + { code: 'ZH-HANS', name: 'Chinese (simplified)', translation: true, isVariant: true, glossaries: true, tagHandling: true, textImprovement: false }, + { code: 'ZH-HANT', name: 'Chinese (traditional)', translation: true, isVariant: true, glossaries: true, tagHandling: true, textImprovement: false }, + + // Target-only text translation only variant (no glossaries, no tag handling) + { code: 'ES-419', name: 'Spanish (Latin American)', translation: true, isVariant: true, glossaries: false, tagHandling: false, textImprovement: false }, + + // Text-only languages (both source and target, but no glossaries or tag handling) + { code: 'ACE', name: 'Acehnese', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'AF', name: 'Afrikaans', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'AS', name: 'Assamese', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'AZ', name: 'Azerbaijani', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'BA', name: 'Bashkir', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'BE', name: 'Belarusian', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'BHO', name: 'Bhojpuri', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'BN', name: 'Bengali', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'BS', name: 'Bosnian', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'CEB', name: 'Cebuano', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'DIN', name: 'Dinka', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'EO', name: 'Esperanto', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'EU', name: 'Basque', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'FA', name: 'Persian', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'GL', name: 'Galician', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'GOM', name: 'Konkani', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'HA', name: 'Hausa', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'HE', name: 'Hebrew', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'HR', name: 'Croatian', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'IG', name: 'Igbo', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'JV', name: 'Javanese', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'KK', name: 'Kazakh', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'KY', name: 'Kyrgyz', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'LA', name: 'Latin', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'LB', name: 'Luxembourgish', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'LMO', name: 'Lombard', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'LN', name: 'Lingala', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'MAI', name: 'Maithili', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'MG', name: 'Malagasy', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'MI', name: 'Maori', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'MK', name: 'Macedonian', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'MN', name: 'Mongolian', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'MR', name: 'Marathi', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'MS', name: 'Malay', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'MT', name: 'Maltese', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'MY', name: 'Burmese', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'NE', name: 'Nepali', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'OC', name: 'Occitan', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'OM', name: 'Oromo', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'PAG', name: 'Pangasinan', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'PAM', name: 'Kapampangan', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'PS', name: 'Pashto', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'RW', name: 'Kinyarwanda', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'SA', name: 'Sanskrit', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'SCN', name: 'Sicilian', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'SG', name: 'Sango', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'SN', name: 'Shona', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'SO', name: 'Somali', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'SQ', name: 'Albanian', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'ST', name: 'Sesotho', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'SU', name: 'Sundanese', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'SW', name: 'Swahili', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'TG', name: 'Tajik', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'TH', name: 'Thai', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'TK', name: 'Turkmen', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'TL', name: 'Tagalog', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'TN', name: 'Tswana', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'TS', name: 'Tsonga', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'TT', name: 'Tatar', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'UG', name: 'Uyghur', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'UR', name: 'Urdu', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'UZ', name: 'Uzbek', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'VI', name: 'Vietnamese', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'XH', name: 'Xhosa', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'YO', name: 'Yoruba', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'YUE', name: 'Cantonese', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + { code: 'ZU', name: 'Zulu', translation: true, isVariant: false, glossaries: false, tagHandling: false, textImprovement: false }, + ] + + // Filter and sort data + const filteredData = useMemo(() => { + let filtered = languageData.filter(lang => { + const matchesSearch = lang.name.toLowerCase().includes(searchTerm.toLowerCase()) || + lang.code.toLowerCase().includes(searchTerm.toLowerCase()) + + // Apply feature filters + const matchesFeatureFilters = Object.keys(featureFilters).every(feature => { + if (!featureFilters[feature]) return true // If filter is off, don't filter by this feature + return lang[feature] === true // Only show languages that have this feature + }) + + return matchesSearch && matchesFeatureFilters + }) + + // Sort data + filtered.sort((a, b) => { + let aValue, bValue + + if (sortBy === 'name') { + aValue = a.name.toLowerCase() + bValue = b.name.toLowerCase() + } else if (sortBy === 'code') { + aValue = a.code.toLowerCase() + bValue = b.code.toLowerCase() + } + + if (sortOrder === 'asc') { + return aValue < bValue ? -1 : aValue > bValue ? 1 : 0 + } else { + return aValue > bValue ? -1 : aValue < bValue ? 1 : 0 + } + }) + + return filtered + }, [searchTerm, sortBy, sortOrder, featureFilters]) + + const handleSort = (column) => { + if (sortBy === column) { + setSortOrder(sortOrder === 'asc' ? 'desc' : 'asc') + } else { + setSortBy(column) + setSortOrder('asc') + } + } + + const handleFeatureFilterChange = (feature) => { + setFeatureFilters(prev => ({ + ...prev, + [feature]: !prev[feature] + })) + } + + const clearAllFilters = () => { + setFeatureFilters({ + translation: false, + glossaries: false, + tagHandling: false, + textImprovement: false + }) + } + + const SortIcon = ({ column }) => { + if (sortBy !== column) { + return + } + return {sortOrder === 'asc' ? '↑' : '↓'} + } + + const CheckIcon = ({ enabled }) => { + if (enabled) { + return + } + return - + } + + const activeFiltersCount = Object.values(featureFilters).filter(Boolean).length + + return ( +
+
+
+
+ setSearchTerm(e.target.value)} + className="w-full px-4 py-2 border border-zinc-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent dark:border-zinc-600 dark:bg-zinc-800 dark:text-white" + /> +
+
+ + {/* Feature Filters */} +
+
+

+ Filter by Features {activeFiltersCount > 0 && `(${activeFiltersCount} active)`} +

+ {activeFiltersCount > 0 && ( + + )} +
+ +
+ {[ + { key: 'translation', label: 'Translation' }, + { key: 'glossaries', label: 'Glossaries' }, + { key: 'tagHandling', label: 'Tag Handling' }, + { key: 'textImprovement', label: 'Text Improvement' } + ].map(({ key, label }) => ( + + ))} +
+
+ +
+ Showing {filteredData.length} of {languageData.length} languages +
+
+ +
+ + + + + + + + + + + + + {filteredData.map((lang) => ( + + + + + + + + + ))} + +
handleSort('code')} + > +
+ Code + +
+
handleSort('name')} + > +
+ Language + +
+
+
+
Translation
+
+
+
+
Glossaries
+
+
+
+
Tag
+
Handling
+
+
+
+
Text
+
Improvement
+
+
+ + {lang.code} + + + {lang.name} + + {lang.isVariant ? ( + + Target Only + + ) : ( + + )} + + + + + + +
+
+ + {filteredData.length === 0 && ( +
+ No languages found matching your criteria. +
+ )} +
+ ) +}