Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php translator generate xx command: not playing nice with arrays #2544

Closed
ebeauchamps opened this issue Sep 25, 2020 · 1 comment
Closed
Assignees
Labels

Comments

@ebeauchamps
Copy link
Contributor

Bug Description

  1. in commit c0c104f Jack edited two keys in the English fieldtypes.php files

Those changes were not picked up when running today php translator generate fr
By chance, I found Jack's commit and I was able to correct the translation, but this was pure luck.

  1. each and every time I am running php translator generate fr, the translator generate a French validation.php file with empty keys though the current validation.php files already includes those translated keys. Those keys are arrays:
    'between.numeric' => '',
    'between.file' => '',
    'between.string' => '',
    'between.array' => '',
    'gt.numeric' => '',
    'gt.file' => '',
    'gt.string' => '',
    'gt.array' => '',
    'gte.numeric' => '',
    'gte.file' => '',
    'gte.string' => '',
    'gte.array' => '',
    'lt.numeric' => '',
    'lt.file' => '',
    'lt.string' => '',
    'lt.array' => '',
    'lte.numeric' => '',
    'lte.file' => '',
    'lte.string' => '',
    'lte.array' => '',
    'max.numeric' => '',
    'max.file' => '',
    'max.string' => '',
    'max.array' => '',
    'min.numeric' => '',
    'min.file' => '',
    'min.string' => '',
    'min.array' => '',
    'size.numeric' => '',
    'size.file' => '',
    'size.string' => '',
    'size.array' => '',
    'custom.attribute-name.rule-name' => '',

Current French validation.php file as it can be found in vendor/statamic/cms/resources/lang/fr/:

    'between.numeric' => 'Doit être compris entre :min et :max .',
    'between.file' => 'Doit être compris entre :min et :max kilo-octets.',
    'between.string' => 'Doit être compris entre :min et :max caractères.',
    'between.array' => 'Doit avoir entre :min et :max éléments.',
etc.

How to Reproduce

See above

Extra Detail

Environment

Statamic version: 3.0.13 Pro

PHP version: 7.4.2
Install method (choose one):
Updated 3.0.12 local install

@jasonvarga jasonvarga changed the title Problem with PHP TRANSLATOR GENERATE xx command: not playing nice with arrays php translator generate xx command: not playing nice with arrays Sep 29, 2020
@jasonvarga jasonvarga self-assigned this Sep 30, 2020
@jasonvarga
Copy link
Member

I've fixed the issue with the arrays, but knowing when existing translations have been updated using the command is a different issue which you can see here: statamic/ideas#309

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants