News:

Wondering if this will always be free?  See why free is better.

Main Menu

Google Translate for SMF 2.0

Started by Doburpally, October 27, 2011, 07:34:55 PM

Previous topic - Next topic

inkys

#20
 Thanks for this mod ;) using and I  found few problems maybe somebody can help me.
I  m using the default theme curve

1)My forum is not  for english speaker, so   I select another language(english for example) from the dropdown, I
have always a translation instantly from google who can show me the alternative translation for every word.
Is it possible do not show this box from google??(attachment)

2) I disable the top bar, but I have always a refresh on my boards, is it possible to not have?
maybe @warrior4christ fixed this problem?

3)how to remove the text (powered by google translate?) I saw on this forum we do not have

Thanks the author for this mod and apologies for all question together

Doburpally

#21
Quote from: inkys on January 30, 2012, 05:00:47 AM
Thanks for this mod

Thanks

Quote from: inkys on January 30, 2012, 05:00:47 AM
I  found few problems maybe somebody can help me.
I  m using the default theme curve

sorry to hear that you are having some problems with this mod

Quote from: inkys on January 30, 2012, 05:00:47 AM
1)My forum is not  for english speaker, so   I select another language(english for example) from the dropdown, I
have always a translation instantly from google who can show me the alternative translation for every word.
Is it possible do not show this box from google??(attachment)

Far as I have seen from Google Translate it self, no, all translations will be shown the original text in a box shown in the attachment.

Quote from: inkys on January 30, 2012, 05:00:47 AM
2) I disable the top bar, but I have always a refresh on my boards, is it possible to not have?
maybe @warrior4christ fixed this problem?

I can't see how he could possibly done that.
As I have said previously, I have looked at other settings for Google Translate, nothing support his claims.

Quote from: inkys on January 30, 2012, 05:00:47 AM
3)how to remove the text (powered by google translate?) I saw on this forum we do not have

I have added an option in Admin > Configuration > Modification Settings
"Google Translate Position" you can now choose Left, Center, Right alignment.
"Google Translate Style" you can change the style to Horizontal, Vertical, Dropdown Only.
See attachments

If you can't see the text for the Google Translate Position, Google Translate Style, Google Translate System
Please let me know and tell me your forum language so I can do translations for you and add them to my mod accordingly ;)

DrBermant

Thank you for your mod. It was just what I was looking for as I just made my other sites Google Translate capable.

I see you did not opt to offer the Google Analytics option.

http://translate.google.com/translate_tools check box under optional settings:

Track translation usage in Google Analytics.

I am awaiting to see it power on the installed sites, but it should be an option for the site using the tool.

I am also having an issue with a dark background on the site, the placement of the google code hides all but the drop down. The fix is to choose drop down only. But another option would be to offer a selectable button for those with dark background themes to have the google div color different so that the horizontal code would be visible.

Thank you for the mod.

Michael Bermant, MD
Retired Plastic Surgeon
Plastic Surgery Encyclopedia
Board Certified
American Board Plastic Surgery
Plastic Surgery Encyclopedia
A Body Beautiful Plastic Surgery Forum

brynn

#23
Hi Friends,
I don't have a SMF myself, but participate in many forums which use this software.  One of them uses this Google Translate for version 2.0.  It's a forum which I like, and would like to participate more.  But the translation provided is.....well, not as good as what I would have expected.

I will put screenshots below.  The forum is in the Italian language, and I use the translation for English.  Some people on the forum are able to read and write English.  But if they write in English, and I'm using the translation on it, frequently words are mixed up (out of order).  Also, the translator seems to apply random capitalization of words.  For example, in the middle of a sentence, 3 consecutive words might be capitalized, for which there is no grammatic reason.  Usually it's just one or 2 words, though.

When the messages are written originally in Italian, the translations are equally hard to understand, despite being English words.  So I have to wonder if it's malfunctioning.  But of course since I don't read Italian, I can't be sure, or provide examples.

Is this acceptable behavior for this mod, or could there be a problem with it?  The message in the screenshot was typed originally in English, but the translator has put words in the wrong order, and added unneccesary capitalization.  I'm not sure what order these attachments will appear, so I'll try to edit the message to indicate which is which.

And 2nd question -- which mod provides the translation for this forum (that I see in top right corner)?  It appears that the Google Translate is the only one that works with the current version of SMF.  But that one looks very different from the one on the Italian forum.

Thanks for your help  :)

