Giter Club home page Giter Club logo

Comments (8)

vvoovv avatar vvoovv commented on May 11, 2024

Dojo provides an internationalization framework originally developped by IBM and borrowed from Java:
http://dojotoolkit.org/reference-guide/1.8/dojo/i18n.html

from id.

tabacha avatar tabacha commented on May 11, 2024

I am not able to run the dojo example in chorme webbrowser under linux. It is for me not clear how much js code from dojo is needed to get a working i18n stack.

Perhabs we frist start with a wish list:

Wishlist for i18n

  • open source, free license
  • the framwork should support any language (utf8)
  • should support singular, plural
  • should support something like placeholdes: "Your way is %d nodes long"
  • should be easy to translated by the crowed (translatewiki)
  • loading languages on demand
  • get default language from browser
  • switch language without restart

How to write code

There are different aproches for writing code with i18n stacks (Example code showDialog("Server "+hostname+" is not reachable.") ):

  1. showDialog(l("Server %s is not reachable.",hostname))
  2. showDialog(l("%error.server-failed"))

I prefer the 1. solution.

Solutions I found:

When I have free time, I will test this solutions to the criteria above.

from id.

tabacha avatar tabacha commented on May 11, 2024

started to evaluate the frameworks in a new repository. Please feel free to join, fork, make pull requests:

https://github.com/tabacha/javascript-i18n-example

from id.

tmcw avatar tmcw commented on May 11, 2024

Tacking something on to this: what we use for translation should be able to expose the current language code, so that the taginfo integration can choose the right language for documentation.

from id.

jfirebaugh avatar jfirebaugh commented on May 11, 2024

Here's another requirement: interpolations should be named or numbered, not positional. I.e. "Server {name} at {address} is not reachable.", rather than "Server %s at %s is not reachable." A translation may need to reorder the interpolations.

from id.

vvoovv avatar vvoovv commented on May 11, 2024

As far as dojo is concerned, all the requirements are met except "switch language without restart"
The requirement "Server {name} at {address} is not reachable." is met with dojo/string module: http://dojotoolkit.org/reference-guide/1.8/dojo/string.html

But there was the political decision to get rid of dojo :)

from id.

tmcw avatar tmcw commented on May 11, 2024

Yes, dojo is out of the picture at this point and re-including it for one feature is unlikely. Though, it was a technical decision, it's only political if you make it one :)

from id.

jfirebaugh avatar jfirebaugh commented on May 11, 2024

So far our translation needs are quite simple, so we implemented our own (12 loc) microframework. Will be easy enough to replace with something more heavy duty if needed.

from id.

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.