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

Multilanguage support #19

Open
paolo-santucci opened this issue Feb 20, 2021 · 8 comments
Open

Multilanguage support #19

paolo-santucci opened this issue Feb 20, 2021 · 8 comments
Labels
help wanted Accepting PRs for this feature requests

Comments

@paolo-santucci
Copy link

Hi, love your plugin. Do you plan to offer multilanguage support?
I'd be happy to provide the translated strings for Italian.

@argenos
Copy link
Owner

argenos commented Feb 20, 2021

It's not something I can prioritize right now, as I don't have the time nor the knowledge of other languages to make it work, but I'm willing to accept PRs if anyone wants to tackle this.

Whether it's actually possible, depends on what you mean by multi-language support:

  • for parsing dates, the package I'm using has limited support for parsing other languages
  • translating the output might be possible with the included Moment package but probably requires some refactoring of the source code

@argenos
Copy link
Owner

argenos commented Feb 20, 2021

See also #13

@argenos argenos pinned this issue Feb 20, 2021
@argenos argenos added the help wanted Accepting PRs for this feature requests label Feb 20, 2021
@RensOliemans
Copy link

I would like to pick this up - depending on the scope and refactoring necessary.
It seems chrono has support for 6 languages (docs):

  • en
  • ja
  • fr
  • de (partial)
  • pt (partial)
  • nl (under development)

Fixing the parsing for languages other than en is quite easy (I have that on a local branch right now), but that leaves you with the parser parsing a different languages than the suggestions (because the suggestions are hard-coded English), which is very unintuitive.

To fix it properly with suggestions (in the dropdown) and custom parsing options (next week, etc) requires quite some refactoring, and I'm not sure how we want the code to be at the end.
One idea is to extract the English suggestions from the logic, so that future PRs can easily add a new language by adding the translations of month/week/Sunday/x days ago/Today/etc. What are your thoughts on this?

This would still take quite some time, though, since we need to refactor large parts of parser.ts and date-suggest.ts.

@RensOliemans
Copy link

Easier solution: do everything with i18n. Then create language files that people can extend for their own languages (supported by chrono). I'm working on that, but not used to rollup so still having some trouble getting i18n included in the build (Obsidian says Plugin failure: nldates-obsidian Error: Cannot find module 'i18n')

@RensOliemans
Copy link

@argenos I merged master back into multilanguage, the PR is now updated. I've been building (from multilanguage) and using the plugin locally for some time and tested the changes manually, it works as expected.

If anyone else wants to test these changes for themselves (you'll have to build the plugin locally), take a quick look at the readme of this branch. Note that Only Dutch and English are supported fully as of now, for French/German/Japanese/Portuguese only "today", "tomorrow" and "yesterday" work.

@jaffall
Copy link

jaffall commented Jun 11, 2022

This is a great plugin.
I teach french speaking college students how to use Obsidian to keep track of notes and assignments.
So I second wholeheartedly multi language support. More specifically french.
Hope this gets picked up.

@RodWarrior
Copy link

I really want Pt-BR! I can help translate strings, no problem. I can't code, but can help translating.

@bruce3x
Copy link

bruce3x commented Sep 9, 2024

Hello, any update here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Accepting PRs for this feature requests
Projects
None yet
Development

No branches or pull requests

6 participants