vuetifyjs / vue-cli-plugins

🔌 A collection of Vuetify plugins for Vue CLI
https://vuetifyjs.com/en/getting-started/quick-start#vue-cli-3
Other
427 stars 113 forks source link

[Bug Report] vuetify overwrites the lang="" attribute in index.html and will set it to lang="en" #274

Closed farhadnowzari closed 3 years ago

farhadnowzari commented 3 years ago

Environment

Vuetify Version: 2.4.0 Vue Version: 2.6.11 Browsers: Chrome 90.0.4430.212 OS: Windows 10

Steps to reproduce

just on a new vue project, run

vue add vuetify

Expected Behavior

It is expected that after adding vuetify to the project it doesn't change this value back to "en" because it causes a lot of issues with translators for users.

Actual Behavior

by default vue has the lang attribute set to empty according to the following issue but after adding vuetify, it will replace the lang="" with lang="en" https://github.com/vuejs/vue-cli/issues/5945

jacekkarczmarczyk commented 3 years ago

it doesn't change this value back to "en"

is doesn't "change this value back", it sets it to the language you have chosen in plugin options

farhadnowzari commented 3 years ago

I just created another project to check.

vue create some-project

index.html looks fine

then

vue add vuetify

Select Default (recommended) option (The first one)

and after adding index.html has lang="en".

no where in this process here it is asking me if I want vuetify to set lang="" to lang="en" so I will not know if vuetify has overwritten the vue lang="" because it was an issue before with vue and they fixed it. But now I realized that the default installation on vuetify is setting it to "en".

Edit: The rest of the changes which vuetify-plugin does to the project are visible and they are fine and noticeable but normally I did not expect that it replaces the index.html lang attribute because that was a fix which vue guys have done already

jacekkarczmarczyk commented 3 years ago

imho setting lang to "" should be only the workaround for those who have problem with translators, not the default behaviour

farhadnowzari commented 3 years ago

This is not related to vuetify to change it. It should leave it out because it has already had a long discussion in vue issues. Setting it to empty will let the browser to decide (maybe at some point vue-i18n library can have an implementation but so far they don't). Having it to empty for anyone who doesn't care about the translation will not matter but setting it to a default lang for every other project who people care about translators have a huge impact. When we had this issue with Vue and we did not know about it, users were complaining about the website and were doubting if the website they are reaching is fake. A proposal would be vue asks about the default locale but it doesn't they've just set it to empty. I think with vuetify it should be the same, it was an unexpected behaviour after that fix with vue.

ElijahKotyluk commented 3 years ago

If you don't want to use the presets you can select the configure option in the cli and it will prompt you for locale.

farhadnowzari commented 3 years ago

There is a config for the CLI? Ok I will try that.

ElijahKotyluk commented 3 years ago

I'm going to close this as this is currently the intended functionality and an option is provided to select locale if that is preferred. Feel free to open a feature request if you have any further suggestions, thank you.