fix(i18n, client): use placeholder on map (#41064)

Modifies the translation flow for the certification buttons on the
learn/landing map to pass the superBlock title to the string as a
placeholder. This will allow translators to restructure the order
of the sentence (i.e. certification and hours) based on language-
specific grammar structures.
This commit is contained in:
Nicholas Carrigan (he/him)
2021-02-12 01:16:11 -08:00
committed by GitHub
parent 3b79b7836b
commit 1e0c09faff
4 changed files with 10 additions and 8 deletions

View File

@@ -21,8 +21,10 @@ const codingPrepRE = new RegExp('Interview Prep');
function createSuperBlockTitle(str) {
const superBlockTitle = i18next.t(`intro:${dasherize(str)}.title`);
return codingPrepRE.test(str)
? `${superBlockTitle} ${i18next.t('learn.cert-map-estimates.coding-prep')}`
: `${superBlockTitle} ${i18next.t('learn.cert-map-estimates.certs')}`;
? i18next.t('learn.cert-map-estimates.coding-prep', {
title: superBlockTitle
})
: i18next.t('learn.cert-map-estimates.certs', { title: superBlockTitle });
}
const linkSpacingStyle = {