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

MNT Use FQCN for PHP translations #164

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

emteknetnz
Copy link
Member

Issue #140

JS short classname namespace remains as it's the standard used in other modules e.g. admin

@sabina-talipova
Copy link
Contributor

Small question, should we also update en.yml file? Or will it have been updated automatically?

@emteknetnz
Copy link
Member Author

Good point. I've just run the text collector task on linkfield and committed the results

UPDATE_LINK: 'Update link'
VERSIONED_STATUS_MISMATCH: 'Linkable and LinkField do not have matching Versioned applications. Make sure that both are either un-Versioned or Versioned'
SilverStripe\LinkField\Form\Traits\AllowedLinkClassesTrait:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change references to these in the trait from __CLASS__ to be the FCQN of the trait hardcoded, because:

https://www.php.net/manual/en/language.constants.magic.php

When used in a trait method, CLASS is the name of the class the trait is used in.

In other words the call to _t() will pass in the name of the class (not the trait) - but here the key is the trait (not the class)

Copy link
Member Author

@emteknetnz emteknetnz Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good spot :-)

Updated to use __TRAIT__ (have confirmed it works as expected)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OH, nice! I should have looked at that list I linked to a little longer, I didn't notice that option.

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GuySartorelli GuySartorelli merged commit bff98f4 into silverstripe:4 Jan 11, 2024
10 checks passed
@GuySartorelli GuySartorelli deleted the pulls/4/namespace branch January 11, 2024 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants