Closed argiepiano closed 1 year ago
BTW, the property should be renamed langcode
to follow the pattern used in Backdrop.
And should add: these properties are used by the Rules translation module, which is being worked on currently.
Interestingly the getter callback
for the property, as well as the option list
callback already exist in Entity Plus! So, the only thing needed here is to just define the properties.
Actually the property CAN'T be renamed to langcode
because the getter callback uses the property name (language) to obtain the global language object stored under the key language
, by doing:
return isset($GLOBALS[$name]) ? $GLOBALS[$name]->langcode : NULL;
So, if we name the property langcode
, then the global language object is not found, as it is currently stored as $GLOBALS['language']
PR #145. @laryn, @hosef if you could review soon before we merge, that'd be great, so that we can fix the related stuff in Rules translation.
Makes sense and looks good to me on a readthrough. 👍
Thanks @laryn. @hosef, let me know if you want to review this one, as well as #146, which is also needed for Rules translation. Additionally I'll be submitting a PR for #67 tomorrow, which was started by @laryn some time ago.
The metadata properties for site:current_page were defined in
locale.info.inc
in D7. Those were removed fromlocale
when it was ported as part of Backdrop's core.Since
locale
is part of core andentity_plus
is not, I believe it's best to add that property metadata information to Entity Plus'system.info.inc
wrapped in anif
statement to check whetherlocale
is enabled. PR forthcoming.