Skip to content

feat(storefront): BCTHEME-613 Add translations for consent manager#4

Merged
BC-tymurbiedukhin merged 1 commit intobigcommerce:masterfrom
bc-alexsaiannyi:bctheme-613
Jun 30, 2021
Merged

feat(storefront): BCTHEME-613 Add translations for consent manager#4
BC-tymurbiedukhin merged 1 commit intobigcommerce:masterfrom
bc-alexsaiannyi:bctheme-613

Conversation

@bc-alexsaiannyi
Copy link

@bc-alexsaiannyi bc-alexsaiannyi commented Jun 23, 2021

@BC-tymurbiedukhin, @yurytut1993

What?

This PR adds a translated phrases from theme to consent manager. There is also a fallback phrases in EN that will be caught in case there are no translations available. This will enable merchants to use custom phrases/translations (in case they need) for GDPR/CCPA feature we built to help merchants collect data privacy consent from shopper's on the storefront.

Why?

This is done under CEV project. There is also related PR on Cornerstone side that can be checked here and here
Jira tickets can be found here and there

Screenshots

Phrases are using prefix lang_DE_ only as an example for visualization.

translations_consent_manager_1

translations_consent_manager_2

translations_consent_manager_3

How can this change be undone in case of failure?

Revert this PR

@bc-alexsaiannyi bc-alexsaiannyi force-pushed the bctheme-613 branch 2 times, most recently from afbf173 to ea4f902 Compare June 23, 2021 17:26
@bc-alexsaiannyi bc-alexsaiannyi changed the title [WIP] feat(storefront): BCTHEME-613 Add translations for consent manager feat(storefront): BCTHEME-613 Add translations for consent manager Jun 24, 2021
@bc-alexsaiannyi bc-alexsaiannyi force-pushed the bctheme-613 branch 2 times, most recently from 19063f7 to 1109374 Compare June 25, 2021 14:16
const categoryPlaceholder = '[CATEGORY_NAME]'
const replaceWith = (category: string, phrase: string) =>
phrase.replace(categoryPlaceholder, category)
const categoriesList = {

Choose a reason for hiding this comment

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

Could you please describe benefits of using this dictionary?

Copy link
Author

Choose a reason for hiding this comment

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

Only for taking category's names under one roof. So if we need to expand/modify categories in the future, we can look at them in one place and add/change them here without surfing through the file.

As I see you're offering to simplify it and use straightforward from translations like:

 replaceWith(
    translations.functional_category,
    translations.allow_category_tracking
)

correct?

Copy link

@BC-tymurbiedukhin BC-tymurbiedukhin Jun 29, 2021

Choose a reason for hiding this comment

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

For now not unified approach is used, for me simplified one (^^) looks better

Copy link
Author

Choose a reason for hiding this comment

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

done

Copy link

@BC-tymurbiedukhin BC-tymurbiedukhin left a comment

Choose a reason for hiding this comment

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

LGTM

@BC-tymurbiedukhin BC-tymurbiedukhin merged commit e4882ba into bigcommerce:master Jun 30, 2021
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.

4 participants