Skip to content

Commit

Permalink
Fix non-constant variable definition (ampproject#6627)
Browse files Browse the repository at this point in the history
translation can be overwritten if the language isn't recognized.
  • Loading branch information
pothitos committed May 20, 2023
1 parent 5b790e0 commit 21274da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/source/1.components/amp-script/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ <h2 id="translated-greeting"></h2>
};

const lang = navigator.language.slice(0, 2);
const translation = translationMap[lang];
let translation = translationMap[lang];
if (!translation) {
translation = "Couldn't recognize your language. So: Saluton";
}
Expand Down

0 comments on commit 21274da

Please sign in to comment.