lihang1031 Posted October 15, 2014 Report Share Posted October 15, 2014 Hi Guys I recently fixing a vi that can translate all the English to Spanish, and Spanish back to English. Here is how this vi works: there is a dictionary table there, header will be English, Chinese, French, Spanish, etc All the words will be ordered by the length of the English words, so that it can only start searching from the longest words to the shortest one And inside the for loop, it will use export all the english word out one by one and use the search and replace function to check the "Input Text", if found it, then it will replace it and go to shift register and ready for next translation. The reason allow it to translate couple times is because some string maybe a combination of few strings, for example " The remaining time is 5 Seconds" the number 5 will be keep changing, counting down or up, so this word need be translated twice complete with the first translation " The remaining time is" and the second one "Seconds" and make it as a complete translation. There is a bug in this translation vi is that it will also translate part of my word and mass up the whole sentence: for example, English word both "Automatic" and "Auto" will match with Spanish word "Modo Autom¨¢tico", so if I have the word "Automatic" for translation, it will first translate to "Modo Autom¨¢tico", and because there is an "Auto" inside that Spanish word, it will translate it again, it becomes " "Modo Modo Autom¨¢ticom¨¢tico", and mass it up. I think I need check if the word I need translate is a complete word or sentence, than I will do the translation not just translate a part of a word. Because the word "Automatic" can exist in any sentence. But I have no idea how to determine if the word is a complete word or sentence, by check if there is a space or nothing before or after the translated word? if that, how to achieve that? By the way, the "english" directory can not be changed, so I can not add something special between each word Best Hang Quote Link to comment
ShaunR Posted October 15, 2014 Report Share Posted October 15, 2014 But I have no idea how to determine if the word is a complete word or sentence, by check if there is a space or nothing before or after the translated word? if that, how to achieve that? You don't need to do partial matching. You translate the string "The remaining time is %d Seconds" and use the format into string primitive. . You might want to take a look at Passa Mak. It will generate all the language files for translation and switch all the UI controls. (Good luck with the Chinese one. I'm not brave enough to attempt the East Asian translations) Quote Link to comment
GregFreeman Posted October 16, 2014 Report Share Posted October 16, 2014 (Good luck with the Chinese one. I'm not brave enough to attempt the East Asian translations) Man up. Quote Link to comment
ShaunR Posted October 16, 2014 Report Share Posted October 16, 2014 Man up. https://www.youtube.com/watch?v=OdB2dy59Waw Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.