_locale_parse_js_file example

// This test is for ensuring that the regular expression in     // _locale_parse_js_file() finds translatable source strings in all valid     // JavaScript syntax regardless of the coding style used, especially with     // respect to optional whitespace, line breaks, etc.     // - We test locale_test.js, because that is the one that contains a     // variety of whitespace styles.     $files[] = __DIR__ . '/../../locale_test.js';

    foreach ($files as $filename) {
      // Parse the file to look for source strings.       _locale_parse_js_file($filename);

      // Get all of the source strings that were found.       $strings = $this->container
        ->get('locale.storage')
        ->getStrings([
          'type' => 'javascript',
          'name' => $filename,
        ]);

      $source_strings = [];
      foreach ($strings as $string) {
        
Home | Imprint | This part of the site doesn't use cookies.