FAQ Topic - Internationalisation and Multinationalisation in javascript. (2009-09-30)

F

FAQ server

-----------------------------------------------------------------------
FAQ Topic - Internationalisation and Multinationalisation in
javascript.
-----------------------------------------------------------------------

Internationalisation means using one form which is everywhere both
acceptable and understood. Any international standard not supported by
default can be coded for.

For example, there is an International Standard for numeric Gregorian
date format; but none for decimal and thousands separators.

Multinationalisation means using different forms for different
readers. It cannot work well in general, because it requires a
knowledge of all preferences and the ability to choose the right
one, in an environment where many systems are inappropriately
set anyway.

Javascript has a few Multinationalisation features. The various
` toString() `methods are all implementation dependent,
but tend to use either UK or US settings (not necessarily correctly).
ECMAScript Ed. 3 introduced some capabilities, including the
` toLocaleString() `method which should create a string
based on the host's locale.

Much more support is expected in future versions of ECMAScript.


The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/
 
T

-TNO-

Much more support is expected in future versions of ECMAScript.


Why? Wishful thinking, or is there some documentation or official
statement from TC39 that would lead one to expect this?
 
G

Garrett Smith

-TNO- said:
Why? Wishful thinking, or is there some documentation or official
statement from TC39 that would lead one to expect this?
Well, we get:
Date.prototype.toISOString

The FAQ section on Dates might want to mention that method, except for
the fact that only one browser I know of only one implementation (in
Firefox) and that is buggy.

Does not prepend the "+" for extended year, is not parsed by Date.parse.

<script>
var d = new Date;
d.setFullYear(10000);
document.write(d.toISOString());
</script>

Result:
10000-09-30T00:37:35.928Z

Should that not be "+010000-09-30T00:37:35.928Z"
and
Date.parse("+010000-09-30T00:37:35.928Z");

is NaN

| ECMAScript requires the ability to specify 6 digit years (extended
| years); approximately 285,616 years, either forward or backward, from
| 01 January, 1970 UTC. To represent years before 0 or after 9999, ISO
| 8601 permits the expansion of the year representation, but only by
| prior agreement between the sender and the receiver. In the simplified
| ECMAScript format such an expanded year representation shall have 2
| extra year digits and is always prefixed with a + or – sign. The year
| 0 is considered positive and hence prefixed with a + sign.

| Wednesday, Sept. 23 , Ecma TC39 approved the final version of the
| ECMAScript 5 specification and forwarded it to the Ecma General
| Assembly for final ratification as an Ecma standard. If all goes well,
| it will be ratified by the GA in December.
|
| The final versions is now available in Word and PDF forms at
|http://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft
|
| Allen Wirfs-Brock
| ECMASCript 5th Edition Project Editor.

http://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft

ECMAScript.org still has the April draft.
 
T

Thomas 'PointedEars' Lahn

-TNO- said:
Why? Wishful thinking, or is there some documentation or official
statement from TC39 that would lead one to expect this?

The former. The entry should be removed; it is _not_ a frequently asked
question at all¹. And (for some odd reason) the entry's author has been
confusingly redefining the terms "multinationalisation" and
"internationalisation" with regard to software development as compared to
commonly used dictionaries.


PointedEars
___________
¹ <http://svnbook.red-bean.com/en/1.5/svn.foreword.html>
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
september.org>, Tue, 29 Sep 2009 17:45:55, Garrett Smith
Well, we get:
Date.prototype.toISOString

Rather badly named, since it appears to conform with JSON rather than
ISO. JSON uses rather a small subset of ISO 8601.

Method is not in FF 3.0.14 - I'm not moving to FF 3.5 until newsgroup
mozilla.feedback.firefox seems happier with it, or I'm otherwise assured
that it is good in XP sp3.

<URL:http://www.merlyn.demon.co.uk/js-datex.htm#Auto> now tests
toISOString.

The FAQ section on Dates might want to mention that method, except for
the fact that only one browser I know of only one implementation (in
Firefox) and that is buggy.

Safari 4.0.3 has it, and Chrome 3.0.195.21. Not IE 8.0.6001.18702, not
FF 3.0.14, not Opera 10.00 1750.

IMHO, ISO 8601:2004 should not have made
that + mandatory for years after 9999.


It is a pity that the ECMA 5 team did not take more interest in ISO 8601
: mutating the words of Alfonso X, King of Castile and Leon (1221-1284),
about the Ptolemaic system - "If the Lord Almighty had consulted me
before embarking upon Creation, I should have recommended something
simpler^H^H^H^H^H^H^Hbetter."



<FAQENTRY> Change "expected" to "needed" <G?>




FYI : In Opera 9/10, although X = RegExp.$1 works,
with (RegExp) X = $1 gives a wrong value (""?) ;
in four other browsers, it works.


Query : Can JavaScript scroll a textarea, so that the bottom line
is shown, just like on a teletype or primitive VDU, without
re-writing the value field? It is needed.

Query : How to detect that an iframe has been fully loaded? I've not
succeeded with contentDocument.body.onload in FF.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top