-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggest phrases based existing translations when entering new translation text #409
Comments
For tooltips we use same format pretty much everywhere ("Specifies the value of the ... field." -> "Nurodo lauko ... reikšmę."). Could this be automatically suggested by the XLIFF editor? |
Hi @ernestasjuska, Just to be sure I understand your issue: If so, I might be able look into how to solve word completion, similar to how it works if you open the XLF file in text mode in VSCode. Adding a sentence completion will probably be waaay to complicated to solve, I'm afraid. Would word completion in the XLIFF editor be of any help at all for you? (to keep this issue clean, I moved the second feature request to it's own issue (#410)) |
Yes, the feature would in the XLIFF editor for entering translations. Word completion will suffice, it should also suggest words based on the previous word. Words would be sequences of letters, single letter words should be allowed. Words should be stored in lowercase, but when autocompleting the casing of the word should be decided by the previous word or current word first two letters:
Autocompletion should not care where cursor is on the word (same as in code editing). So for translations "Some Document No.", "Document Date", "Item No.":
I make example using the trie data structure (https://github.com/ernestasjuska/TrieThis/blob/main/TrieThis/Program.cs). Other than reading the translation file and splitting translations into words (took around 6 seconds for Base Application translation file; 2 seconds for 2000 translation units file) it works pretty fast. VS Code also supports fuzzy matches, e.g. typing "Doct" would suggest word "Document". There is a fuzzy search algorithm in this repo https://github.com/derekparker/trie, but I haven't touched golang seriously to understand it. Thanks. |
Thank you for the detailed description and helpful references @ernestasjuska. I'll look into developing this feature. At the moment there's little time and energy for me to spare so I won't promise when I'll start but I'll update this issue. In the mean time if you feel adventurous you are very welcome to have a stab at it yourself 👍 |
Hi,
One pain point in current editor is that whole target translation has to be entered manually when suitable translation if not found automatically. Then you have to go to the XLIFF file and search for similar source text.
It would be useful to have some kind of text autocompletion based on existing translations.
For example if you have translation "My Super Cool Field" -> "Mano labai kietas laukas", when inputing translation it should suggest it when starting to type "Mano lab...".
It should work similar to VS Code's word completion feature but instead work with phrases (in this case it could suggest full field caption, e.g. "Grynasis pokytis").
Thanks.
The text was updated successfully, but these errors were encountered: