Download the PHP package elao/form-translation-bundle without Composer
On this page you can find all versions of the php package elao/form-translation-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elao/form-translation-bundle
More information about elao/form-translation-bundle
Files in elao/form-translation-bundle
Package form-translation-bundle
Short Description Generate translation key for forms
License MIT
Homepage https://github.com/Elao/ElaoFormTranslationBundle
Informations about the package form-translation-bundle
ElaoFormTranslationBundle
Description:
This bundle provides a nice way of generating translation keys for form fields in a "logic" way. It is used mainly to generate automatic labels on fields but can be use to build any key.
For example, in a form RegisterType named "register" the key for its field "name" would be form.register.children.name.label.
Another more advanced example would be a field "emails" which is a collection of text inputs, it'll generate:
form.register.children.emails.labelform.register.children.emails.label_addform.register.children.emails.label_deleteform.register.children.emails.children.prototype.label
Or in yml:
Note: The keys will only be generated at runtime and won't be dumped when you use translation:update yet (we're working on it).
Installation:
This bundle supports maintained Symfony versions only.
Add ElaoFormTranslationBundle to your composer.json:
Now download the bundle by running the command:
php yml elao_form_translation: blocks:
Prefix for children nodes (string|false)
children: "children"
# Prefix for prototype nodes (string|false)
prototype: "prototype"
# Prefix at the root of the key (string|false)
root: "form"
# Separator te be used between nodes (string|false)
separator: "."
yml elao_formtranslation: blocks: root: false children: false separator: "" yml elao_form_translation: default_translation_domain: "forms" yml elao_form_translation: default_translation_domain: false yml elao_form_translation:
# Can be disabled
enabled: true
# Generate translation keys for all missing labels
auto_generate: false
# Set default translation domain on all forms
default_translation_domain: ~
# Customize available keys
keys:
form:
label: "label"
help: "help"
# Add yours ...
collection:
label_add: "label_add"
label_delete: "label_delete"
# Add yours ...
# Customize the ways keys are built
blocks:
# Prefix for prototype nodes
prototype: "prototype"
# Prefix for children nodes
children: "children"
# Prefix at the root of the key
root: "form"
# Separator te be used between nodes
separator: "."
All versions of form-translation-bundle with dependencies
symfony/framework-bundle Version ^6.4|^7.4|^8.0
symfony/form Version ^6.4|^7.4|^8.0
symfony/property-access Version ^6.4|^7.4|^8.0