(Hhhhm, if I'm logged in, why is there a captcha?)

Edit #1
PS -  The file "without trans" is how the original message was typed, and how it appears without using the mod.  The file "with trans" is what happens when the translator works on it.  Thanks again :)

Edit #2
The aformentioned problems are not the only ones.  Apparently using the translator causes the message to lose all formatting.  So the sentences all just run together.


Doburpally

Quote from: DrBermant on February 25, 2012, 12:42:59 PM
Thank you for your mod. It was just what I was looking for as I just made my other sites Google Translate capable.

:)

Quote from: DrBermant on February 25, 2012, 12:42:59 PM
I see you did not opt to offer the Google Analytics option.

http://translate.google.com/translate_tools check box under optional settings:

Track translation usage in Google Analytics.

I am awaiting to see it power on the installed sites, but it should be an option for the site using the tool.

I will include this option in my new version.

Quote from: DrBermant on February 25, 2012, 12:42:59 PM
I am also having an issue with a dark background on the site, the placement of the google code hides all but the drop down. The fix is to choose drop down only. But another option would be to offer a selectable button for those with dark background themes to have the google div color different so that the horizontal code would be visible.

I will include a fix for this issue in my new version.

It will have a drop down selection to include:
Light Theme
Dark Theme Left
Dark Theme Center
Dark Theme Right

Since I am using CSS in the the above, I have chosen to use something like the following.
#googletranslatedarkcenter
{
position: absolute;
top: 0px;
left:40%;
height: 30px;
width: 335px;
background-color: rgb(238,238,238);
-moz-border-radius: 15px;
border-radius: 15px;
}


It will look better than a background color stretching across the full width of your page with only a 300px object aligned to the Left, Center or Right.
IMHO it won't look professional.

It will also require the index.css to be edited to change the background color so the Horizontal text can be visible on dark themes.

The style that I have added will look better in Firefox, but, it should still display in other browsers though.

I can add other effects, such as, shadows etc. This will reduce the browser compatibility.
Most effects that I know are CSS3 (Cascading Style Sheet), this again, will also reduce the compatibility of browsers even further.

Quote from: brynn on February 28, 2012, 07:23:17 PM
Hi Friends,
I don't have a SMF myself, but participate in many forums which use this software.  One of them uses this Google Translate for version 2.0.  It's a forum which I like, and would like to participate more.  But the translation provided is.....well, not as good as what I would have expected.

I will put screenshots below.  The forum is in the Italian language, and I use the translation for English.  Some people on the forum are able to read and write English.  But if they write in English, and I'm using the translation on it, frequently words are mixed up (out of order).  Also, the translator seems to apply random capitalization of words.  For example, in the middle of a sentence, 3 consecutive words might be capitalized, for which there is no grammatic reason.  Usually it's just one or 2 words, though.

When the messages are written originally in Italian, the translations are equally hard to understand, despite being English words.  So I have to wonder if it's malfunctioning.  But of course since I don't read Italian, I can't be sure, or provide examples.

Is this acceptable behavior for this mod, or could there be a problem with it?  The message in the screenshot was typed originally in English, but the translator has put words in the wrong order, and added unneccesary capitalization.  I'm not sure what order these attachments will appear, so I'll try to edit the message to indicate which is which.

And 2nd question -- which mod provides the translation for this forum (that I see in top right corner)?  It appears that the Google Translate is the only one that works with the current version of SMF.  But that one looks very different from the one on the Italian forum.

Thanks for your help  :)

(Hhhhm, if I'm logged in, why is there a captcha?)

Edit #1
PS -  The file "without trans" is how the original message was typed, and how it appears without using the mod.  The file "with trans" is what happens when the translator works on it.  Thanks again :)

Edit #2
The aformentioned problems are not the only ones.  Apparently using the translator causes the message to lose all formatting.  So the sentences all just run together.



The problem is not this mod, they might be using a different mod or they are using the code straight from the Google Translate site.

Those questions should be pointed to the site owner of the site in question or Google Translate it self, not here.
It will more than likely be on the site that you are talking about, I would try them first.

The problem could also be a miss translation.
I would also expect formatting to be lost during the translation process, IMHO I'm not really fussed. If the end result is translated then I'm happy

The captcha would be up to the site administrator/s, they may have the option set for x amount of posts to display the captcha for logged users as well as guests.

Doburpally

Quote from: DrBermant on February 25, 2012, 12:42:59 PM
I see you did not opt to offer the Google Analytics option.

