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

Introduce global app language lookup #356

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

chrismayer
Copy link
Collaborator

This PR introduces a global application language lookup Vue.prototype.appLanguage, which allows to access the current language in a static manner from normal JS-/ES- resources, without being in a Vue component.

This introduces a global application language lookup, which allows to
access the current language in a static manner from normal JS-/ES-
resources, without being in a Vue component.
Copy link
Collaborator

@sronveaux sronveaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chrismayer,

Just tested the PR as requested and it works flawlessly as expected. Just two small remarks here:

  • Shouldn't this be explained in the docs somewhere ? This is perhaps something more global than just linked to this specific PR as the other globals aren't documented neither (thinking about $appConfig, $map, $isEmbedded and cmpLookup) and could be addressed later in an issue. This would imply to define which are defined for private use only and which ones would be considered as public API...
  • Perhaps more important, shouldn't the global be renamed to something like $appLanguage to follow Vue recommended best practices ?

Just take a second to think about those two and whether something should be done, other than that, it's ready to merge on my point of view !

@chrismayer
Copy link
Collaborator Author

@sronveaux You're totally right, I changed appLanguage to $appLanguage to follow Vue best practice.

Documentation of this global prop I would tackle in a separate step by generally documenting the global properties. With also taking some thoughts on which one should be usable by devs and which not (as already stated by you). I created an issue for that => #376

@chrismayer chrismayer merged commit 6cde5d3 into wegue-oss:master Apr 18, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants