Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We should assist exportable entities with supporting localization via i18n. We can generate quite some i18n-info automatically, although probably not all. Let's add a helper which at least cares about adding in all the translatable properties...
Comment | File | Size | Author |
---|---|---|---|
#18 | test.jpg | 40.29 KB | andrea.brogi |
#9 | entity_api_i18n.patch | 23.28 KB | fago |
#9 | rules_link_i18n-D7.patch | 9.59 KB | fago |
#6 | entity_api_i18n.patch | 21.37 KB | fago |
#6 | rules_link_i18n-D7.patch | 8.96 KB | fago |
Comments
Comment #1
fagook, here some WIP.
Attached patch basically works to expose properties to i18n. I'm also attaching my test-profile2 integration module to show how it can be used. Making using translated values is still an open issue though.
important fix: #1406778: impossible to expose entities to i18n string translation
Comment #2
fago*dup*
Comment #4
fagothat's the right patch...
Comment #5
fagook, I've further improved it - so far profile2 integration seems to work fine.
Changes:
entity_i18n_string()
and$entity->getTranslation($property)
.Comment #6
fagoOk, I've completed this. Thus,
* added i18n integration to the entity-test-type and tests
* integrated a "translation" link in the UI
* completed docs
* some random fixes
* also I've implemented rules-link i18n integration based on that, example patch attached.
Comment #8
klausiLooks good from a purely visual code review.
Comment #9
fagoouch, looks like the test-bot dies due to not caring about the i18n dependency of the test-case. I've modified the test case to not extend the i18n class, hope this helps.
Also, I've update the rules-link patch to correctly document method overrides (we are not overriding self::).
Comment #10
fagoComment #11
fagoAs the i18n translation set fix got committed and this works well for quite a while now, I've committed the patch from #9.
Setting to active, as it requires documentation.
Comment #12
fagoI've also committed the profile2 patch and opened #1446604: Add i18n support for rules_link.
Comment #13
fagook, added docs - see http://drupal.org/node/1021538
Comment #15
Patrick R. CreditAttribution: Patrick R. commentedProfile2 integration seems to be incomplete. In profile2_user_view (profile2.module) there is this line...
'#title' => $profile->label,
I think this should be
'#title' => $profile->defaultLabel(),
at least it's only working for me this way. Also on /user/#UID/edit/* the secondary tabs representing the Profile2 types next to ´Account´ aren't translated as well. In profile2_user_categories we have
'title' => $info->getTranslation('label'),
for this but I think this is rather useless since user_menu specifies check_plain as title callback for these items, so there is no l10n support. It is probably necessary to implement hook_menu_alter for Profile2 to override the secondary tabs items and replace title callback and title arguments.
Comment #16
mitchell CreditAttribution: mitchell commented@#15
-- Status settings for an issue
Comment #17
fraweg CreditAttribution: fraweg commentedHello,
for me zhis issue is not fixed. How to I translate "/user/#UID/edit/*" ? I can not do that.
Thanks for any Help!
Best regards
Frank
Comment #18
andrea.brogi CreditAttribution: andrea.brogi commentedHi Guys,
I don't know if this is the correct discussion to put my questio.
I have a problem with translated version of e-commerce site.
The problem occurs when I update the Enty API from RC1 to RC2 and looking inside Release Note I've seen that this post and this one http://drupal.org/node/1376126 have worked to translation. So I have put this messagge also inside the other Isuue.
One yers ago I have developd an e-commerce site using Commerce Drupal.
The products have some "Term Reference" fields connected with a "Localized Vocabulary" (Not Translated).
All the products are translated and they show the correct terms when we shitch Language.
A group of Products is connected to a "View Node" using "Product Reference" field so we can have "Variation of products" showed inside the "Node View" with some "Select List".
Using the entity API version RC1 evrything was working correctly. When switch the lanuage the terms inside the select list was correctly translated.
If I update to RC2 instead the terms inside the "Select Field" are not translated. I have checked the product and the terms inside translation page but nothing is changed, the terms are correctly translated. Also in the Node View If I show the referenced terms like link the terms are translated. Only Inside "Select Field" the terms are wrong.
Someone of the guy have make this isuue can understand was it happen and help me to solve this problem?
You can test live this sistuation here
http://www.m2r2-comunicazione.it/en/node/26
This is a clear installation with the latest version of Drupal-Commerce-EntityApi.
If I come back to the RC1 of entityApi the system work correcly.