http://translate.google.com/translate_tools check box under optional settings:

Track translation usage in Google Analytics.

I am awaiting to see it power on the installed sites, but it should be an option for the site using the tool.

I have just tested my new version, the new feature Google Analytics conflicts with a pre existing mod called 'Google Analytics Code'.
Up on adding other options to my mod I did come across this, I have just simply forgotten why I didn't add it..

The fix for the Dark Themes works just fine.

I'll now remove all Google Analytics edits.

brynn

Thanks for your reply  :)

I've thoroughly discussed this with the site's owner.  Since I may want to use SMF myself someday, I thought it might be a good opportunity to acquaint myself with the product.  So that was also a consideration in deciding to register and post my questions.

They are definitely using this mod.  Because I'm somewhat not satisfied with the result, I sent him a link to all the translation mods available for SMF (not realizing that what he is using is actually a forum mod) (I thought it was something directly from Google).  He said he was using Google Translate for 2.0, because that's the only one that apparently works with the current forum software.

Quote...or they are using the code straight from the Google Translate site.
Is there any way I can tell by how it looks, whether they are using code straight from Google, or the forum mod?  Of course I will report to him what you say, but details might help.

QuoteThe problem could also be a miss translation.
By "miss translation" do you mean like a glitch with a script or something?  I could submit countless examples; this is not a rare occurence by any stretch.  Or what does "miss translation" mean? 

I don't mean to sound critical.  I'm grateful that they can provide any translation at all.  And I'm grateful for this mod.  It's just the translation seems off so much that I do honestly wonder if it's malfunctioning, somehow.  Maybe I should explain that I don't understand anything about coding or writing mods.  I'm not sure if there should be some obvious explanation, but I don't have the technical knowledge needed?

The lost formatting is not a huge problem, if the translation is understandable.  The example I provided is really a mild example.  It's just so hard to understand, that  I think formatting would help me understand better.   I do think all the proper words are being provided by the translation, they're just in the wrong order.

QuoteThe captcha would be up to the site administrator/s,.....
No, no, in THIS forum I have a captcha, for every message I post, and every edit!  I was just curious why.

Thanks again  :)

Doburpally

#27
Quote from: brynn on March 04, 2012, 05:34:13 AM
They are definitely using this mod.

Cool.

Quote from: brynn on March 04, 2012, 05:34:13 AM
Is there any way I can tell by how it looks, whether they are using code straight from Google, or the forum mod?  Of course I will report to him what you say, but details might help.

No, it will look the same.
The code that I am using is the exactly the same as the one that you obtain from the google translate site.
The only difference is that I have added something like this:
' . $modSettings['google_translate_function'] . ' to insert the Admins config for that setting.

Quote from: brynn on March 04, 2012, 05:34:13 AM
By "miss translation" do you mean like a glitch with a script or something?

No

Quote from: brynn on March 04, 2012, 05:34:13 AM
I could submit countless examples; this is not a rare occurence by any stretch.  Or what does "miss translation" mean?

What I mean "miss translation" is when you insert a word  or character, the translator will not pick it up. This goes for any translator.

I have the Translator mod enabled in my third test site here.
You are welcome to go there and have a look.

How to use it?
Simply click the down drop and select the language to translate to.
In my case (for a test, I'll select Chinese (Simplified)) I chose that because it is so distinctive like Arabic.
Please see my screenshots.

Original


With Translation


Original


With Translation


As you can see, the Text has been translated, the smileys used have been moved to under the translated text.

This is coming from an English forum, if this doesn't work on the site that you are trying this on, it may be the first to show a problem.
The problem may be the language detection code used doesn't recognise the different language from the forum. ' . $txt['lang_dictionary'] . '
The fix would be to include a drop down in the mod settings area that will include all the language codes e.g. English = 'en'. This must be done so that Google Translate knows what language to translate from. With out it knowing what language to translate from, it will be very hard to get a translation.

I would be very interested to see if you can get this to work in my test site, if you can. If you can't get it to work in the site you're mentioning, that is clear to me that I'll need to create a language selection.

Thanks 8)

Doburpally

On the 07 March I will be flying to Brisbane and returning on the 21 March.
After the 21 march I will be continuing with fixing this mod.

brynn

#29
I'm sorry it has taken me so long to respond.  I will give that forum admin a link to this discussion, because I don't know exactly what  you mean by the little pieces of code that you showed.

