Skip to content

Commit

Permalink
Lower threshold for determining whether there is 'enough' VPN Content…
Browse files Browse the repository at this point in the history
… to justify an index page

Back when the entire VPN RC was powered by Contentful, we added logic
that would only allow the index page of the VPN RC to be displayed in
a particular locale if there were 'enough' articles translated into that
locale.

'Enough' was defined not as a specific threshold but as a
percentage of the overall number of documents available in en-US.

Initially, this was fine, but as the number of documents in en-US grew
the threshold failed to be reached, meaning the index pages for non-en-US
locales would redirect to en-US instead, because they didn't have "enough".

This bad decision will become irrelevant as soon as we start publishing
localized versions of the VPN content via the CMS, and then deleting
the code for the non-CMS page versions. However, we need a fix now,
so that if someone selects a locale from the footer of the en-US VPN RC
index page, they don't get redirected back to that same page.

The simplest fix is just to drop the threshold to 10%, down from 60%.
This basicallly makes that content redundant, but still supports the idea
of hiding the index if there are just one or two articles there (there
are 25 in en-US, so 10% would be hit if there are 3 or more available
in the other locale -- and _all_ of the other locales seem to have at least
5 articles localized to them, so this is fine as a threshold.)

Resolves #15521
  • Loading branch information
stevejalim authored and alexgibson committed Nov 19, 2024
1 parent 4c83bd9 commit 02db980
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bedrock/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ def _is_bedrock_custom_app(app_name):

CONTENTFUL_LOCALE_SUFFICIENT_CONTENT_PERCENTAGE = config(
"CONTENTFUL_LOCALE_SUFFICIENT_CONTENT_PERCENTAGE",
default="1" if DEV is True else "60",
default="1" if DEV is True else "10",
parser=float,
)

Expand Down

0 comments on commit 02db980

Please sign in to comment.