Comments (6)
Yohan - It's a good idea, but I'm not sure what I'd want the implementation to be. I'll have to give it some thought. In the mean time, some real world use cases and a pull-request with changes that are tested and backward compatible would go a long way. Do you know coffeescript? :)
from jquery-localize.
Don't know coffeescript but I can sure learn! I can't do a pull request on github... do I need special permissions?
Btw, with the oncoming official localization plugin from Microsoft, do you think your efforts are still worth it?
from jquery-localize.
I haven't really looked at the microsoft plugin much, but a quick glance at https://github.com/jquery/globalize#generating says that some things require Windows and dot-Net. Thanks, but no thanks.
Also, for all that README, I couldn't find any obvious instructions as to how I might use it on a site. For instance, jquery-localize will automatically detect the language, download the language pack (json file), and apply the translations to the page. It looks like the globalize plugin might be more thoughtful on the side of supporting date and currency formats, but otherwise leaves plenty of work for the developer to implement. I could potentially see a case for jquery-localize to make use of globalize, but I'd have to understand it more before making that call.
from jquery-localize.
RE the pull-request question: http://help.github.com/send-pull-requests/
from jquery-localize.
Hehe I thought the same thing when I read through the documentation for the Microsoft plugin... "how do I get started?!".
Thanks for the information.
from jquery-localize.
Hello,
this could be a very handy feature.
I have edited the code proposed by yohanb with the html5 data attribute:
var elem, key, value, attr;
elem = $(this);
key = elem.data("localize");
key || (key = elem.attr("rel").match(/localize[(.*?)]/)[1]);
attr = elem.data("localize_attr");
value = valueForKey(key, data);
if (attr != null) {
return elem.attr(attr, value);
}
return localizeElement(elem, key, value);
Possible use:
from jquery-localize.
Related Issues (20)
- default fallback
- Callback not working with Phonegap + Onsen UI HOT 2
- Using localize with icons
- meta tags
- how to get value from json in the JS file HOT 1
- Using translation in title and alt attributes HOT 3
- Switching back to no language file on click HOT 1
- Use localize at any js file.
- Localize Semantic UI modals HOT 1
- language variant codes are not handled
- not working in Chrome HOT 2
- How to localize an array?
- The license version
- API Call
- Loading JSON file twice for some reason HOT 1
- Documentation improvement
- Is there a way to use this library without html elements
- get string from javascript
- How to customize the jquery.localize.js file to pass different languages HOT 1
- Is there a way to do %s placeholders?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-localize.