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

Allow a 'default locale' and locale switcher on status pages #3523

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

wampiedriessen
Copy link

@wampiedriessen wampiedriessen commented Aug 3, 2023

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

Fixes #2196, fixes #1643, fixes #3487
I use UptimeKuma myself, and found myself in need of a 'default locale' selector for the status page.

Since I thought: we do not want to force a language upon anybody, i also built an optional 'locale selector' in the top-right corner of the statuspage.

If somebody (logged in user) already has a known locale (which is set in the localstore) that language is used.
If the page has a default locale, that language is set temporarily (only for that page)
If the statuspage has a language selector and it is used, that language is saved into the localstore (I presume a user wants the same language on all status-pages of the website)

Type of change

Please delete any options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update (maybe, don't really know)

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas
    (including JSDoc for methods)
  • My changes generate no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

afbeelding
afbeelding

@wampiedriessen

This comment was marked as resolved.

@CommanderStorm

This comment was marked as resolved.

@wampiedriessen

This comment was marked as resolved.

src/mixins/lang.js Outdated Show resolved Hide resolved
src/mixins/lang.js Outdated Show resolved Hide resolved
src/mixins/lang.js Outdated Show resolved Hide resolved
@wampiedriessen
Copy link
Author

re-reading the contributing guide I seem to have overlooked the 'create an empty pull request as to allow for discussion first'.

My apologies, feel free to still discuss these features as if they hadn't been written :)

@louislam louislam added this to the 2.0.0 milestone Aug 10, 2023
@louislam

This comment was marked as resolved.

server/database.js Outdated Show resolved Hide resolved
@louislam louislam added the question Further information is requested label Sep 11, 2023
@wampiedriessen wampiedriessen changed the base branch from master to 2.0.X October 16, 2023 08:11
@wampiedriessen wampiedriessen changed the base branch from 2.0.X to master October 16, 2023 08:16
@wampiedriessen
Copy link
Author

Hi @louislam ,

Really sorry to bother you.

I have altered my migration into a knex migration, but it seems that the auto-test does not correctly bootstrap the base migrations for the project.

Am I doing something wrong, or should there be a fix introduced into the auto-tester?

@louislam
Copy link
Owner

I am re-implementing new auto-test due to this issue. You could ignore them at this moment if you tested successfully in your local environment.

#3893

@louislam louislam added question Further information is requested and removed question Further information is requested labels Oct 16, 2023
@louislam
Copy link
Owner

Tested. It doesn't seem to be working for me.

  • No matter on or off, the dropdown is always on.
  • The default language is not working, i set it to Japanese, but it is still show my primary language (Traditional Chinese) even in a private tab.

image

The database looks fine.

image

@louislam louislam modified the milestones: 2.0.0, 2.1.0 Nov 23, 2023
@chakflying chakflying added the area:status-page Everything related to the status page label Dec 2, 2023
@pheiduck

This comment was marked as resolved.

@CommanderStorm

This comment was marked as resolved.

@CommanderStorm CommanderStorm added the pr:please address review comments this PR needs a bit more work to be mergable label May 19, 2024
@CommanderStorm
Copy link
Collaborator

Tested. It doesn't seem to be working for me

@wampiedriessen
Sorry to bother you, but might this be an issue of different testing strategy? How did you test the PR?

@wampiedriessen
Copy link
Author

Hey guys,
I'm back from a long holiday.

This PR was waiting for the introduction of v2.
I believe something broke when the new migration system was introduced or something?

I had tested it waay before, using the devcontainer and a browser.

I might find the time somewhere in the future to revisit these changes and fix things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:status-page Everything related to the status page pr:please address review comments this PR needs a bit more work to be mergable question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Select language for each status page Langage in status page RTL Status page
6 participants