The green blobs are left-clicks, and the expanding circles are right-clicks. Here’s a screen capture to show you how it’s done. This is definitely a neater solution, but will have to be repeated every time you upgrade OmegaT, unfortunately. Jean-Christophe from the OmegaT team just informed me that there’s another way of providing a Google Translate API key, which involves adding a item under Java > Properties in the ist file inside the OmegaT application bundle. If you have more than one version of OmegaT installed on your computer, this script will run the most recent one it can find. It works by searching for a file called OmegaT.app inside your Applications folder, digging down to the Java application inside it, and then launching this application with your API key as a command line argument. Google Translate is a free multilingual neural machine translation service developed by Google, to translate text and websites from one language into another. You can then drag this file to the dock and run it with a single mouse click. "|head -1)Contents/Resources/Java/OmegaT.jar >/dev/null 2>&1 &" as string "/Applications -name \"OmegaT.app\" -maxdepth 2 -type d |xargs) " & ¬ Set ss to "java -jar =" & apikey & " $(ls -ptd $(find " & ¬ Don’t call this file OmegaT.app any other name is fine. Copy and paste the following code into AppleScript editor (not forgetting to replace “ xxxx” with your API key), then save it as a run-only application. This can be remedied with a bit of AppleScript and Unix scripting. Which is a nuisance, because there’s no way of adding command line arguments when you start an application by clicking its icon. On other operating systems, the API key has to be provided as a command line argument when the OmegaT Java application is started up. Windows users can provide this information by adding the following line to the configuration file (replacing “ xxxx” with your actual API key): = xxxx However, the OmegaT developers haven’t yet made it very easy to enter this key. In return, you’ll get an identification code called an API key that OmegaT will need when interacting with Google. Recent versions of OmegaT are compatible with the paid service ( Google Translate v2), but before you can use it you have to set up an account with Google and give them your credit card details. One of its useful features is an interface to the Google Translate API that enables it to provide a (somewhat helpful) machine translation of each chunk of text as it is being translated. Earlier this year, Google announced that its free translation API is to be replaced with a paid service, and will stop altogether on 1st December 2011. In the future, I will publish a utility that will speed up the process of professional translation.OmegaT is a free, open-source, cross-platform computer-assisted translation tool. This script only gives you the 2nd and 3rd steps of the professional translation process, but these steps is also the most necessary to create a full-fledged utility. Set AppleScript's text item delimiters to "" Set AppleScript's text item delimiters to theReplacementString Set theTextItems to every text item of theText Set AppleScript's text item delimiters to theSearchString On findAndReplaceInText(theText, theSearchString, theReplacementString) Because there are a lot of languages, Translate let’s you rearrange the languages according to your preferences. More languages will be automatically added when they are made available by Google. It’s able to translate between more than 50 different languages. Set Translated_Text to findAndReplaceInText(Translated_Text, " ", "") About Translate Powered by Google Translate. Set Translated_Text to findAndReplaceInText(Translated_Text, "", "") Set TextTeg to do JavaScript "document.getElementsByTagName('span').innerHTML" Repeat until the length of Translated_Text is not 0 Set myParagragh to the clipboard as string For example, this topic paid “professional” program will translate along with a piece of applescript, all fucking up And, despite their high cost, many of them violate the structure of the PDF and do not make a difference in what needs to be translated and what is not necessary. There are many translation programs, but they are expensive and will never give you the flexibility your own Apple-script’s gives. NOTE 3: You can automate all steps except the 4th, of course. NOTE 2: Automatic translation programs are powerless with translation, for example, technical literature and PDFs, so the process of professional translation looks like this: 1) Copy a paragraph, 2) Paste in Google Translator, 3) Copy the resulting translation, 4) Correct the translation in a text editor, 5) Paste into the original document. Here I use the translation page from English to Russian ( ) You can use another. NOTE 1: It is assumed that you first copied a paragraph of text into your clipboard.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |