|
Hi, One way to do this is (indeed) to use seperate translations files in _javascript_. Create _javascript_ objects and use them normally. Then apply all the translation strings to the prototype of the objects. Include the necessary (language specific) file -after- the file with the object and things should be working. MyObject.js MyObject = function() {
// constructor }
MyObject.prototype = {
sayHello: function() {
alert(this.il8n.hello); } } EN.js MyObject.prototype.il8n = {
hello: 'hello world' } NL.js MyObject.prototype.il8n = {
hello: 'hallo wereld' } Consuming code: var foo = new MyObject(); foo.sayHello(); Regards, Rocco !0H0 !B0<5=:>28[ wrote: Hi. |
- [fw-general] How do you translate javascri... Саша Стаменковић
- [fw-general] Re: How do you translate... Rocco Bruyn
