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

Malformed keys in translation files #10797

Closed
emteknetnz opened this issue Jun 5, 2023 · 8 comments
Closed

Malformed keys in translation files #10797

emteknetnz opened this issue Jun 5, 2023 · 8 comments

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Jun 5, 2023

During the latest translation run, some invalid keys were added where the key was merged with the namespace e.g.

nl.yml

  DataObject:
    php:
      SilverStripe\ORM\DataObjectGENERALSEARCH: 'Alles doorzoeken'

6b49b6c#commitcomment-116173471

To replicate, do a fresh install of 5.0 and add the following to app/_config.php

php

<?php

use SilverStripe\i18n\i18n;

i18n::set_locale('nl_NL');

The parent issue for all the translations run at this time is silverstripe/.github#50

Core issues is that there were some invalid keys added to source en.yml files, probably by i18nTextCollector.

I've done a search on sink searching for php. in en.yml files in a 4.13 sink install:

ACs

  1. Whatever caused the en.yml key pollution is identified and fixed (probably i18nTextCollector)
  2. Translated keys + values are deleted from translation yml files in 4.13
  3. TextCollectorTask is run on relevant 4.13 branches so that source en.yml keys are updated to the new and correct key
  4. PR's are merged up to 4, 5.0 and 5
  5. Merge the 2nd PR for realme
  6. 2nd realme PR is merged up from 4.4 to 4 to 5.0 to 5
  7. TextCollectorTask is run on relevant modules is completed
  8. Translations are re-added to transifex using the new keys
  9. tx pull is run for relevant modules in 4.13
  10. 4.13 branches are merged-up to 4, 5.0 and 5
  11. Patch releases are released for 4.13 and 5.0

New issues created

PRs

Second lot of PRs (step 9)

JS Translations

@emteknetnz
Copy link
Member Author

I've had a look through the other translations done at the same time, https://github.com/silverstripe/silverstripe-realme/pull/103/files also looks to have the same issue

@emteknetnz emteknetnz changed the title Translation warning Malformed keys in translation files Jun 5, 2023
@emteknetnz emteknetnz assigned emteknetnz and unassigned emteknetnz Jun 5, 2023
@michalkleiner
Copy link
Contributor

michalkleiner commented Jun 8, 2023

PR #10805

@emteknetnz
Copy link
Member Author

emteknetnz commented Jun 9, 2023

Once PR's are merged please reassign back to me so that I can continue at step number 4

@michalkleiner
Copy link
Contributor

@emteknetnz PRs reviewed and merged

@emteknetnz
Copy link
Member Author

emteknetnz commented Jun 12, 2023

There was another PR for realme that I just created where I initially missed a translation - this is step number 5. When this has been merged please reassign back to me and I'll continue at step number 6

@emteknetnz
Copy link
Member Author

Have checked transifex - it automatically re-added the deleted translations after re-pushing the new keys as part of silverstripe/.github#57

Presumably it did this because we had a setting enabled in transifex to automatically add translations where they was a previous translations for a different source key where the source value was the same

@emteknetnz emteknetnz removed their assignment Jun 14, 2023
@GuySartorelli GuySartorelli self-assigned this Jun 14, 2023
@GuySartorelli
Copy link
Member

PRs merged. Assigning back to @emteknetnz for next steps

@emteknetnz
Copy link
Member Author

Have patch released all the things

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

No branches or pull requests

3 participants