[08:05:09] hello [08:06:04] Hello Krinkle iskren [08:06:22] scott_gonzalez, jzaefferer, tj_vantoll [08:06:32] I am not sure if anyone else is joining [08:06:44] I guess this one will be iskren Krinkle and I. [08:06:59] I'm here, wathing :-) [08:07:11] iskren: Hi! [08:07:18] :) [08:07:21] hello rxaviers Krinkle [08:07:52] So, 2 weeks ago we had our first meeting and jzaefferer created this minutes [08:07:54] https://docs.google.com/document/d/1V8X33uphHUeUEhX8AYU4GZ4DrPPGxbbpuydqShDO-Gw/edit [08:08:17] During this time, iskren and I have talked about some implementation details. [08:09:14] I can talk a little about Globalize/CLDR updates, and I will pass the word to iskren to talk about Moment/CLDR [08:10:00] Sounds good. [08:10:53] Globalize now has CLDR date parse implemented, and I have updated the new new jQuery UI datepicker to use it. [08:11:35] Globalize uses cldr.js (a low level lib to manipulate CLDR JSON data) (<- introducing this to Krinkle) [08:12:07] After talking to iskren and jzaefferer, its README (and its code) got several improvements [08:12:20] Anyway... [08:12:52] iskren, would you like to go ahead with Moment/CLDR updates [08:13:01] So rxaviers explaned a lot to me in the past two weeks and now I feel I know cldr better, so I'm very thankful for that! [08:13:16] thanks, ywc [08:13:47] about moment/cldr -- I think it'd be best if its extracted as a separate plugin [08:14:28] the good news is that most of the existing i18n functionality can be implemented using cldr data, so that we can deprecate our in-house translations faster [08:15:20] also I kind of missed the globalize to cldr port in https://github.com/jquery/globalize/pull/172 I thought you were *thinking* of doing that [08:15:48] :) it's a reality (work in progress reality) hehe [08:15:49] so now that I know it exists it should be relatively simple to implement a moment wrapper around [08:16:14] I have a few comments that I can share with rxaviers later (or in the PR) [08:16:29] but overall it looks great [08:16:43] excellent, your comments are welcome [08:16:55] a question, if moment/cldr becomes a plugin. [08:17:14] how is it going to deal with formats or parses without it? [08:17:18] yes [08:17:22] I mean: is the plugin optional? [08:18:42] the easiest way is to have moment format/parse that is using old locales (for now, remove in 3.0 probably) [08:19:04] and then the plugin can overwrite these functions with new copies [08:19:45] rxaviers: So cldr.js, is that for the backend or front-end? I would like it to download or parse as little as possible client-side. [08:19:52] e.g. build script [08:19:52] you might be wondering how the incompatible tokens would work -- I guess the plugin can exist pre 3.0 and when we're happy we can just make it a default [08:20:21] and change moment's tokens [08:21:29] I have to talk to icambron about that, because I think we need another set of tokens for a "machine" locale (i.e stuff that can not be i18 but still needed on backend for example) [08:21:43] (Krinkle, it works both in frontend and backend, and it uses as little as possible client-side. I can walk you thru it offline) [08:21:47] iskren, I see. [08:22:13] also I want to kind of deprecate the use of cldr tokens, because ppl should learn to use the presets [08:22:34] I mean deprecate printing for users in format('MMM YYYY') way [08:22:50] yeah, presets are the way to go... [08:22:52] it can look like this but instead print month and year in a locale friendly way [08:23:09] but this means we need another format for "low level" machine readable format [08:23:17] That would also be most flexible for our API going forwards. Discourage specifying exact formats directly. [08:23:41] iskren: rxaviers and I discussed how we're going to handle that in Globalize the other day. [08:23:47] this part needs more work on our end to decide what goes where (moment-core or moment-cldr) [08:23:58] rxaviers: Do you want to go over the discussion we had about time/date and preset/explcit? [08:24:26] I think one of the biggest hurdles will be user education. [08:24:35] :) I completely agree [08:24:39] So many people are accustomed to writing explicit formats. [08:24:59] It's going to be hard to break that habit/explain why the format they wrote isn't the format they got back. [08:25:13] right scott_gonzalez, thanks for pointing that out [08:25:20] But we should definitely do everything we can to push users to use presets. [08:25:38] Although before getting into such details, I would like to hear what the overall roadmap plans iskren has for moment/CLDR vs. how Krinkle can help. [08:26:09] I know Krinkle has offered himself to help on the migration. [08:26:39] Is that correct? I think it would be good if Krinkle and iskren could align perspectives. [08:27:01] As well as early feedback from language experts. If there's anything I've learned about languages in the last few years is that no matter how simple or absracted something may seem, there's going to be a language we need to support that might blow up the plan. [08:27:06] well, the next step for me is to design the interface and make sure it is doable (we can split i18n independent code in moment-core) [08:27:24] then we can discuss this interface from your point of view (as users of moment-cldr) [08:27:47] And with Wikimedia on that front, it's going to be tough to find anything on the web that supports more languages and works close with CLDR on that front. [08:28:14] so Krinkle -- you want something that is still customizable on top of CLDR? [08:28:36] My main concerns are the API and the end result package format in the release. Though I didn't know initially, I know think the implementation is very much on the right track. [08:28:53] now* [08:29:42] iskren: Not per se no, if the release process would feature a build script that generates moment..js files for each of the cldr languages, that would be more than enough for now. I'll let you know if there's anything we think is justifiably required on top of that, but I don't think so at the moment. [08:30:02] We've fixed cldr upstream where needed in the past, and if we find more, I'm sure that'll get upstreamed as well. [08:30:32] Krinkle, the idea is to decouple I18n data from code [08:30:47] On globalize, we don't have globalize..js anymore [08:31:02] so I guess we won't have moment.lang.js, because the i18n data would come from cldr json, which would be handled by globalize [08:31:15] Right [08:31:34] Let me paste an example [08:31:50] Well, unless there's a better alternative, I think it's a required to be able to send the user a combination of lib + lib-lang (both js files, concatenatable) and have that do all the magic. [08:32:10] but I guess we might want overrides of the data, or even functional implementations on top to accommodate "bugfixes" in advance [08:32:24] based on user context, a different one (or multiple) lang files are bundled dynamically (and cached of course) [08:32:40] https://gist.github.com/rxaviers/7808600 [08:33:03] using abstracted data directly from cldr is great, but is it beneficial to burdon the client with requesting json, parsing it, and laying it out in the library? [08:33:23] checking [08:33:24] Krinkle, the main problem is that json data is split into multiple files (good), and you require different set of files for different things (hard to manage) [08:33:39] Krinkle: Let me try to explain the process. [08:33:49] CLDR provides a ton of locale data. [08:33:50] I understand it. [08:33:55] Krinkle, the way globalize works now is by using the json structure directly [08:34:04] You don't want to load it all in, right? [08:34:25] So the goal is the be able to produce stripped down locale data, but preserve the structure. [08:34:40] So say you only care about three specific date formats and 50 locales. [08:34:45] Sure, but wouldn't it make sense for there to be a release where the data moment.js needs is bundled so that for the common use case it is much easier to install, distribute and load? [08:35:00] I don't want to have to deal with getting that json file to the client and passing it to Globalize or moment.js [08:35:12] I assume jquery.ui won't do that either. [08:35:13] Krinkle, the cons of doing so is that all libraries that depends on I18n data duplicates them [08:35:30] Our goal is to be able to use the same I18n data across diff libs [08:35:33] I think that passing that data will happen one of two ways. [08:35:44] Either lib.load( data ) [08:35:58] or perhaps lib.dataSrc = data [08:36:19] The goal is to never duplicate the data, regardless of how many independent i18n libs you're using. [08:36:43] (much better put) [08:36:57] So let's say you had a global named CLDR, which was a hash of locale to data. [08:37:29] Each lib can decide on their own API for specifying that data, but they should all be written in a way that the data is injected. [08:37:40] So lib.load( "en", CLDR.en ) [08:37:51] or lib.locales = CLDR; [08:37:54] or whatever [08:38:13] And that gets us the ability to have the locale data as stripped down as we want. [08:38:23] As long as it's using the same structure as the original CLDR source. [08:38:35] So moment can ship files that are stripped down if it wants. [08:39:23] But that's a decision for moment to make, and it won't affect Wikimedia's ability to keep their client data as slim as possible. [08:39:44] Because even if moment doesn't generate locale files, you'd be able to do the same trimming process that moment would have done. [08:40:12] scott_gonzalez: I get that, but the most basic usage imho can't realistically involve having to manually do or load anything. I could elaborate on Wikimedia's use case, but let's take one jQuery UI datepicker for example. [08:40:45] what's the problem? [08:40:53] Having that option to share the data is great, but it shouldn't be the only way to load it. [08:41:01] So for UI datepicker, it'd look like this: [08:41:08]