Michal Zugec write:
On 26.02.2010 12:36, Michal Zugec wrote:
Hi! I'd like to share my observation: I needed to share my javascript code between two files (it was form validation for new and edit action + some more) I created webyast-users-ui/plugins/users/public/javascripts/users_edit.js
and included it into my files with <%= javascript_include_tag "users_edit.js" %>
It's important to use $pluginname as prefix to be unique in whole project!
That's it ...
Bye, Michal
And jsuchome pointed me to one ugly fact : strings are not translatable. That's because .js file is not interpreted by rails (to apply translation into <%= _("sometext") %>), it's just send as it is. Any idea how to translate such string?
Bye, Michal
Reason is simple, you add javascript to public directory which is jsut served. I already look at this issue (not-supported browser js has same problem) and for me the best solution is to pass from view as parameter translated string as I don't see how we can use dynamic generated js elegant and clean. -- Josef Reidinger YaST team maintainer of perl-Bootloader, YaST2-Repair, parts of webyast -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org