Comments (8)
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.
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.") ):
- showDialog(l("Server %s is not reachable.",hostname))
- showDialog(l("%error.server-failed"))
I prefer the 1. solution.
Solutions I found:
- Dojo: http://dojotoolkit.org/reference-guide/1.8/dojo/i18n.html
- i18next.js http://i18next.com/
- jsperanto.js https://github.com/jpjoyal/jsperanto
- jed.js http://slexaxton.github.com/Jed/
- messageformat.js https://github.com/SlexAxton/messageformat.js
- jquery.i18n plugin http://recursive-design.com/projects/jquery-i18n/
- wikimedia fork https://github.com/wikimedia/jquery.i18n
- l10n.js http://eligrey.com/blog/post/passive-localization-in-javascript
When I have free time, I will test this solutions to the criteria above.
from id.
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.
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.
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.
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.
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.
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)
- `highway=cyclist_waiting_aid` `side` gets reversed with the way HOT 8
- Adding another text along with street name HOT 1
- Mapillary viewer link to viewed image HOT 5
- Mapillary reintroduce filter by username HOT 8
- Intersected buildings are not detected HOT 3
- Styling of `hw=path + bicycle=designated` as Path-Line with blue (cycleway) dashes HOT 1
- :wikipedia bug HOT 5
- Character in wikidata box was displayed in strange linebreak HOT 1
- Deselecting a key with no value in the tag editor removes the key HOT 6
- Add a reference field for bicycle_rental
- Moving source in front of external source inherits external url
- make `f` shortcut smarter HOT 1
- Data loss after getting an error saving
- Data loss after too many nodes in way error HOT 1
- Release as Electron app HOT 4
- Add "Loading...", visible on congested networks
- Can't upload some changes
- amenity=bicycle_parking area should not require area=yes HOT 8
- Snap to points and follow line in custom data HOT 1
- Height Limit field horizontally overflows sidebar
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 id.