GithubHelp home page GithubHelp logo

Comments (6)

coderifous avatar coderifous commented on September 16, 2024

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.

yohanb avatar yohanb commented on September 16, 2024

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.

coderifous avatar coderifous commented on September 16, 2024

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.

coderifous avatar coderifous commented on September 16, 2024

RE the pull-request question: http://help.github.com/send-pull-requests/

from jquery-localize.

yohanb avatar yohanb commented on September 16, 2024

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.

panurge-ws avatar panurge-ws commented on September 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.