{"id":14984086,"url":"https://github.com/sadikoff/i18n-form-bundle","last_synced_at":"2025-04-10T19:43:45.065Z","repository":{"id":27599112,"uuid":"114292466","full_name":"sadikoff/i18n-form-bundle","owner":"sadikoff","description":"Translate your doctrine objects easily with some helps","archived":false,"fork":false,"pushed_at":"2023-12-12T10:20:25.000Z","size":302,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T17:21:32.372Z","etag":null,"topics":["internationalization","localization","symfony-bundle","symfony-forms","symfony4"],"latest_commit_sha":null,"homepage":"https://koff.pro/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sadikoff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-14T20:15:53.000Z","updated_at":"2023-07-19T08:37:49.000Z","dependencies_parsed_at":"2024-09-24T15:27:37.743Z","dependency_job_id":"7bc9f309-17bc-4c5c-8275-2faadb91a60d","html_url":"https://github.com/sadikoff/i18n-form-bundle","commit_stats":{"total_commits":223,"total_committers":39,"mean_commits":5.717948717948718,"dds":0.6502242152466368,"last_synced_commit":"a9aecdf95875ae9efd5e8d7fc1e7c6517cffdd37"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadikoff%2Fi18n-form-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadikoff%2Fi18n-form-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadikoff%2Fi18n-form-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadikoff%2Fi18n-form-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sadikoff","download_url":"https://codeload.github.com/sadikoff/i18n-form-bundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247792856,"owners_count":20996890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["internationalization","localization","symfony-bundle","symfony-forms","symfony4"],"created_at":"2024-09-24T14:08:25.448Z","updated_at":"2025-04-10T19:43:45.040Z","avatar_url":"https://github.com/sadikoff.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"koff/i18n-form-bundle\n=====================\n\n[![Build Status](https://travis-ci.org/sadikoff/i18n-form-bundle.svg?branch=master)](https://travis-ci.org/sadikoff/i18n-form-bundle)\n[![Latest Stable Version](http://poser.pugx.org/koff/i18n-form-bundle/v)](https://packagist.org/packages/koff/i18n-form-bundle)\n[![Total Downloads](http://poser.pugx.org/koff/i18n-form-bundle/downloads)](https://packagist.org/packages/koff/i18n-form-bundle)\n[![Latest Unstable Version](http://poser.pugx.org/koff/i18n-form-bundle/v/unstable)](https://packagist.org/packages/koff/i18n-form-bundle)\n[![License](http://poser.pugx.org/koff/i18n-form-bundle/license)](https://packagist.org/packages/koff/i18n-form-bundle)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/sadikoff/i18n-form-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/sadikoff/i18n-form-bundle/?branch=master)\n[![StyleCI](https://styleci.io/repos/114292466/shield?branch=master)](https://styleci.io/repos/114292466)\n[![Coverage Status](https://coveralls.io/repos/github/sadikoff/i18n-form-bundle/badge.svg?branch=master)](https://coveralls.io/github/sadikoff/i18n-form-bundle?branch=master)\n\n\u003eThis bundle is fork of [a2lix/TranslationFormBundle](https://github.com/a2lix/TranslationFormBundle), reorganized and optimized to work with symfony flex \n\nRequirements\n------------\n* Symfony flex with Symfony 3.4|4.0\n* i18n Doctrine strategy of your choice\n  * [KnpLabs/DoctrineBehaviors](https://github.com/KnpLabs/DoctrineBehaviors#translatable) with `knplabs/doctrine-behaviors`\n  * [Atlantic18/DoctrineExtensions](https://github.com/Atlantic18/DoctrineExtensions/blob/v2.4.x/doc/translatable.md) with `stof/doctrine-extensions-bundle`\n\nInstallation\n------------\n\n    composer req koff/i18n-form-bundle\n\nConfiguration\n-------------\nFull configuration example\n```yaml\n# config/packages/i18n_form.yaml\ni18n_form:\n    locales: [en, fr, es, de]\n    required_locales: [fr]\n    excluded_fields: ['id', 'locale', 'translatable']\n    form_theme: 'bootstrap_3' # you can use 'bootstrap_3' or 'bootstrap_4' form template\n```\n\nUsage\n-----\n\nBasic example\n\n```php\nuse Koff\\Bundle\\I18nFormBundle\\Form\\Type\\TranslationsType;\n//...\n$builder-\u003eadd('translations', TranslationsType::class);\n```\n\nAdvanced example\n\n```php\nuse Koff\\Bundle\\I18nFormBundle\\Form\\Type\\TranslationsType;\n//...\n$builder-\u003eadd('translations', TranslationsType::class, [\n    'locales' =\u003e ['en', 'fr', 'es', 'de'],          // [1]\n    'default_locale' =\u003e ['en']                      // [1]\n    'required_locales' =\u003e ['fr'],                   // [1]\n    'fields' =\u003e [                                   // [2]\n        'description' =\u003e [                          // [3.a]\n            'field_type' =\u003e 'textarea',             // [4]\n            'label' =\u003e 'descript.',                 // [4]\n            'locale_options' =\u003e [                   // [3.b]\n                'es' =\u003e ['label' =\u003e 'descripción']  // [4]\n                'fr' =\u003e ['display' =\u003e false]        // [4]\n            ]\n        ]\n    ],\n    'excluded_fields' =\u003e ['details']                // [2]\n]);\n```\n\n* [1] Optionnal. If set, override the default value from config.yml\n* [2] Optionnal. If set, override the default value from config.yml\n* [3] Optionnal. If set, override the auto configuration of fields\n* [3.a] Optionnal. - For a field, applied to all locales\n* [3.b] Optionnal. - For a specific locale of a field\n* [4] Optionnal. Common options of symfony forms (max_length, required, trim, read_only, constraints, ...), which was added 'field_type' and 'display'\n\n\nAdditional\n----------\n\n#### TranslationsFormsType\nA different approach for entities which don't share fields untranslated. No strategy used here, only a locale field in your entity.\n\n```php\nuse Koff\\Bundle\\I18nFormBundle\\Form\\Type\\TranslationsFormsType;\n//...\n$builder-\u003eadd('translations', TranslationsFormsType::class, [\n    'locales' =\u003e ['en', 'fr', 'es', 'de'],   // [1]\n    'default_locale' =\u003e ['en']               // [1]\n    'required_locales' =\u003e ['fr'],            // [1]\n    'form_type' =\u003e ProductMediaType::class,  // [2 - Mandatory]\n    'form_options' =\u003e [                      // [2bis]\n        'context' =\u003e 'pdf'\n    ]\n]);\n```\n\n* [1] Optionnal. If set, override the default value from config.yml\n* [2 - Mandatory]. A real form type that you have to do\n* [2bis] Optionnal. - An array of options that you can set to your form\n\n#### TranslatedEntityType\nModified version of the native 'entity' symfony2 form type to translate the label in the current locale by reading translations\n\n```php\nuse Koff\\Bundle\\I18nFormBundle\\Form\\Type\\TranslatedEntityType;\n//...\n$builder-\u003eadd('medias', TranslatedEntityType::class, [\n    'class' =\u003e 'App\\Entity\\Media',      // [1 - Mandatory]\n    'translation_property' =\u003e 'text',   // [2 - Mandatory]\n    'multiple' =\u003e true,                 // [3]\n]);\n```\n    \n* [1] Path of the translatable class\n* [2] Property/Method of the translatable class that will be display\n* [3] Common options of the 'entity' symfony2 form type (multiple, ...)\n\nCredits\n=======\nAll credits goes to [David ALLIX](https://github.com/a2lix) and his [a2lix/TranslationFormBundle](https://github.com/a2lix/TranslationFormBundle)\n\nLicense\n=======\nThis package is available under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadikoff%2Fi18n-form-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsadikoff%2Fi18n-form-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadikoff%2Fi18n-form-bundle/lists"}