Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autobuild locale settings for function names #2111

Merged
merged 10 commits into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/bin export-ignore
/composer.lock export-ignore
/docs export-ignore
/infra export-ignore
/mkdocs.yml export-ignore
/phpunit.xml.dist export-ignore
/samples export-ignore
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).

### Changed

- Nothing.
- Use of `nb` rather than `no` as the locale code for Norsk Bokmål.

### Deprecated

Expand Down
23 changes: 23 additions & 0 deletions bin/generate-locales
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/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(
__DIR__ . '/../src/PhpSpreadsheet/Calculation/locale/',
'Translations.xlsx',
$phpSpreadsheetFunctions
);
$localeGenerator->generateLocales();
} catch (\Exception $e) {
fwrite(STDERR, (string) $e);
exit(1);
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
},
"autoload-dev": {
"psr-4": {
"PhpOffice\\PhpSpreadsheetTests\\": "tests/PhpSpreadsheetTests"
"PhpOffice\\PhpSpreadsheetTests\\": "tests/PhpSpreadsheetTests",
"PhpOffice\\PhpSpreadsheetInfra\\": "infra"
}
}
}
960 changes: 481 additions & 479 deletions docs/references/function-list-by-category.md

Large diffs are not rendered by default.

1,072 changes: 537 additions & 535 deletions docs/references/function-list-by-name.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/topics/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ $spreadsheet->getActiveSheet()->setCellValue('B8',$internalFormula);
```

Currently, formula translation only translates the function names, the
constants TRUE and FALSE, and the function argument separators.
constants TRUE and FALSE, and the function argument separators. Cell addressing using R1C1 formatting is not supported.

At present, the following locale settings are supported:

Expand All @@ -216,7 +216,7 @@ French | Français | fr
Hungarian | Magyar | hu
Italian | Italiano | it
Dutch | Nederlands | nl
Norwegian | Norsk | no
Norwegian | Norsk Bokmål | nb
Polish | Jezyk polski | pl
Portuguese | Português | pt
Brazilian Portuguese | Português Brasileiro | pt_br
Expand Down
Loading