> I've tried it out in a freshly quickstarted app (attached at the
> ticket) and looks great. These are the steps I took in case anyone
> wants to try it out:
>
> 1) tg-admin quickstart
> 2) wrote a sample and dumb helloworld.js at ${package}/static/
> javascript and placed a button at welcome.kid to trigger the function.
> 3) registered that directory with widgets.register_statict_directory
> 4) set tg.include_widget = ["turbogears.jsi18nwidget"] in app.cfg
> 5) tg-admin collect
> 6) generated po in the toolbox
> 7) tg-admin compile
> 8) start app and enjoy
>
> Some comments & suggestions:
>
> 1) It took me some time to figure out 3. Couldn't the widget or
> something be more clever and do this automatically. I guess it's kind
> of unintuitive for those not using widgets to include their js files
> at the template. Maybe the i18n widget should be just an
> implementation detail and this functionallity work for those not
> using widgets at all.
I'm not sure I understand what you want here. I _do_ understand that the
registration step can be done - I just did it in my testing-app that
first didn't have any code in TG itself, so I just missed that things
don't work without it. I just added the necessary code and it works, I
replaced the patch in the trac.
What I don't understand is the rest. Everybody is free to include
js-files herself, but then she is on his/her own.
> 2) Do you have plans to make this useful for distributing 18n bundles
> with packaged widgets? From the code I guess messages-X.js must live
> inside a TG app but I might be wrong...
So far it has to live there, yes. I currently don't use packaged
widgets, but I can see it would be helpful to have this functionality
there.
The collect/merge/create-js-stuff should work the same way.
What is missing is the inclusion of the message-files with another
package-name - the packaged widget one.
I can thing of one of several ways to accomplish this. One would be to
factorize out the JSLink-creation facilities of the JSI18NWidget, giving
a packaged widget author a way to create the links with her own package
name as argument.
The other one would be a static registration of package names. Benefit
of the first approach: the amount of js-files included in each template
is reduced. Benefit of the second approach: the author has less to write.
Either or even both options could be included - but I need to get on
speed with packaged widgets, which I'm currently not - so I'm open for
help here. Well, I'm open for help in any case :)
Diez
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---