File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -212,46 +212,6 @@ The most common browser use case is loading files from an `<input type="file">`
212212 </script >
213213```
214214
215- ### Processing Translations
216-
217- ``` html
218- <script type =" module" >
219- import { getProcessor } from ' aac-processors' ;
220-
221- async function translateFile (file , translations ) {
222- const extension = ' .' + file .name .split (' .' ).pop ();
223- const processor = getProcessor (extension);
224- const arrayBuffer = await file .arrayBuffer ();
225-
226- // Process texts with translations
227- const translatedBuffer = await processor .processTexts (
228- arrayBuffer,
229- translations,
230- null // Don't save to file, return buffer
231- );
232-
233- // Create download link
234- const blob = new Blob ([translatedBuffer], { type: ' application/octet-stream' });
235- const url = URL .createObjectURL (blob);
236- const a = document .createElement (' a' );
237- a .href = url;
238- a .download = ' translated-' + file .name ;
239- a .click ();
240- URL .revokeObjectURL (url);
241- }
242-
243- // Usage
244- const translations = new Map ([
245- [' Hello' , ' Hola' ],
246- [' Goodbye' , ' Adiós' ],
247- [' Yes' , ' Sí' ],
248- [' No' , ' No' ]
249- ]);
250-
251- translateFile (myFile, translations);
252- </script >
253- ```
254-
255215## Supported File Types
256216
257217### Browser-Compatible Processors
You can’t perform that action at this time.
0 commit comments