Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

0 views
Skip to first unread message

FAQ server

unread,
Sep 29, 2009, 7:00:02 PM9/29/09
to
-----------------------------------------------------------------------
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/

--

The sendings of these daily posts are proficiently hosted
by http://www.pair.com.

-TNO-

unread,
Sep 29, 2009, 7:59:02 PM9/29/09
to
On Sep 29, 6:00 pm, "FAQ server" <javascr...@dotinternet.be> wrote:

> 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?

Garrett Smith

unread,
Sep 29, 2009, 8:45:55 PM9/29/09
to
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.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/

Thomas 'PointedEars' Lahn

unread,
Sep 30, 2009, 2:30:42 AM9/30/09
to

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>
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300...@news.demon.co.uk>

Dr J R Stockton

unread,
Sep 30, 2009, 5:07:36 PM9/30/09
to
In comp.lang.javascript message <h9u9o6$ulu$1...@news.eternal-
september.org>, Tue, 29 Sep 2009 17:45:55, Garrett Smith
<dhtmlk...@gmail.com> posted:

>-TNO- wrote:
>> On Sep 29, 6:00 pm, "FAQ server" <javascr...@dotinternet.be> wrote:
>>
>>> 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?
>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.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.

0 new messages