hartmut Posted December 7, 2009 Posted December 7, 2009 If you click on the url http://translate.reference.com/translate?query=Apple&src=en&dst=fr&v=1.0 I am using a browser to translate the word "Apple" into French from English. Is there a way to pull the French Translation in the form back into Filemaker? I want to place it in a field called "French" Thank you.
andries Posted December 7, 2009 Posted December 7, 2009 There are several possibilities. The most easy one is to place a webviewer on your layout, and load the webpage into it. Then with GetLayoutObjectAttribute ( "wv" ; "content" ), you can grab the HTML. You can find then the translation in the HTML, with some parsing custom functions.
hartmut Posted December 7, 2009 Author Posted December 7, 2009 (edited) Thanks Is there a way to just copy the web browser into a field called "Web browser text" by script and then It always has the translation between the red phrases [color:red]Translation: English » French and [color:red]FacebookTwitterFollow I am not sure how to parse that But that is where the translation falls. Edited December 7, 2009 by Guest
comment Posted December 7, 2009 Posted December 7, 2009 It always has the translation between the red phrases [color:red]Translation: English » French and [color:red]FacebookTwitterFollow I am not sure how to parse that But that is where the translation falls. No, it falls between [color:green] and [color:green] - look at the 'page source' in your browser, because that's what you'll get when using GetLayoutObjectAttribute().
hartmut Posted December 7, 2009 Author Posted December 7, 2009 (edited) There is an additional problem because I have one set for Russian and the font is entirely different unless it is copied directly. So I made a script to go to the webviewer as an object - then selected all and copied and pasted. It worked great. So my above example is correct. I tried it in Russian and it looked like this. [color:Red]Translation: English » Russian [color:green]яблоко [color:red][color:red]FacebookTwitterFollow Somehow I have to parse the text to get the [color:green]яблоко out and back into my Czech field. Edited December 7, 2009 by Guest
comment Posted December 7, 2009 Posted December 7, 2009 the font is entirely different unless it is copied directly That shouldn't be a problem if the font applied to the field has the glyphs (try Lucida Grande). Copy/paste might work, but only on a Mac, IIRC. For a generic formula to extract text between known prefix and suffix see: http://fmforums.com/forum/showpost.php?post/289685/
hartmut Posted December 7, 2009 Author Posted December 7, 2009 (edited) I failed to mention there is a great space between [color:red]Translation: English » Russian [color:black]and the next word FacebookTwitterFollow Also sometimes I want to translate more than one word. I am putting the example below 2x with the first being the translation between English and Russian of Apple. This is the copied text of two examples I am trying to extract the "red" words from. 1st one is below the line: _______________________________________________________________ Dictionary.com Translator Over 50 languages including Chinese, French, German, Hindi, Japanese and Spanish available for free online translation. Type or paste your text below: 1,995 characters remaining Translate from to » Apple Store Free Shipping Get free shipping on everything this holiday. Shop the Apple Store. store.apple.com Buy Apple Get Your Software Private-Offer Apple on Sale Private-Offer.com Apple Find Laptop Deals & Save! Compare Prices - Apple Macworld.com/Laptops Translation: English » Russian [color:red]яблоко FacebookTwitterFollow us: About · Privacy Policy · Terms of Use · Careers · Advertise with Us · Link to Us · Contact Us Dictionary.com, LLC. Copyright © 2009. All rights reserved. Partner Sites:Ask AnswersEviteExpediaHotelsHotwireLife123LiveDailyMy Way _______________________________________________________________ The second example I am translating "There are many apples in this pie." into Russian. it goes as follows (below the LINE) _______________________________________________________________ DictionaryThesaurusEncyclopediaTranslatorWeb Help|Register|Login Popular Searches Study abroad progra... Reasons to study ab... Benefits of studyin... Undergraduate schol... Pros cons studying ... High school study a... Study abroad in ita... Grants and scholars... Studying abroad adv... Study abroad statis... Why study abroad es... International studi... Dictionary.com Translator Over 50 languages including Chinese, French, German, Hindi, Japanese and Spanish available for free online translation. Type or paste your text below: 1,966 characters remaining Translate from to » Nortel to Cisco Training Translate your knowledge from Nortel to Cisco in 5 Days www.qosnetworking.com/training Dussault Translation Ltd. Best Services and Quality Since1950 Contact us Today! 416-227-0304 www.dussault-translation.com Free Internet Explorer 8 MSN-Optimized Internet Explorer is Fast, Safe & Easy. Download Now! Sponsored Results www.IE8optimized.com Translation: English » Russian [color:red]Есть много яблок в этот пирог. FacebookTwitterFollow us: About · Privacy Policy · Terms of Use · Careers · Advertise with Us · Link to Us · Contact Us Dictionary.com, LLC. Copyright © 2009. All rights reserved. Partner Sites:Ask AnswersEviteExpediaHotelsHotwireLife123LiveDailyMy Way ______________________________________________________________ I am trying in both cases to extract just the red text to a field called "Russian" There are variable spaces between the last word of my translation and "FacebooktwitterFollow" There are different numbers of words. SORRY if I didn't explain properly. These above are two exact examples. The copy also changes but the place the translation occurs always is in between the text [color:purple]Translation: English » Russian and [color:purple]FacebookTwitterFollow with variable amount of words before and after and variable amount of words for the translation. I can't figure this out. This is one of those text parsing things I can't understand. Edited December 8, 2009 by Guest
hartmut Posted December 8, 2009 Author Posted December 8, 2009 (edited) It might be easier for you to see the examples yourself to help find how you might extract the translation. I put the whole thing up before but it is much easier just to see it. [color:green]Apple http://translate.reference.com/translate?query=Apple&src=en&dst=ru&v=1.0 [color:green]There are many apples in this pie. http://translate.reference.com/translate?query=There+are+many+apples+in+this+pie.&src=en&dst=ru&v=1.0 It might be easier to see what I am trying to collect into filemaker field Russian. I just script a select all on the webviewer object to extract the whole text but again it is easier to see here . If you want the text as I have collected it . Just click on the web page and do a select all to copy it and paste it to a text field. Edited December 8, 2009 by Guest
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now