I will try on your test site, and let you know if I can offer any comments.  But if that site is already in the English language, I will have no way of knowing the quality of the translation, because I only read English.  For example, in the examples you posted, clearly some kind of translation has occurred, but I can't judge the quality.  If it would be a simple thing for you to switch it to some other language, then when I have it traslated to English, I will be able to judge the quality of the translation.  If you can easily switch to another language, you can type the message in English anyway. 

The problem for me is that the translation mod/script is affecting messages that are originally typed in the translated language.  And whatever is happening, seems to also happen to the legitimately translated text.  (Did that make sense?) 

Oh look, another captcha for me!  Should I report this captcha thing somewhere else on this forum?  Because unless it is a spam control feature, usually once I'm registered and logged in, I don't expect captchas.

Doburpally

#30
Seriously, I don't know why you would want to translate a site to English if it is already in English ???

If the site that you are using is using Italian and you translate to English from the drop down, it should translate the whole forum (main menu, boards / posts, absolutely everything)
By looking at the attachments that you have provided tells me that the forum language is not getting detected 100%.

I am in the process of adding a forum language selection feature and double checking every piece of code before I upload my new version for this mod.

-edit-
Okay I have worked out the problem, I didn't add a Language selector in the Admin area due to too many languages to add. In stead, I have made it automatic detect forum language

I have uploaded the new v1.2

Later on down the track I will:
Enable / Disable Header location
Enable / Disable Link Tree Location

That way you get to choose where you want the Google Translate to go ;)

brynn

#31
QuoteSeriously, I don't know why you would want to translate a site to English if it is already in English
You seem not to be thinking through all the issues involved.

The site is not in English.  As I've said, the entire forum is in the Italian language, except here and there where someone types in English.  I did not know at first that some people were typing messages in English.  I was using the translation to read the entire forum.  When I started to ask about some of the weird translation I was getting, that's when the people I was talking to at the time told me they were typing in English.  But the messages were equally hard to understand as the translated messages.  It was only when I turned off the translation, to read the English messages, that I noticed that the translation was somehow working on English messages translated to English (because I would think a message typed in English should not be affected by the translation).

In my screenshots, you're looking at what I see with the translation mod in use, and again without.  The reason it looks like not everything is translated is the shot where I turned off the translator.  The person was typing in English on an Italian language forum.

As I've said, I don't understand much from a technical or coding perspective.  It appears to me that all the words are fairly accurately translated, but somehow, the word order gets all scrambled (and random, inappropriate capitalization added).  When I look at English messages translated to English, they do contain all the same words, except that they are not in the same order.  I think that somehow, the word order is changed by the translator, and I think that must be a bug.

I understand that your mod simply uses the Google script, and that you probably can't change anything about it.  But I was hoping that you could at least explain it.  Perhaps I will eventually contact Google about it.  I'm not sure.  But if I can find something better than the Google script, I will certainly use it instead.  To that end, I'm curious what kind of translator is in use in this forum?

Thanks again

PS - I looked at your Test Forum 3.  Unfortunately, I can't read any messages without registering and logging in.  If you can make it so I can read the messages without registering, I will be glad to test  :)

Edit
Perhaps you'd like to visit the forum, and test the translator.  Maybe seeing the problem in person will help you to understand?
http://inkscapeforum.it/index.php

Doburpally

Quote from: brynn on March 23, 2012, 09:06:26 PM
QuoteSeriously, I don't know why you would want to translate a site to English if it is already in English
You seem not to be thinking through all the issues involved.

The site is not in English.  As I've said, the entire forum is in the Italian language, except here and there where someone types in English.  I did not know at first that some people were typing messages in English.  I was using the translation to read the entire forum.  When I started to ask about some of the weird translation I was getting, that's when the people I was talking to at the time told me they were typing in English.  But the messages were equally hard to understand as the translated messages.  It was only when I turned off the translation, to read the English messages, that I noticed that the translation was somehow working on English messages translated to English (because I would think a message typed in English should not be affected by the translation).

In my screenshots, you're looking at what I see with the translation mod in use, and again without.  The reason it looks like not everything is translated is the shot where I turned off the translator.  The person was typing in English on an Italian language forum.

As I've said, I don't understand much from a technical or coding perspective.  It appears to me that all the words are fairly accurately translated, but somehow, the word order gets all scrambled (and random, inappropriate capitalization added).  When I look at English messages translated to English, they do contain all the same words, except that they are not in the same order.  I think that somehow, the word order is changed by the translator, and I think that must be a bug.

