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

Add Internationalization #84

Open
JosXa opened this issue Jun 12, 2017 · 6 comments
Open

Add Internationalization #84

JosXa opened this issue Jun 12, 2017 · 6 comments

Comments

@JosXa
Copy link

JosXa commented Jun 12, 2017

So I came across this library listening to your Podcast with Michael Kennedy and immediately loved this addition to your "python for humans" series. What discourages me though, is that there doesn't seem to be a possibility for changing the language. I saw that the humanize module you're using for the slang dates actually supports internationalization via i18n, so what steps would need to be taken to support full internationalization for this great piece of software?

@kennethreitz
Copy link
Owner

No plans at this time! I'm fine with only supporting English, as it seems to be the "esperanto" of the internet — i think a great approach might to be a wrapper that translates the french/italian/etc/etc into english and then runs it through the parser.

@moin18
Copy link
Contributor

moin18 commented Jun 13, 2017

I think we can utilize the internationalization support from the pendulum library. Anyway maya has a dependency on pendulum

@kennethreitz
Copy link
Owner

@moin18 have an API proposal?

@alxwrd
Copy link
Contributor

alxwrd commented May 15, 2018

I've had a look into this and it seems dateparser supports parsing different languages, so therefore maya's .when() will too.

>>> import maya
>>> maya.when("2日前").slang_time()
'2 days ago'
>>> maya.when("il y a 2 jours").slang_time()
'2 days ago'
>>> maya.when("Vor 2 Tagen").slang_time()
'2 days ago'

For slang_time/date pendulum does have support for human output in different locales, but only for time. I will open a PR to discuss the changes.

@timofurrer
Copy link
Collaborator

@alxwrd Sounds great!

@github-actions
Copy link

This Issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

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

No branches or pull requests

5 participants