digitoimistodude / air-light

💨 WordPress starter theme - designed to be minimal, ultra-lightweight (< 20 kB) and easy for all kinds of WordPress projects. 7+years/1000+hours of development and still updating daily! We prefer the original WordPress way of doing things so no strange templating languages or frameworks here.
https://airwptheme.com
MIT License
929 stars 139 forks source link

localization.js is getting replaced improperly by createtheme.sh #218

Open raikasdev opened 3 months ago

raikasdev commented 3 months ago

Seems like the newtheme script only replaces one occurence per line resulting in the script being broken.

Project name "test_project" results in code like this (the second clause after || is broken):

export default function getLocalization(stringKey) {
  if (typeof window.test_project_screenReaderText === 'undefined' || typeof window.air_light_screenReaderText[stringKey] === 'undefined') {
    // eslint-disable-next-line no-console
    console.error(`Missing translation for ${stringKey}`);
    return '';
  }
  return window.test_project_screenReaderText[stringKey];
}