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

Translating the pipe output #43

Closed
theunreal opened this issue Jun 10, 2016 · 8 comments
Closed

Translating the pipe output #43

theunreal opened this issue Jun 10, 2016 · 8 comments

Comments

@theunreal
Copy link

Is it possible to translate to another language the pipe output?

For example, changing "X Hours ago" to another language?

@urish
Copy link
Owner

urish commented Jun 10, 2016

@urish urish closed this as completed Jun 10, 2016
@theunreal
Copy link
Author

theunreal commented Jun 11, 2016

@urish Are you sure this documentation works with this module?
I've been trying to use moment.locale('fr'); after importing import * as moment from 'moment'; but the language locale is still English.

Also tried to log console.log(moment(1316116057189).fromNow());
and got Error: TypeError: moment is not a function

@urish
Copy link
Owner

urish commented Jun 11, 2016

You may also need to loaded locale files, as explained here:
http://momentjs.com/docs/#/i18n/loading-into-browser/

Do you get English or French output when you call moment().fromNow()?

@theunreal
Copy link
Author

thanks @urish, I didn't load the locale file - but I have no idea how to load it after moment is loaded, since I'm using SystemJS.
When I output moment().fromNow() I get Error: TypeError: moment is not a function as described in my last post

@urish
Copy link
Owner

urish commented Jun 11, 2016

You can try to import "moment/locale/fr" after importing moment and see if this does the trick.
Anyway, it sounds weird that you are not able to call moment() despite being able to call moment.locale('fr') - I suggest that you post a question on StackOverflow about that.

@theunreal
Copy link
Author

The import you suggested worked, Thanks!

@urish
Copy link
Owner

urish commented Jun 11, 2016

👍

@qingfx
Copy link

qingfx commented Jun 14, 2016

Kudos on import "moment/locale/fr"

I was just struggling to figure out how to import a JS file into TS source

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

No branches or pull requests

3 participants