phensley / cldr-engine Goto Github PK
View Code? Open in Web Editor NEWInternationalization and localization in Typescript with Unicode CLDR, batteries included
Home Page: https://phensley.github.io/cldr-engine/
License: Apache License 2.0
Internationalization and localization in Typescript with Unicode CLDR, batteries included
Home Page: https://phensley.github.io/cldr-engine/
License: Apache License 2.0
I need them to pass to a currency input, so that I can match the input format to the locale. I've had a look but the data format is quite complex, so though I would ask if/how I would go about retrieving this data for a specific locale?
I'm trying to get a localised time interval using cldr.Calendars.formatDateInterval
. It always returns the date no matter what skeleton I pass as an option. e.g.:
cldr.Calendars.formatDateInterval(
start,
end,
{
skeleton: 'Hmm',
ca: 'gregory',
}
)
Returns something like this with the ja
language:
1/1 18:15~12/31 18:45
I'd like to get:
18:15~18:45
// Or even better:
18時15分~18時45分
When I look inside the language pack for Japanese, I see patterns like this one:
H時mm分~H時mm分
So it looks like the information is there, but somehow not surfaced.
I'd like to either have this function to comply more closely to the skeleton or a different function called cldr.Calendars.formatTimeInterval
.
Hi, @phensley — stumbled on this while trying to get another beta of the cldr json v38 data out.
tl;dr (yes, sounds like cldr) is, let's talk! Can you drop me an email? All my contact info is at https://github.com/srl295
Looking at:
I'm working on https://unicode-org.atlassian.net/browse/CLDR-14258 right now.
anyway, i'm working on another drop of the v38 beta CLDR JSON data on NPM. - i'll send an email to cldr-users when ready… It's already checked in to the new monorepo on the branch https://github.com/unicode-org/cldr-json/tree/for-38-beta2
Hi there, I was just wondering if there are any plans to add parsing to the feature stack. In some scenarios it would be nice to parse the date or number against the current user culture.
Regards
Benjamin
I stumbled upon this small bug, just thought I would leave this for you here. Testing for v0.25.1
with an English bundle loaded, this statement returns nothing instead of "Simplified Chinese":
cldr.General.getLanguageDisplayName('zh-Hans');
It only works for plain language ids, like 'en'
or 'es'
. I've included a snippet from the English bundle for reference, note that in most cases, the tag in question includes a region subtag, except in the case of Chinese.
"ar-001": "Modern Standard Arabic",
"de-AT": "Austrian German",
"de-CH": "Swiss High German",
"en-AU": "Australian English",
"en-CA": "Canadian English",
"en-GB": "British English",
"en-US": "American English",
"es-419": "Latin American Spanish",
"es-ES": "European Spanish",
"es-MX": "Mexican Spanish",
"fa-AF": "Dari",
"fr-CA": "Canadian French",
"fr-CH": "Swiss French",
"nds-NL": "Low Saxon",
"nl-BE": "Flemish",
"pt-BR": "Brazilian Portuguese",
"pt-PT": "European Portuguese",
"ro-MD": "Moldavian",
"sr-ME": "Montenegrin",
"sw-CD": "Congo Swahili",
"zh-Hans": "Simplified Chinese",
"zh-Hant": "Traditional Chinese",
(Source: https://github.com/unicode-cldr/cldr-localenames-modern/blob/master/main/en/languages.json)
https://github.com/phensley/cldr-engine/blob/master/packages/cldr-schema/src/code/names.ts#L6
Once again, thanks for all the hard work.
This is more a question than a bug report.
In a time interval, when I use the default 'middle-of-text' context with the fr
language, this is what I get:
cldr.Calendars.formatDateInterval(
start,
end,
{
skeleton: 'yMMMEd',
context: 'middle-of-text',
}
)
mar. 1 janv. – mar. 31 déc. 1963
Now, with context set to 'begin-sentence', I get the following:
Mar. 1 janv. – Mar. 31 déc. 1963
I would expect 'begin-sentence' to return something like this:
Mar. 1 janv. – mar. 31 déc. 1963
With only the first part of the interval capitalised, and the second part in lower case.
Is this the intended behaviour of CLDR?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.