papandreou / node-cldr

node.js library for extracting data from CLDR (the Unicode Common Locale Data Repository)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

language direction?

nkhine opened this issue · comments

Hello, is there a way to get the language direction as defined in http://www.w3.org/TR/html401/struct/dirlang.html from node-cldr?

something like the following coffeescript:

i18n = require "i18next"
cldr = require "cldr"

code = i18n.lng().substr(0, 2)
dir = cldr.extractDirection(code)

should return ltr or rtl

Implemented in 2.1.4, although with a slightly different API that matches the structure of the CLDR data: https://github.com/papandreou/node-cldr#cldrextractlayoutlocaleidroot

Unfortunately, I'm failing to publish version of the package to the npm repo right now due to an npm problem, but in the mean time you can check out master and see if it does the right thing.

nice one thanks

On Thu, Apr 3, 2014 at 2:28 PM, Andreas Lind Petersen <
notifications@github.com> wrote:

Implemented in 2.1.4, although with a slightly different API that matches
the structure of the CLDR data:
https://github.com/papandreou/node-cldr#cldrextractlayoutlocaleidroot

Unfortunately, I'm failing to publish version of the package to the npm
repo right now due to an npm problem, but in the mean time you can check
out master and see if it does the right thing.


Reply to this email directly or view it on GitHubhttps://github.com//issues/14#issuecomment-39450468
.

%>>> "".join( [ {'':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-83)%26) for
c in ",adym,
)&uzq^zqf" ] )