Example #1
0
    {
        // Return diff language by language
        foreach ($languages as $language) {
            $this->output .= "\n * " . $language . ":\n";
            $current = $this->getTranslations("{$this->basePath}/{$language}");
            foreach ($default as $key => $values) {
                foreach ($values as $key2 => $value2) {
                    if (in_array($key2, ['custom', 'attributes'])) {
                        continue;
                    }
                    if (!isset($current[$key][$key2])) {
                        $this->output .= '    * ' . $key . ' : ' . $key2 . " : not present\n";
                    } elseif ($current[$key][$key2] == $default[$key][$key2]) {
                        $this->output .= '    * ' . $key . ' : ' . $key2 . "\n";
                    }
                }
            }
        }
    }
    /**
     * Save todo list.
     *
     * @param string $path Path.
     */
    public function save($path)
    {
        file_put_contents($path, $this->output);
    }
}
TodoGenerator::make(__DIR__ . '/../src')->save(__DIR__ . '/../todo.md');
Example #2
0
    {
        // Return diff language by language
        foreach ($languages as $language) {
            $this->output .= "\n * " . $language . ":\n";
            $current = $this->getTranslations("{$this->basePath}/{$language}");
            foreach ($default as $key => $values) {
                foreach ($values as $key2 => $value2) {
                    if (in_array($key2, ['custom', 'attributes'])) {
                        continue;
                    }
                    if (!isset($current[$key][$key2])) {
                        $this->output .= '    * ' . $key . ' : ' . $key2 . " : not present\n";
                    } elseif ($current[$key][$key2] == $default[$key][$key2]) {
                        $this->output .= '    * ' . $key . ' : ' . $key2 . "\n";
                    }
                }
            }
        }
    }
    /**
     * Save todo list.
     *
     * @param string $path Path.
     */
    public function save($path)
    {
        file_put_contents($path, $this->output);
    }
}
TodoGenerator::make(__DIR__ . '/..', ['script'])->save(__DIR__ . '/../todo.md');