All notable changes of releases are documented in this file using the Keep a CHANGELOG principles.
- Add new feature to register custom commands if you write extensions for PHPUnuhi (thx @flkasper)
- Add new resx storage format to support Windows applications.
- Add new strings storage format to support Mac applications.
- Add new Docker Image for PHPUnuhi to run it in a container without installing in your project
- Add new version specific XSD files in the schema folder for upcoming releases
- Add new services command to see all available default and custom services
- Include new error hints for missing and empty keys, particularly when the base language may also lack the same translation. In such cases, this could be an expected behavior.
- Add base locale indicator in terminal output of errors (next to the locale name).
- Changed Interface of storage formats. A new function saveTranslation(Translation $translation, Locale $locale) is now required that allows to save a single translation in a specific locale.
- The translate command will now use the new single-translation save function of storage formats. This means your translations will be updated directly during a long running translation process. Also if that fails, the processed translations will still be saved.
- Fixed problem where directories for reports couldn't be created if multiple subdirectories were missing.
- Add new SpellCheckers with support for Aspell and OpenAI. This allows to check misspelled words and automatically fix them.
- Add new Shopware 6 Storage option to support config XML files of Shopware plugins and apps. You can now validate config.xml, manifest.xml and more.
- Add new usage summary when using Open AI. It shows the number of requests as well as the estimated costs. (approximate values, not guaranteed).
- Add new similarity validation for translations. This allows to validate if translation keys are similar to each other.
- Add new command list:translation-keys. The old list:translations command will now show all translations and the new one will show the keys only.
- Allow DeepL / translator configuration with env variables (thx @Ocarthon)
- Enable DeepL tag splitting on HTML input to also translate HTML fragments (thx @Ocarthon)
- Support referencing Shopware snippets by their snippet set name (thx @Ocarthon)
- Improve performance with lots of snippets and sets by adding lazy loading of snippets (thx @Ocarthon)
- Massive performance improvement by using indexed array for translations and reduce amount of loops (thx @Ocarthon)
- HTML Exports are now saved into separate files for each translation-set (thx @Ocarthon)
- Load dotenv files from current working directory (thx @Ocarthon)
- Use mb collation for database collection (MySQL utf8 is not actually utf8) (thx @Ocarthon)
- Insert shopware translation, if no corresponding row exists (thx @Ocarthon)
- Check all locales to determine the translation keys. Sometimes this did not happen and therefore not all keys have been detected (thx @Ocarthon)
- Fix problem with translate command and force flag (thx @Ocarthon)
- Fix problem where the error CLI output also showed successful test results and not just errors.
- Fix problem with googleweb translator where a "." was not correctly kept after translation into a German word.
- Fix problem where the JSON storage format cleared all translations when a JSON was not valid and any kind of write-command was used like fix-structure.
- Added new option to specify the base locale within a Translation-Set. This will be used for different features where it's necessary to know the base language.
- Translation services will now use the new base locale as preferred source language for translations, if defined.
- Fixed binary detection to also support "Umlaute". These were accidentally detected as binary strings, but they are not (thx @mjosef89).
- Fix bug where the coverage of a missing locale was accidentally 100%
- Fix bug where it was not possible to only use import-config files without a Translation-Set inside the main configuration file. This is now possible.
- Add new json exchange format. This allows to import and export translations in JSON format.
- Upgrade OpenAI integration to allow the use of the latest gpt-4.0 models.
- Add new option to provide a custom model for OpenAI translations that you want to use.
- removed deprecated utf8_decode function. mb_convert_encoding is now being used.
- Fixed exception with isBinary method in Shopware 6 storage format when NULL was being passed on from the database entry.
- Add new bootstrap loading option to make it easier to load register custom storages and more. Load all your vendors, and register whatever you need in that file.
- Add new placeholder %locale_un% for XML configuration to change
-
to_
underscore. (fr-CH to fr_CH) (thx @TumTum)
- Fixed target locale feature of the DeepL integration. DeepL actually only needs the first part of a given locale. (thx @TumTum)
- Add new option to ignore some keys from case style validation. Sometimes you are bound to the platform you are using for some keys.
- Add new table layout for all errors on CLI. This makes it easier to read and understand the errors.
- Validators will now show a new table layout for all errors. This makes it easier to read and understand the errors.
- Positive test results from mess validations where missing in reports.
- Case Style validation always showed up in reports even though not configured.
- Add breaking changes for duplicateContent rule. This rule must now be configured per locale. Please see README for more. (idea by @matthiashamacher)
- Add new MJML scanner that allows to scan MJML files for translations. (idea by @wannevancamp)
- Add new validate:structure command to only validate against the structure.
- Add new rule emptyContent that allows you to provide a list of keys that can stay empty, either in all or specific languages. (idea by @wannevancamp)
- The duplicateContent rule does now ignore empty values. Empty values are not considered anymore.
- Fixed problem with relative locale filenames in combination with the basePath attribute in the
<locales>
node. This led to wrong absolute filenames and therefore invalid filenames when loading. - Add missing none case style to XSD file.
- Add new scanner bundles that allow to scan files for occurrences of translations. With this you can figure out what translations are not used in your templates.
- Add new validate:mess command to find keys without any translation. This means that these translations might not be used at all and can be removed.
- Add new fix:mess command to remove keys without any translation. This means that these translations might not be used at all and can be removed.
- Add new configurations for a minimum coverage. These can be set for a TranslationSet, or all sets or across all locales. (see README for more).
- Add new none CaseStyle validator. This helps to explicitly disable case style validation on a specific level while other levels are still validated against configured styles.
- It's now possible to use the %locale% placeholder also in the basePath attribute of the locales node in the XML configuration.
- Due to the new mess command the old validate function is now deprecated and should be replaced with the new * validate:all* command.
- Updated to OpenAI model gpt-3.5-turbo-instruct because the old model gpt-3.5-turbo will be shut down.
- The validation of a configuration does now throw an error if no Translation-Sets are defined.
- Fixed bug where the DuplicateContentRule validation didn't work for single-hierarchy storages like INI, ...
- If an empty config value was provided, it did not correctly use the default phpunuhi.xml file.
- Removed fake translator service. This was accidentally existed inside the code and factory, but was only meant for unit tests.
- Added new attribute basePath in
<locales>
tag. This allows you to use the placeholder %base_path% in filenames of your locales. - Added option to import additional configuration files into the root configuration file using the
<import>
tag. This allows to have decentralized configuration files that can be imported into the main configuration file.
- Fix broken indent settings for JSON and YAML storages (thx @matthiashamacher)
- Add storage format option eol-last to all file based formats. This will automatically add a new line at the end of the file. (thx @JoshuaBehrens)
- Add new line number data to errors and reports of file based storage formats. (thx @matthiashamacher)
- Fix broken sort attribute detection in storage format. Sometimes a FALSE got recognized as TRUE.
- Added new JSON reporter that creates a JSON file with all validation errors.
- Add option to register *custom translator services by using the TranslatorFactory register command.
- Add option to register *custom exchange formats by using the ExchangeFactory register command.
- Translator Services are now in charge of handling protection markers, because for some services the automatic encryption of markers would lead to problems.
- Fixed problem when using OpenAI to translate values in combination with protection markers. This should now work.
- Add option to register *custom storages by using the StorageFactory register command.
- Add first support for PO files. This covers the msgid and msgstr values.
- Add new word count statistic to the status command.
- Add better error output on OpenAI translation errors, like "Quota exceeded" and more.
- Add new migration command, to migrate from Storage A to Storage B.
- Improved OpenAI creativity by using a new temperature value. This allows to control the creativity of the AI.
- Improved *StorageInterface definition for more future proven implementations.
- Fixed problem with [[punt]] placeholder when using googleweb for translations. These placeholders are now correctly converted into "."
- Add new placeholders %locale%, %locale_lc% and %locale_uc% in file name paths. This allows to reuse the name of the locale in multiple spots within the path.
- Added new protect node in sets. This helps to avoid that static placeholder strings like e.g. %firstname%, ... or even static terms get accidentally translated by translation services. (thx @hhoechtl for this idea)
- Add brand new YAML storage format (thx @matthiashamacher)
- Add new argument source=xxx to translate command. This defines what locale should be used as base language for translations.
- Add new option --empty to export command. This only exports translation entries that are not yet 100% translated.
- Improved error outputs when loading configuration files without existing translation-sets. There will now be a better error message for this.
- Add special keyword dev to composer to show this is a dev-tool and ask if --dev should be used to install it. (thx @xabbuh)
- Fix bug where duplicateContent rule was automatically validated if an empty tag was existing without a duplicateContent rule.
- Fix broken HTML import due to wrong GroupId recognition
- Add new duplicateContent rule to avoid the same translation values within a single locale.
- Refactoring RuleValidators by moving them into a separate folder and scope
- Add new number case-style validator.
- Add new keyLength rule. Validate a maximum length of your keys.
- Add new disallowedTexts* rule. Provide a list of texts that must not appear in any of your translations.
- Fix problem with locale filenames that have whitespaces before or after the filename. Trim() has been added ;)
- Add new rules to Translation-Sets. The first rule is nestingDepth that allows you to validate against a maximum number of levels within a nested storage.
- Fixed problem
/usr/bin/php: bad interpreter: No such file or directory
when running on a MAC.
- The fix:structure command is now also called if no translations where created. This helps to re-write files and fix indention, sortings and more.
- Add new level for case-style validations. This helps to set specific styles on some levels within a multi-hierarchy translation format, such as JSON or PHP.
- Switched from doctrine/dbal to plain PDO to allow a wider range of integrations without a dependency to a specific dbal version.
- Fixed wrong header output of version number in CLI commands
- Add new case-styles for translations. This allows you to validate against translation keys. Select from a wide range of styles like CamelCase, PascalCase, KebabCase and more.
- Add new junit reporter for the validation command. This creates a JUnit XML file that can be used in upcoming processes.
- Improved output of the validation command. Errors are now shown in a more compact and meaningful way.
- The translate command now shows a warning if auto-translation is not possible because no existing translation has been found as base-value.
- Fixed wrong "created" count on fix:structure. It showed 0 created if the last translation-set didn't get any new translations.
- Add support for database snippets in Shopware 6 storage using the entity name snippet.
- The Shopware 6 storage format does now support "fix:structure" for snippet entities. Missing snippets will now be automatically generated with empty values.
- Add warning output that the Shopware 6 storage format currently doesn't allow to insert new entity translation rows.
- Fixed problems with broken "Umlaute" in Shopware 6 entities storage
- Fix problem with wrong translation coverage. A set with 0/0 was displayed as 0% coverage, but it's actually 100%.
- Fix problem with "fix:structure" when creating new snippets for translations-sets with groups. It accidentally used the full ID instead of the correct key name for the "key" identifier.
- Fix crash when parsing invalid json files.
- Add new list:translations command to see all IDs of Translation-Sets
- Add new Filters with allow and exclude lists. This also supports wildards with '*'
- Add new groups of translations. This is required for a 3rd dimension. E.g. translations of products where every product has multiple rows with properties and different languages (columns).
- Add option to inject PHP server variables that can be used in different areas.
- Add Dbal/Connection to be used in MySQL driven storage formats.
- Add new Shopware 6 Storage format with full support of entities.
- Changed the technical usage of the translation key to an ID. The ID is the unique identifier within a locale, and the key the plain name of the translation which can exist multiple times in a locale.
- Removed nodes in locale. Please use instead.
- is now required as wrapper for locales. This helps to make the configuration cleaner.
- Storage formats do now have to be inside a <format> tag instead of configuring it a attribute in a Translation-Set. Also the format is now a custom XML node to allow a better XSD experience.
- DeepL does not support formality options for all languages. This has been fixed by only applying the option for allowed languages.
- Add new
config.xsd
for configuration file to use autocompletion in IDEs and editors. Use either from the composer dependencyvendor/boxblinkracer/phpunuhi/config.xsd
or onlinehttps://raw.githubusercontent.com/boxblinkracer/phpunuhi/main/config.xsd
- Add new "PHP" Storage for array based translations
- Add coverage result of all sets (total) to status command.
- OpenAI Translator and other translators now throw exceptions if no API key was set
- Rename command "fix" to "fix:structure"
- Update TranslatorInterface for a better dynamic registration approach. Also options can now be dynamically registered for different CLI commands.
- Import and Export interfaces for Exchange formats are now combined as ExchangeFormat. The interface is now also designed to allow dynamic CLI commands and dynamic registration + lookup.
- Include referenced translation file from configuration in error message when translation file is not found
- Just PHPStan fixes
- Initial version