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
Add user locale query parameter in help links to support.google.com
.
#2221
Comments
support.google.com
support.google.com
.
@adamsilverstein can we change the
Let's not use
This can be done unconditionally, as a
This should be applied with One detail which has not been covered here is how some of the support URLs are localized using a translation string, such as in Also, please assign an estimate once the IB is ready for review 🙂 |
That sounds fine to me, I think @felixarntz wrote the AC though :) |
@aaemnnosttv @adamsilverstein Updated ACs to use |
We don't need to have the exact code needed here, but just wanted to point out that the Aside from that, this LGTM. Regarding the estimate, I'm going to bump it up as 3 is a bit on the low side for everything described here, including CR+QA. IB ✅ |
@aaemnnosttv does it really need to be a selector? It seems to be a pure utility function that has nothing to do with datastores. By making it a selector, we introduce hooks to components that don't need hooks at all. Even if it doesn't look like a big deal, it increases the complexity of those components and the codebase itself. What do you think if we convert it to be just a utility function instead of a selector? cc @felixarntz @tofumatt |
@eugene-manuilov it looks like @felixarntz wrote the ACs for this. I agree that as-is that it doesn't seem to need to be part of the datastore, although perhaps the locale will be moved there? I'm not sure, but as it is, it seems like a utility function would be simpler. |
@aaemnnosttv @eugene-manuilov While this doesn't use anything from the datastore right now, the This function is based on the locale, a piece of information it receives implicitly (not a parameter), so I think it's another argument to move it to the datastore. |
@felixarntz would that mean that all of our i18n utility functions would need to move to the datastore then as well or these would require the locale to be passed when called where they don't now? I think it might make sense to keep the locale out of the datastore since it isn't likely to change during the page load like other data the store manages. |
@aaemnnosttv We can think about that, but even if we moved the locale to the datastore, we could still |
QA Update: Pass ✅Verified: The links pointing to support.google.com have a hl query parameter added |
Feature Description
When linking to help articles on
support.google.com
, Site Kit should set the language/locale query parameter (hl
) based on the user's WordPress profile language setting (get_user_locale
).The plugin links to help articles on https://support.google.com/ in numerous places:
Some of these are hard coded to use the english version (
&hl=en
). Instead, all should usehl=[USER_LOCALE]
.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
support.google.com
should include the current user's locale as thehl
(language) query parameter.support.google.com
in JS should be handled via agetGoogleSupportURL
selector of thecore/site
store. It should receive an object with optionalpath
,query
andhash
arguments. The selector should automatically add the current locale ashl
query parameter to the URL returned.support.google.com
should use thegetGoogleSupportURL
selector.Implementation Brief
getGoogleSupportURL
toassets/js/googlesitekit/datastore/site/info.js
.path
,query
andhash
arguments.query
and build theurl
object with thehl
parameter usinggetLocale()
fromassets/js/util/i18n.js
.url.hash = hash || ''
url.toString()
useSelect
hook:SetupAccountCreate.js
SetupAccountNoClient.js
AdSenseLinkCTA.js
AnonymizeIPSwitch.js
DashboardGoalsWidget.js
LegacyAnalyticsDashboardWidgetTopLevel.js
OptimizeIDFieldInstructions.js
UseSnippetInstructions.js
UseSnippetInstructions.js
. We don't need to translate the URL anymore since we are adding thehl
(locale) parameter.Test Coverage
assets/js/googlesitekit/datastore/site/info.test.js
Visual Regression Changes
QA Brief
support.google.com
should have ahl
query parameter added to them while everything else stays same.Learn more
link in the setup dialog, it should be as explained in point one.Changelog entry
getGoogleSupportURL
selector tocore/site
store in JS.The text was updated successfully, but these errors were encountered: