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

How to add localization #27

Closed
leo-mck opened this issue Jun 22, 2014 · 3 comments
Closed

How to add localization #27

leo-mck opened this issue Jun 22, 2014 · 3 comments

Comments

@leo-mck
Copy link

leo-mck commented Jun 22, 2014

I tested all date parsers that I could find and chrono it is by far the best. I want to localise it to pt-BR (Brazilian portuguese). I see that there is already some languages supported on the "parsers" folder but I am not sure how to add another language into chrono. I can copy one, translate it and then what? What do I need to do so chrono use the new localization?

@wanasit
Copy link
Owner

wanasit commented Jun 22, 2014

Sorry for my slow respond. You can create a new localization by adding new parsers. I'm sorry to tell you that it would not be easy though.

First, please refer to the last part of the document about the parser. It's a kind of plug-in module that helps chrono recognize a certain pattern. I also recommend you to look at the German (DE) parsers as an example.

Then, I suggest you follow these steps:

  1. Create a new folder (should be BR) in the parsers folder
  2. Create a new parser for each specific date pattern used in your language.
  3. If you what to use the new parsers on the browser, include the new parsers into chrono by adding a line in minify.sh and run it.
  4. Create and run some tests to make sure that your work perfect. I recommend using karma.
  5. Send me a pull-request :)

I wish I can help you more but I really don't know Portuguese.
So, good luck.

@leo-mck
Copy link
Author

leo-mck commented Jun 23, 2014

Hey, thanks for your answer. As soon as I have some time I will try to do it since none of the other 3 libraries I tested are any closer to be so good as yours.

@leo-mck leo-mck closed this as completed Jun 23, 2014
@lfbittencourt
Copy link

@leo-mck Did you worked on this? I'm interested on pt_BR too :-)

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