You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see you recently did a major overhaul of Tr8n's Javascript component. It looks like some things were broken by it.
When I toggle inline translations in the language selector, I get the lightbox telling me that it enabled inline translation and then the page reloads. However, inline translations are not actually enabled. The page looks exactly the same and the link in the language selector still says "Enable inline translation".
The "Translation tools" link in the language selector does not work anymore. Firebug's console gives me "Tr8n.UI.LanguageSelector.showDashboard is not a function".
I noticed that the app/views/tr8n/language/select.html.erb template (which is included by tr8n_language_selector_tag) has different content compared to the app/views/tr8n/language/_select.html.erb partial. I experimented with removing all the content from the template and just rendering the _select partial from there. That made the "Translation tools" link work, but it broke the "Enable inline translation" link even more (now I just get "hideLightbox is not defined").
The text was updated successfully, but these errors were encountered:
For javascript, has anyone gotten dynamic translation working?
I've tried something along the lines of this where I have an anchor tag that when clicked does this function. I pass the text of what I want to be translated as a parameter.
function myFunction2(textToSay)
{
s = $("<%= tr("{text2Say}", "Message", {:text2Say => textToSay}, {:locale => "en-US"}) %>").text();
alert(s);
}
Also wondering if anyone has buttons working
Right now I have something like this
<%= tr("Hello World") %>
The button name will be translated, and the name will be underlined when in-line is on, but when I right click on it, nothing happens
hinrik,
I am still working on the JavaScript. It is mostly done, but there are still a few minor things that need to be taken care of.
iakona,
JavaScript Client SDK has the same tr method as the server side. So all you need to do is:
alert(tr("Hello World"));
In your example you are mixing server side code with client side - that wouldn't work.
I will document the JS Client SDK once i am done with all of the code changes.
Btw, those changes will now allow you to run tr8n as a separate server instance in parallel to your site. So you could translate more than one site using a single server instance. Or you can choose to continue running tr8n as a plugin.
I see you recently did a major overhaul of Tr8n's Javascript component. It looks like some things were broken by it.
I noticed that the
app/views/tr8n/language/select.html.erb
template (which is included bytr8n_language_selector_tag
) has different content compared to theapp/views/tr8n/language/_select.html.erb
partial. I experimented with removing all the content from the template and just rendering the _select partial from there. That made the "Translation tools" link work, but it broke the "Enable inline translation" link even more (now I just get "hideLightbox is not defined").The text was updated successfully, but these errors were encountered: