duanjingyu007 / jquery-i18n-properties

Automatically exported from code.google.com/p/jquery-i18n-properties
0 stars 0 forks source link

Dynamic #28

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I've tried to make this plugin dynamic in my code.

I use this code : 

navigator.globalization.getPreferredLanguage(
                                    function (locale) {
                                        jQuery.i18n.properties({
                                            name:'Messages',
                                            path:'bundle/',
                                            mode:'both',
                                            language: locale.value,
                                            callback: function() {                                                                                                                               
                                                    var tags = getAllElementsWithAttribute('data-lang');
                                                    jQuery.each(tags, function() {
                                                            var leTexte = $(this).data("lang");
                                                            $(this).html(leTexte);
                                                    });
                                            }
                                        });
                                    }
                                );

It doesn't works because au "leTexte" var, this var contain name of value in 
properties file.

How I can dynamic the code. Without that, I need to add all texts in my JS to 
change them.

Original issue reported on code.google.com by estelle....@gmail.com on 24 Jul 2013 at 12:19

GoogleCodeExporter commented 8 years ago
ok found the solution 
$(this).html(jQuery.i18n.prop(leTexte));

Original comment by estelle....@gmail.com on 24 Jul 2013 at 12:36