translate-tools / core Goto Github PK
View Code? Open in Web Editor NEWTranslators and tools for translation (translate scheduler, batch translating, cache, etc)
Home Page: https://npmjs.com/@translate-tools/core
License: Apache License 2.0
Translators and tools for translation (translate scheduler, batch translating, cache, etc)
Home Page: https://npmjs.com/@translate-tools/core
License: Apache License 2.0
Docs structure are confused and hard to explore.
Refactor README to flow like this
API section must have structure below
When we translate text with dots, in result of translation space after dot is not exist, we should fix it.
Test text: "Hello World. Do you see?"
It's stable translator. You can get code on https://github.com/translate-tools/linguist/blob/master/modules/TartuNLP.js
Add info about translators and add API docs, Home page, demo pages
any solutions?
Split the code and add tests
Use one library to validate all data instead of manual validation everywhere
Now TTS directory contains test files https://www.unpkg.com/browse/@translate-tools/[email protected]/tts/
We have to exclude any test artifacts from build, include files and directories with test files
Tell about usage and API
Replace types langCodeWithAuto
and langCode
to string.
We have to add aliases to exists types and deprecate it
Review and improve interfaces, abstract classes and fix implementations
Map languages.
More info:
https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
https://xml.coverpages.org/iso639a.html
In browser we can got CORS errors as reported in #6
We must implement proxy prefix option ('https://proxy/' + url
) or proxy hook for requests
Group entities with order to structure from issue #46 and write migration guide
This is erroring for me. Assume it should be resp.json
?
Bad json response i guess :(
Each request should be able contains a priority index
Bing and reverso translators are not supported, so must be removed
Changed response structure
Suggest pipeline steps
release/*
release/*
to master
Currentrly, method getSupportedLanguages returns not all languages
We should to proof NPM package contains original files with no changes. So let's start publish builds for each new release
Hey,
i am noticing a difference in translation using the scheduler and directly using the translator
test string: こんにちは (hello in japanese)
scheduler:
`
const scheduler = new Scheduler(translator);
scheduler
.translate('こんにちは', 'ja', 'en')
.then((translate) => console.log(translate));
`
result: 縺 薙 s 縺 縺
translator:
`const translator = new GoogleTranslator();
translator
.translate('こんにちは', 'ja', 'en')
.then((translate) => console.log(translate))`
result: hello
is this something i am doing wrong or can fix?
Thanks in advance
At this time it work perfect in browser addons.
To make it work everywhere we must:
Answer questions from #13
When translator is support short text for requests, we may got case when all attempts will exceed the limit and Scheduler will try to split text infinity times. So, we should set limit of attempts and maybe provide option to control this variable
Add Translator
implementations. You can see implementations in other projects, for example https://github.com/UlionTse/translators
Implement build target to get standalone files contains translators code.
One file - one translator. Code must be readable.
This is useful feature to embedding
We should supply source map in package, to help users understand errors better
Yandex translator does not work with node.
@Evoks have implemented a fix Mueslidotio@1b5d6e7
src/util/Scheduler/SchedulerWithCache.ts
contains a really large regular expression
Let's replace it to a /[^\p{L}]/gu
and cover by tests.
Unicode Property Escapes can be transpiled down to ES5 with a tool called regexpu
Improve files structure and make it consistent
Use it instead of local script
Hi :)
First of all, i love this library. Seems to be able to do what i need.
I do have a question. What exactly triggers the scheduler? Is it possible to say that after inserting x amount, it should translate?
I am currently trying to use this multi threaded
This should work like that:
const translator = new SomeTranslator();
const controller = new AbortController();
const { signal } = controller;
translator.translate('hello world', 'en', 'de', { signal }).then(console.log).catch(console.warn);
controller.abort();
Currentrly, method getSupportedLanguages
returns not all languages
Run tests every day by cron and notify all maintainers when tests not pass.
It need to fix bugs about API changes ASAP
Scheduler
required BaseTranslator
that is a class, but not an interface.
We have to require minimal interface instead.
Error:
Argument of type 'Translator' is not assignable to parameter of type 'BaseTranslator<{}>'.
Type 'TranslatorInstanceMembers' is missing the following properties from type 'BaseTranslator<{}>': options, wrapUrlToCorsProxy
Make tests for all translators
Find a way to fix bing translator and make it stable
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.