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

#15 language content implementation ready. #16

Merged
merged 3 commits into from
Jul 22, 2022

Conversation

zadinvit
Copy link
Contributor

Hi,
I create support for dynamically change content type by i18n language #15. If user set up content, it will use config content. I think this can't broke anything else. It's just reads country name from query params.

@nshenderov nshenderov linked an issue Jul 7, 2022 that may be closed by this pull request
Comment on lines 81 to 87
//set locale language code to content
let language = editor.language;
if (languageContent) {
const countryCode = languageContent.split("-")[0]
if (countryCode)
language = { content: editor.language.content ? editor.language.content : countryCode, ui: editor.language.ui, textPartLanguage: editor.textPartLanguage }
}
Copy link
Owner

Choose a reason for hiding this comment

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

@zadinvit Hi, thank you for your pr.
I think we need some changes here:

          let language = editor.language;
          if (languageContent) {
            const countryCode = languageContent.split("-")[0]
            if (countryCode && language)
              language = { 
                content: language.content || countryCode,
                ui: typeof language === "string" && language || language.ui || auth.getUserInfo().preferedLanguage,
                textPartLanguage: language.textPartLanguage 
            }
          }

And this should be inside if(editor) statement below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi,
I agree with you. I move your changes to my code at my branch tomorow. Thanks for improve my code.

@zadinvit
Copy link
Contributor Author

@nshenderov I merge you changes to code.

@zadinvit zadinvit requested a review from nshenderov July 14, 2022 07:23
@nshenderov nshenderov merged commit e12a0f4 into nshenderov:master Jul 22, 2022
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.

Change language content by i18n active language
3 participants