File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -161,9 +161,11 @@ function getAnimationStyles(
161161 * @returns {Promise<string> } - SVG markup for the statistics card.
162162 */
163163export default async function card ( data : GetData , uiConfig : UiConfig ) : Promise < string > {
164- const fallbackLocale = "en" ;
165- const defaultLocale = locales [ fallbackLocale ] ;
166- const selectedLocale = locales [ uiConfig . Locale ] || defaultLocale ;
164+ const getLocale = ( locale : string ) : string => {
165+ return Object . keys ( locales ) . includes ( locale ) ? locale : "en" ;
166+ } ;
167+ const activeLocale = getLocale ( uiConfig . Locale ) ;
168+ const selectedLocale = locales [ activeLocale ] ;
167169
168170 const isRtl = parseBoolean ( selectedLocale . rtlDirection || false ) ;
169171 const isAnimDisabled = parseBoolean ( uiConfig . disabledAnimations || uiConfig . Format === "png" ) ;
You can’t perform that action at this time.
0 commit comments