Maintenance¶
Target group: Contributors, Developers
Translations¶
The translation to other languages is done within the Crowdin service. It is appreciated to add missing or incomplete languages. Please navigate to the project home. If the language is not available please drop me a note and I will create it.
Note
For now, the language files are integrated into a release of the extension. When the new translation structure (based on the translations within Crowdin) is in place, the language files (other than English) will be removed in favour of the new infrastructure.
Prism Library¶
For syntax highlighting Prism is used. The JavaScript library and its dependencies are
managed with yarn
and build with gulp
:
cd Build
yarn install
yarn build
The yarn build
command runs the according gulp task and copies the Prism components (aka languages), plugins
and themes to the Resources/Public/Vendor/PrismJs/
folder. Also a PHP file
Resources/Private/PHP/AvailableProgrammingLanguages.php
is generated with the available languages. It will
be used for the select box of programming languages in the backend form. The option values are “translated” via the
Resources/Private/Language/ProgrammingLanguages.xlf
file.
Update¶
To update the library to the recent version just call on the console:
cd Build
yarn upgrade prismjs
yarn build
The copied artifacts can now be committed (along with the package.json
file to the repository. Don’t forget to
add new files to the commit and add these to the translation file Resources/Private/Language/ProgrammingLanguages.xlf
.
Note
Due to the variants JavaScript files can be integrated into the page (as configured, last modification timestamp is
embedded into the filename, concatenated) the script
Build/node_modules/prismjs/plugins/autoloader/prism-autoloader.js
was patched: The variable
language_path
has to be set to /typo3conf/ext/codehighlight/Resources/Public/Prism/components/
.
When updating the Prism library, the patch under Build/patches/prismjs+1.xx.x.patch
has to be adjusted
eventually. The package patch-package is used for that.
Packaging of extension for TER¶
After setting the new version in the files
ext_emconf.php
Documentation/Settings.cfg
and adjusted the CHANGELOG.md
, the packaging of the extension for the TYPO3 Extension Repository (TER)
can be done with:
composer zip
This creates/replaces a file ../zip/codehighlight_x.y.z.zip
which is ready for upload to TER. x.y.z
holds
the recent version number.