Stringlate icon indicating copy to clipboard operation
Stringlate copied to clipboard

Add dictionary option

Open ashed opened this issue 8 years ago • 20 comments

Maybe add optional pluggable dictionary, like TranslationMemory in Poedit?

ashed avatar Jan 05 '17 17:01 ashed

How would you present the suggestions to the users? What suggestions should it load and when? But yeah, I thought this too, sometimes a lot of different projects have a lot of similar strings, or even equal. How would you compare which strings are similar enough to be shown as suggestions?

Lonami avatar Jan 05 '17 17:01 Lonami

Maybe suggest to user strings with keywords like "sharp", "smooth", "Next", "Previous", etc? And when string contains keyword propose it like suggestion in translation. Keyboard dictionary like in Google Keyboard can help too.

ashed avatar Jan 05 '17 18:01 ashed

Maybe suggest to user strings with keywords like "sharp", "smooth", "Next", "Previous", etc?

Could you explain this better? Do you mean like a "downloadable" dictionary for single words, not sentences?

Lonami avatar Jan 05 '17 18:01 Lonami

Not for the single words, but partially matched sentences. This is sample of inksape translation ru.po (v0.92) #: ../inkscape.desktop.in.h:6 msgid "New Drawing" <<< keyword "New" msgstr "Новый рисунок" Maybe dictionary must contain original <-->translation couples?

ashed avatar Jan 05 '17 18:01 ashed

I'm trying to think of a way to extract the "keywords" from the sentences though… First word? Last word? Random word? — Android string's don't have any "keyword" by default (they have a "name", which can or cannot be a valid keyword; and usually are several words_separated_by_underscore). And then with this keyword, Stringlate should look on all the translations on other projects to see if it can find a matching result you say?

Sorry for not quite understanding you, I think I'm a bit tired… I just can't think of how this algorithm to detect "keywords" should work, and how should the suggestions be stored. On a database maybe? For each locale though? Or only for the one the user has defined on their phone? Maybe the suggestions could be loaded in a background thread instead… So many questions!

Lonami avatar Jan 05 '17 18:01 Lonami

Yes, many questions. Sorry for my annoyance. Google keyboard use user dictionary, which contain wordlist (one word per line, alphabetically normalized). Maybe background process must scan prepared database, like in GoogleKeyboard? One dict per locale, or one TranslationMemory per project. Thank you for attention.

ashed avatar Jan 05 '17 18:01 ashed

Google keyboard use user dictionary, which contain wordlist

But the problem is that, even with access to this dictionary, there is no such thing like "translation", they're just words which can be suggested, so Stringlate wouldn't know which it should "show". To put an example, the user might have both Spanish and English set on their phones, and the user has self-defined words on both Spanish and English. These have no relation, there is no such thing as "translation". They are just in a database accessible for every application to suggest them.

Maybe background process must scan prepared database

It would be possible to have a database (to provide faster lookup than scanning through the files) containing all the strings for every locale on every project. But again, this is not the problem (only a part of it). The problem is how it should determine the keywords, and how this should be shown to the user on the interface. Maybe as a placeholder? Or as a pop-up when you type? Or an "Apply suggestion"-like button?

Sure, it would be nice to have some kind of natural language processing to determine the best match… But that would be a bit overkill so that's why I was trying to think of a simpler solution.

Edit:

Thank you for attention.

Thank you for standing all my complaints actually! I only need some more ideas on how this could be done.

Lonami avatar Jan 05 '17 19:01 Lonami

Ok, I'll connect with Poedit team and talk a little about this problem. Thank you very much. Besides I translate Stringlate to Russian right now. It is very useful application. Thank you again.

ashed avatar Jan 05 '17 19:01 ashed

I was thinking of maybe adding the ability to download a dictionary from some website for the currently selected locale and then thought I would need some kind of spell checking… Then realised most keyboards provide this already so it would be fairly useless. What should we do with this issue?

Lonami avatar Jan 20 '17 15:01 Lonami

For further reference, it would be good to keep an eye on Glosbe - the multilingual online dictionary. If anyone else knows similar projects (besides the ones mentioned on their /Partners section), it would be great to know too.

Lonami avatar Feb 16 '17 15:02 Lonami

Dictionaries wouldn't be any good for translations because the user should know their language, what I think could be good is to use Google translate or a similar platform somehow and suggest a translation for the string and the user can decide if the translation string is good or not, this could speed up translation. What do you think @Lonami ?

ghost avatar Jun 02 '17 02:06 ghost

Dictionaries wouldn't be any good for translations because the user should know their language,

Sure they should know it, but not everyone knows every single word in two languages. A dictionary would be of help for both 1. ensuring you used the right word and 2. not missing those rare words which you don't know.

use Google translate or a similar platform somehow and suggest a translation for the string and the user can decide if the translation string is good or not

I guess it would be good but what about people if they kept clicking the "Is correct" button without even reading? That's not the idea, we're looking for human quality translations. Using a dictionary would prevent the "auto-click" since sentences are far more complex than a single word.

These are my thoughts, though I think using a translation service which even allowed us to submit back correct translations would be a good help for both too.

Lonami avatar Jun 02 '17 06:06 Lonami

Sure they should know it, but not everyone knows every single word in two languages. A dictionary would be of help for both 1. ensuring you used the right word and 2. not missing those rare words which you don't know.

Well, I guess it can help but I think it'd be showing too much data to the user if it were to use a dictionary depending on how it's shown.

I guess it would be good but what about people if they kept clicking the "Is correct" button without even reading? That's not the idea, we're looking for human quality translations. Using a dictionary would prevent the "auto-click" since sentences are far more complex than a single word.

I think those people could still be using any type of software or none and just write crap anyways. The person checking if those sentences are good should be familiar with the language so they should know if it's actually good or not and change it or not based on that.

ghost avatar Jun 04 '17 22:06 ghost

Maybe go for full "original string" -> "translation string", and store that in a local db/file. E.g. if theres "settings" -> "Einstellungen" for german, put that in the german translation memory, and if exactly that string comes up, ask if that should be taken. E.g. always copy all translations to local after something gets synced/loaded, in cache folder.

But ok, thats more a "translation memory" than a dictionary.

For getting a simple dictonary maybe look at what https://f-droid.org/packages/de.reimardoeffinger.quickdic/ does, and try to match only on full words. Extensionable, you could put such a full word list e.g. again in the "translation memory" than ;)

gsantner avatar Oct 02 '17 11:10 gsantner

You mean like, loading all the "original string" -> "translated string" from every project in memory, and if an "original string" matches the one from a new project, suggest "translated string"?

Lonami avatar Oct 02 '17 11:10 Lonami

Yep

gsantner avatar Oct 02 '17 11:10 gsantner

What about using if we go the database direction (which is the better than parsing a file line by line (speed)? It allows us to use normal JDBC to makee sql statements (which is java SE compatible/non-android) while still making use of android internals for database

gsantner avatar Oct 03 '17 07:10 gsantner

Although we would have duplicated information (original .xml files, needed as a template, and now this database), it would indeed speed up this specific task, so it seems like a good idea to use a database, yes.

Lonami avatar Oct 03 '17 07:10 Lonami

But the xml of an project is only loaded when opening a project right?

gsantner avatar Oct 03 '17 08:10 gsantner

Yes, opening a project always loads the original .xml file(s), and of course, the .xml for the selected locale. If you "Peek translations", it will read all the other .xml files too (within the same project).

Lonami avatar Oct 03 '17 08:10 Lonami