Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creation of moment+langs.js #1057

Merged
merged 1 commit into from
Sep 9, 2013
Merged

Conversation

wyantb
Copy link
Contributor

@wyantb wyantb commented Sep 9, 2013

Represents a continuation of #973 (didn't mean to create a new pull request specifically, but all the old work was made irrelevant anyway, and apparently github auto-closes pull requests if you delete the branch. Go figure).

moment+langs.js is a version of moment.js, prepackaged with all languages. Can specify --embed_languages=ar,br to create min/moment+customlangs.js with just those two languages (went with this over min/moment+ar+br.js since it was easier to configure; could switch over if that's still your wish). Also didn't indent the lang closures, since I think the file is readable as is; again, could indent if you guys want.

If you're wondering about lang/da.js, that was just a minor tweak so that it would match the replacement regex and pass jshint. And the error message is mostly in reference to lang/hr.js, which at this time has the old node-require instead of a UMD wrapper, giving example output of:

Warning: all language files must use the common UMD wrapper pattern. Failed language file: lang/hr.js

moment+langs.js is a version of moment.js, prepackaged with all
languages.
@ichernev
Copy link
Contributor

ichernev commented Sep 9, 2013

That looks pretty good, thanks for the effort!

ichernev added a commit that referenced this pull request Sep 9, 2013
Allow creation of moment+langs.js
@ichernev ichernev merged commit 63adde9 into moment:develop Sep 9, 2013
@JobaDiniz
Copy link

Hi, i'm running:

grunt release --embed_languages=de,fr 

However, the moment-with-customlangs.min.js is not being generated.
The console gives me:

Destination min/moment-with-customlangs.min.js not written because src files were empty.

@wyantb
Copy link
Contributor Author

wyantb commented Jul 24, 2014

Hi @JobaDiniz

grunt release --embed_languages=de,fr

apparently should be

grunt release --embedLanguages=de,fr

@ichernev did anyone ever add documentation around the embedLanguages option? If so and I used the former, that seems to be incorrect. embed_languages seems to magically work with Grunt 0.4.0 (I'm not sure how) but only embedLanguages works with Grunt 0.4.5.

@ichernev
Copy link
Contributor

I believe we didn't add proper docs about that. We need to do it. I have to read grunt docs to figure the right capitalization.

@JobaDiniz
Copy link

@wyantb thanks man! It worked. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants