p2 project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
759 B

2 months ago
#!/usr/bin/env php
<?php
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheetInfra\LocaleGenerator;
require_once 'vendor/autoload.php';
try {
$phpSpreadsheetFunctionsProperty = (new ReflectionClass(Calculation::class))
->getProperty('phpSpreadsheetFunctions');
$phpSpreadsheetFunctionsProperty->setAccessible(true);
$phpSpreadsheetFunctions = $phpSpreadsheetFunctionsProperty->getValue();
$localeGenerator = new LocaleGenerator(
realpath(__DIR__ . '/../src/PhpSpreadsheet/Calculation/locale/'),
'Translations.xlsx',
$phpSpreadsheetFunctions,
true
);
$localeGenerator->generateLocales();
} catch (\Exception $e) {
fwrite(STDERR, (string) $e);
exit(1);
}