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

fix: language-change-issue #18270

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kunalvirk
Copy link

What does it do?

Fix #18156

Describe the technical changes you did.
Removed the usePersistentState and made lang local to AssetPreview component.

Why is it needed?

The media editor dialog was changing the strapi-admin-language to en which was overriding the locale chosen by the user.

How to test it?

  1. Change the language to anything other than english in Profile page and save
  2. Then navigate to 'Media Library', select a preuploaded media and click Edit asset. Hit refresh, it should not change the language back to english

Thanks,

Related issue(s)/PR(s)

Let us know if this is related to any issue/pull request

@vercel
Copy link

vercel bot commented Oct 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
helper-plugin-storybook ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2023 11:03pm

@strapi-cla
Copy link

strapi-cla commented Oct 3, 2023

CLA assistant check
All committers have signed the CLA.

@kunalvirk kunalvirk force-pushed the fix-language-change-media-lib branch from 26d0716 to 2e1bdb3 Compare October 3, 2023 23:03
Copy link
Collaborator

@Boegie19 Boegie19 left a comment

Choose a reason for hiding this comment

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

@joshuaellis checked the PR fixes the issues only thing what I am not sure about is that is changes the srcLang of the track to be always English. so I am not sure if that could cause a problem.

@Boegie19 Boegie19 added source: core:upload Source is core/upload package pr: fix This PR is fixing a bug labels Oct 5, 2023
@innerdvations
Copy link
Contributor

Thanks for your PR! Could you please target the develop branch instead of main?

@@ -15,7 +15,7 @@ const CardAsset = styled(Flex)`
`;

export const AssetPreview = forwardRef(({ mime, url, name, ...props }, ref) => {
const [lang] = usePersistentState('strapi-admin-language', 'en');
const lang = 'en';
Copy link
Member

Choose a reason for hiding this comment

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

I actually think we can just get rid of this and the prop srcLang it's not really needed and iirc you need to know the language of the video, which might not be en.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community pr: fix This PR is fixing a bug source: core:upload Source is core/upload package
Projects
Status: To be reviewed
Development

Successfully merging this pull request may close these issues.

[Media Library] Change the interface language of the Admin panel
5 participants