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

Change default language based on YAML data #49

Closed
xplosionmind opened this issue Sep 5, 2021 · 4 comments
Closed

Change default language based on YAML data #49

xplosionmind opened this issue Sep 5, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@xplosionmind
Copy link

Describe the feature

As I understand, currently this plugin could automatically switch languages based on folders. Nevertheless, I have notes in Italian, English and French placed everywhere in every folder of my vault.

What I would like to have is for the plugin to read the lang: parameter in YAML and consequently set the language for that note.

For example:

lang: it

would set the language of the page in Italian.

Furthermore, it should be possible to set a default language, so that if lang: is not specified, it is the one chosen to be the main one.

Does this fix a problem? If so, specify.

Did you consider other alternatives?

Right now I am using the plugin for English notes only.

Screenshots and recordings

Current folder setup, to which the YAML setup should be added:
Screenshot 2021-09-05 at 5 35 53 PM

@xplosionmind xplosionmind added the enhancement New feature or request label Sep 5, 2021
@phibr0
Copy link
Owner

phibr0 commented Sep 5, 2021

I understand your Requests, but you have to remember that on changing the Language the User might also need to change their API Provider (because one might not be available in that language). How would that work?

@xplosionmind
Copy link
Author

How would that work?

There is no better solution, so I guess it would!

@phibr0
Copy link
Owner

phibr0 commented Sep 5, 2021

Would you be fine with using the Values on the left side as the Language Codes for the lang attribute?

export const LANGUAGES = {
    "en_US": "English (US)",
    "hi": "हिन्दी (Hindi)",
    "es": "Español (Spanish)",
    "fr": "Français (French)",
    "ja": "日本語 (Japanese)",
    "ru": "Русский (Russian)",
    "en_GB": "English (UK)",
    "de": "Deutsch (German)",
    "it": "Italiano (Italian)",
    "ko": "한국어 (Korean)",
    "pt_BR": "Português do Brasil (Brazilian Portuguese)",
    "ar": "اَلْعَرَبِيَّةُ‎ (Arabic)",
    "tr": "Türkçe (Turkish)",
    "cn": "中国人 (Chinese)"
}

@xplosionmind
Copy link
Author

xplosionmind commented Sep 5, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: done
Development

No branches or pull requests

2 participants