laminas / laminas-i18n-resources

Provides validator and captcha translations for laminas-i18n's Translator
https://docs.laminas.dev/laminas-i18n-resources/
BSD 3-Clause "New" or "Revised" License
9 stars 9 forks source link

Doc: favor Translator::factory config over DelegatorFactory #10

Open Slamdunk opened 4 years ago

Slamdunk commented 4 years ago

Hi, the only doc available suggests creating a DelegatorFactory to inject this very resources: https://docs.laminas.dev/laminas-i18n-resources/usage/#automating-resource-injection

But it is 99% likely that, in that context, the user is using the entire ServiceManager capability, and as such the Translator::factory configs can be used as well: https://docs.laminas.dev/laminas-i18n/translator/factory/#setting-translation-file-patterns

$config = [
    'translator' => [
        'translation_file_patterns' => [
            [
                'type'     => 'phpArray',
                'base_dir' => \Laminas\I18n\Translator\Resources::getBasePath(),
                'pattern'  => \Laminas\I18n\Translator\Resources::getPatternForValidator(),
            ],
        ],
    ],
];
froschdesign commented 4 years ago

@Slamdunk Thanks for report this problem. The documentation is currently being revised to prevent the splitting of information. At the moment some informations for the usage can be found in documentation of this component and some in laminas-validator. In laminas-captcha the topic about translation is missing.