I understand that your mod simply uses the Google script, and that you probably can't change anything about it.  But I was hoping that you could at least explain it.  Perhaps I will eventually contact Google about it.  I'm not sure.  But if I can find something better than the Google script, I will certainly use it instead.  To that end, I'm curious what kind of translator is in use in this forum?

Thanks again

PS - I looked at your Test Forum 3.  Unfortunately, I can't read any messages without registering and logging in.  If you can make it so I can read the messages without registering, I will be glad to test  :)

Edit
Perhaps you'd like to visit the forum, and test the translator.  Maybe seeing the problem in person will help you to understand?
http://inkscapeforum.it/index.php

I went to the site, translations works fine for me.

The problem you have is not my mod it's with google.........

samurai-lupin

Hello, this looks like a great mod! Could it be backported to SMF 1.1 ?

Doburpally

Quote from: samurai-lupin on March 26, 2012, 01:20:05 AM
Hello, this looks like a great mod! Could it be backported to SMF 1.1 ?

Sure, I can add support for 1.1.xx
However, I wouldn't know where to start by adding support for Administration Setting Functions. I am a SMF 2.0 supporter.

For now I can add automatic Lang Detect that will go straight in to the index.template.php, that's it.
As for customisation as in the type of bar (vertical, horizontal, drop down only) and dark theme styles etc will have to wait until I learn what files in 1.1.xx to add the changes to etc.

I am adding support for 1.1.xx now ;)
Thanks mate

Doburpally

I have made the changes and tested accordingly.

I have removed the Style CSS background because I have changed the location of the Google Translate drop down bar.
The new position is underneath the Link Tree, still have the ability to change left, center, right and you still have the ability to change horizontal, vertical, dropdown only.

I will add the option for the API in this mod. However, the API will not work until you install the Google API mod.

I have successfully added support for 1.1.10 - 1.1.16. If you want support lower than 1.1.10 then you will have to ask me so I can check the code to search for to see if it has changed, if not I'll change the package forum version.

Quote from: Reaper.CSF. on January 16, 2012, 04:36:14 PM
Please remember to completely uninstall and remove the old version before installing this new one ;)

samurai-lupin

Thank you! I will download the mod and test it on SMF 1.1!

samurai-lupin

I have tested it and it works fine on SMF 1.1 ... thank you!

Is there a way though to disable the Google Bar that appears on the top of the pages? I think the pull down menue is sufficient.

Doburpally

You can fix it by editing index.template.php
Find:// Google Translate Mod
echo'
<br />
<div align="right"><div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: \'auto\',
    layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL
  }, \'google_translate_element\');
}</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script></div>';


Change the following:
    pageLanguage: \'auto\',

with one of the following language codes to your forum language:
Eg:
English forum = en

af = AFRIKAANS
sq = ALBANIAN
ar = ARABIC
be = BELARUSIAN
bg = BULGARIAN
ca = CATALAN
zh-CN = CHINESE_SIMPLIFIED
zh-TW = CHINESE_TRADITIONAL
hr = CROATIAN
cs = CZECH
da = DANISH
nl = DUTCH
en = ENGLISH
eo = ESPERANTO
et = ESTONIAN
tl = FILIPINO
fi = FINNISH
fr = FRENCH
de = GERMAN
el = GREEK
ht = HAITIAN_CREOLE
iw = HEBREW
hi = HINDI
hu = HUNGARIAN
is = ICELANDIC
id = INDONESIAN
ga = IRISH
it = ITALIAN
vc = JAPANESE
ko = KOREAN
lv = LATVIAN
lt = LITHUANIAN
mk = MACEDONIAN
ms = MALAY
mt = MALTESE
no = NORWEGIAN
fa = PERSIAN
pl = POLISH
pt = PORTUGUESE
pt-br = PORTUGUESE_BRAZ
ro = ROMANIAN
ru = RUSSIAN
sr = SERBIAN
sk = SLOVAK
sl = SLOVENIAN
es = SPANISH
sw = SWAHILI
sv = SWEDISH
th = THAI
tr = TURKISH
uk = UKRAINIAN
vi = VIETNAMESE
cy = WELSH
yi = YIDDISH

I am working on a Admin settings page but atm it's not going too good.

samurai-lupin

Thank you very much! I will give it a try!

Advertisement: