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

Fixed slash command popup #184 #185

Merged

Conversation

CarlosPovedaC
Copy link

Issue #184 solved.

Bug description:

When you do a clean installation for devs, slash command popups doesn't show.

Fix description:

The problem is that variable localstorage.lang hasn't a default value so if you don't pick a language in the dropdown menu of the application settings the slash popups doesn't appears.

The "locale" variable had the default value, but was never used because the variable "localStorage.lang" was being assigned instead, so we just change "loaclStorage.lang" for "this.locale".

  • Before fix:

Captura de Pantalla 2022-10-09 a las 12 49 11

  • After fix:

Captura de Pantalla 2022-10-09 a las 12 52 00

Bug due to the variable localStorage.lang doesn't have a default value
@@ -14,7 +14,7 @@ export const translate = async (identifier, locale = localStorage.lang, data = {

export const Translations = {
locale: localStorage.lang ?? 'de-DE',
translationStrings: import(`./locales/${localStorage.lang}.json`),
translationStrings: import(`./locales/${this.locale}.json`),
Copy link
Owner

Choose a reason for hiding this comment

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

this.locale may not be always set upon startup - while it does not noticeably break the app, it still throws an error.

Could you change

locale: localStorage.lang ?? 'de-DE',
translationStrings: import(`./locales/${this.locale}.json`),

to

locale: localStorage.lang ?? 'en-US',
translationStrings: import(`./locales/${this.locale || 'en-US'}.json`),

@lostdesign lostdesign merged commit ee9dfea into lostdesign:master Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants