Right now if you want to use a pane in multiple languages you'd have to recreate it. It would be great if this could be translated like a node, with the option to sync translations so you don't have to upload the same image each time.

CommentFileSizeAuthor
#60 fpp-1536944-60.patch1.08 KBstevector
#53 1536944-fieldable_panels_pane-tranlsation-followup.patch666 bytesmrfelton
#52 Entity Translation Screen.JPG54.86 KBsylus
#52 No Translation Switcher.JPG40.42 KBsylus
#52 Translate Field.JPG48.69 KBsylus
#47 interdiff.txt18.95 KBDave Reid
#47 1536944-ffp-entity-translation.patch5.02 KBDave Reid
#45 translatable-panes-1536944-45.patch15.67 KBlathan
#44 translatable-panes-1536944-40.patch15.13 KBlathan
#43 translatable-panes-1536944-43.patch14.98 KBmrfelton
#42 translatable-panes-1536944-42.patch13.49 KBmrfelton
#40 translatable-panes-1536944-40.patch15.13 KBlathan
#39 translatable-panes-1536944-39.patch15.14 KBlathan
#38 1536944.38-translatable_panes.patch13.79 KBlathan
#37 1536944.37-translatable_panes.patch13.57 KBlathan
#36 1536944.36-translatable_panes.patch13.57 KBlathan
#35 1536944.35-translatable_panes.patch13.75 KBlathan
#34 1536944.33-translatable_panes.patch13.67 KBlathan
#33 1536944.33-translatable_panes.patch13.67 KBlathan
#30 1536944.30-translatable_panes.patch7.28 KBlathan
#29 1536944.29-translatable_panes.patch7.44 KBlathan
#28 1536944.28-translatable_panes.patch5.8 KBlathan
#27 1536944.27-translatable_panes.patch5.8 KBlathan
#25 1536944.25-translatable_panes.patch9.93 KBlathan
#23 1536944.23-translatable_panes.patch9.91 KBlathan
#22 1536944.22-translatable_panes.patch9.83 KBlathan
#21 1536944.21-translatable_panes.patch9.16 KBlathan
#20 1536944.20-translatable_panes.patch9.4 KBlathan
#17 1536944.17-translatable_panes.patch9.29 KBlathan
#13 Screen Shot 2012-09-25 at 15.37.49.png36.64 KBlathan
#13 Screen Shot 2012-09-25 at 15.37.57.png93.57 KBlathan
#13 Screen Shot 2012-09-25 at 15.39.07.png61.29 KBlathan
#11 Fieldable_Panels_Pane-translatable_panes-1536944-11.patch5.83 KBsylus
#10 translatable-panes-1536944-10.patch6.29 KBhelior
#6 translatable-panes-1536944-6.patch5.59 KBsylus
#5 translatable-panes-1536944-5.patch6.05 KBhelior
#4 translatable-panes-1536944-4.patch6.05 KBhelior
#3 translatable-panes-1536944-3.patch6.05 KBhelior
#2 translatable-panes-1536944-2.patch5.16 KBhelior
#1 translatable-panes-1536944-1.patch5.17 KBhelior
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

helior’s picture

Status: Active » Needs review
FileSize
5.17 KB

The following patch provides integration with the Entity Translation module, which provides plenty of capabilities to translate a pane entity. There is also integration with the Title module, which allows the entity to be fully translatable by replacing the default title field with a Field API counterpart.

Note: This patch requires #1607028: Entity base path is too deep in order to register menu callbacks.

helior’s picture

Re-rolling patch to accommodate updates in #1607028: Entity base path is too deep

helior’s picture

Added admin link to edit translation from contextual links. Still depends on #1607028: Entity base path is too deep.

helior’s picture

Re-rolling to accommodate updates in #1607028: Entity base path is too deep.

helior’s picture

Re-rolling again to accommodate other changes in HEAD.

sylus’s picture

Awesome Work @helior!

Re-rolling again to accommodate other changes in HEAD as of commit b4ae222.

Works great! Hopefully I created the patch properly :)

cangeceiro’s picture

Status: Needs review » Needs work

This could be my lack of experience with translation, but it wasn't immediately clear where to go to translate a pane. hitting admin/structure/fieldable-panels-panes/view/PID/translate did not result in the expected page and no tab ever showed up. This also needs rerolled against the latest head.

sylus’s picture

In entity translation config screen did you enable it for fieldable panel panes? This is a required step I believe.

cangeceiro’s picture

I did not, which could have been the problem. Like i said I haven't really done much with translation so I'm not terribly familiar with whats required to setup translation.

helior’s picture

Status: Needs work » Needs review
FileSize
6.29 KB

Here are some steps to reproduce:

  1. Download and install Entity Translation.
  2. Go to admin/config/regional/entity_translation and enable "Fieldable panel pane" for translation.
  3. Go to the manage fields page for FPP, and add/edit a field...
  4. At the bottom of the field instance form will be either a checkbox or a link (depending on whether you are adding or editing a field) to enable translations for this field.

You should now see the "Translate" tab under /fieldable-panels-panes/view/[PID].

To support translating the FPP's title (after the doing the previous steps):

  1. Download and install Title.
  2. Go to the manage fields page and click on the "replace" link under the title field's operations column (it will link to something like admin/structure/fieldable-panels-panes/manage/fieldable-panels-pane/fields/replace/title)
  3. Check the box and save the form. This will run a quick batch process to set up field translation for the "new" title field.

Attached is an updated patch against HEAD.

sylus’s picture

Rolled new patch on latest dev (August 17th)

sylus’s picture

Status: Needs review » Needs work

Hmm it could be my patch though looks good, but translation is busted on fieldable panels pane dev (Aug 17th) using:

projects[fieldable_panels_panes][version] = 1.2
projects[fieldable_panels_panes][subdir] = contrib
projects[fieldable_panels_panes][patch][1536944] = http://drupal.org/files/Fieldable_Panels_Pane-translatable_panes-1536944-11.patch
lathan’s picture

Here is some feedback on this patch

patched with - translatable-panes-1536944-10.patch

In screen shot "Screen Shot 2012-09-25 at 15.37.49.png" i click add translation for an alternative language we have installed. I then change the language on the field that we have made translatable via this patch the content field in this case as seen in screen shot "Screen Shot 2012-09-25 at 15.39.07.png" you can also see the revision log for the different edits i have done "Screen Shot 2012-09-25 at 15.37.57.png" but in all cases the translated instance is not linked to the language in the translation tab and navigating to the path (we have language detection via url prefix) for the "UK" language set in our case give us the default instance of this panel. The content of the original panel is altered to what should be saved in the alternate translated instance.

sylus’s picture

Thanks @jucallme that is exactly the same problem we are having. Thanks for taking the time to write a detailed issue :)

sylus’s picture

Was wondering if anyone has made progress on this :) Been trying to learn entity translation to fix this myself but still falling short currently ^_^

helior’s picture

It's been a while since I looked at this patch, but I think maybe the only bug here is that we're supposed to prevent the user from changing the language after it has been created. Can anyone confirm if Entity Translation will allow the language to be changed on existing nodes?

lathan’s picture

Status: Needs work » Needs review
FileSize
9.29 KB

Something that actually works.

mgifford’s picture

Patch applies to the git repo but there are some minor warnings: 4 lines add whitespace errors.

EDIT: Latest patch has 5 lines add whitespace errors but still applies.

lathan’s picture

Fix white space (this patch is against latest dev branch) and select bug introduced in #19

lathan’s picture

sorry another one left debug in now removed.

lathan’s picture

another selector bug issue resolved.

lathan’s picture

remove debug, sorry for the spam.

mgifford’s picture

Applied the latest #23 and it applied nicely. Just 1 whitespace errors. Not a big deal.

lathan’s picture

Fix issue with access check when viewing the rendered entity (call to entity_translation_tab_access).

sylus’s picture

Hey @jucallme thanks for moving this issue along.

The patch does make some fields become translatable. However I am still having problems with file / image upload.

Have you tried using entity translation + fpp for these types of fields?

lathan’s picture

Finally figured out one need to use the translation API.
This patch should resolve all issues.

lathan’s picture

oops missed a file

lathan’s picture

finally it added new file to the patch.

lathan’s picture

remove debug.

sylus’s picture

Based on initial evaluation and use. This seems to work! :) Awesome work!

mrfelton’s picture

Yes, only issue at the moment seems to be with translating the link path. We can translate the title text, but not the path that it links to.

lathan’s picture

Now we also make the path a field instance.

lathan’s picture

Left the drop field commented in previous patch, fix.

lathan’s picture

Small bug on determining lang code fixed.

lathan’s picture

Bug in the edit form and validate function fixed.

lathan’s picture

typo fix. dose /does

lathan’s picture

fix display issue in rendering path link.

lathan’s picture

Fix validation check on path was previously not checking the make title link checkbox and allow external links as well.

lathan’s picture

Fix issue with drush make in the install update fieldable_panels_panes_update_7108 change drupal_flush_all_caches() -> field_info_cache_clear()

sylus’s picture

Though I would mention that entity translation beta 2 is out, I'll try the latest patch here with that version later tonight :)

mrfelton’s picture

entity_translation_tab_access() should take the entity type as the first arg, and not the bundle name. Otherwise we get WSOD with Fatal error: Class name must be a valid object or a string in /var/aegir/platforms/example/profiles/concern/modules/contrib/entity_translation/entity_translation.module on line 1687

Patch updates to pass in 'fieldable_panels_pane' as the entity type.

mrfelton’s picture

Oops, was missing the added file..

lathan’s picture

Fix issue in validating that path, need to first get the lang code.

lathan’s picture

Wrong patch above,
Fix issue in validating that path, need to first get the lang code.

Dave Reid’s picture

Would it maybe be possible to separate out the actual translation ability vs having path as a field? We just need fieldable panes to translate their titles, but the link stays the same and it seems like it may not help this patch get reviewed/committed since it would be an API change for pane path.

Dave Reid’s picture

New version with just support for translation because that's the only thing I could test successfully.

Differences between this and #45:

  • Removed Title module support because I couldn't properly test it and have concerns that it may not work exactly right.
  • Removed converting path to a field. Way harder to review and test this patch with this change. Should be a separate issue.
  • Removed the hunk of code that appears to be a uuid-related fix. Seems like a separate issue.
  • Fixed the 'language' column should be varchar(12) not varchar(32) to match the {languages} table.
Dave Reid’s picture

Dave Reid’s picture

Status: Needs review » Fixed
sylus’s picture

Not sure if should file a new issue but translations are no longer working for me with latest commit to FPP 1.3.

I have tested #45 and that still works.

It looks like some of the custom language code was not added?

I would like to reopen this issue but not sure the correct way to go for this?

Dave Reid’s picture

I just tested the 1.3 release and I was able to translate normally. Did you run update.php?

sylus’s picture

This is a fresh installation of our distribution. Really quite perplexed how this would work for you and not myself. Especially given that the earlier patch works.

Modules Used:

-projects[fieldable_panels_panes][version] = 1.2
+projects[fieldable_panels_panes][version] = 1.3
projects[fieldable_panels_panes][subdir] = contrib
-projects[fieldable_panels_panes][patch][1536944] = http://drupal.org/files/Fieldable_Panels_Pane-translatable_panes-1536944...
-projects[fieldable_panels_panes][patch][1818132] = http://drupal.org/files/1818132-prevent-uuids.patch

projects[entity_translation][version] = 1.x-dev
projects[entity_translation][type] = module
projects[entity_translation][subdir] = contrib
projects[entity_translation][download][type] = git
projects[entity_translation][download][revision] = 533c473
projects[entity_translation][download][branch] = 7.x-1.x

projects[title][version] = 1.x-dev
projects[title][type] = module
projects[title][subdir] = contrib
projects[title][download][type] = git
projects[title][download][revision] = ef3d5a14
projects[title][download][branch] = 7.x-1.x

Steps Followed:

1) Confirmed FPP is enabled in Entity Translation (tried also unchecking language selector but is for different area):

Entity Trans

2) Made sure Field is Translated for our Custom FPP Type:

Entity Trans 2

3) No language switcher in Navigation (Between Revisions and View Access where it normally appears):

Entity Trans 3

As mentioned reverted to earlier patch and everything works again.

mrfelton’s picture

Status: Fixed » Needs review
FileSize
666 bytes

Same problem here. The problem seems to be that the language of the entity is not saved properly. Attached patch resolves and gets the translation support going again properly.

sylus’s picture

Woot thanks @mrfelton solves my problem!

jherencia’s picture

Status: Needs review » Reviewed & tested by the community

Same problem here and fixed with the patch.

Thank you @mrfelton.

mgifford’s picture

Any thoughts on when it might get into the git repo & more importantly a release? Great to see that there was just a release a month ago, but would be nice if there was an update for the dev version.

jherencia’s picture

Priority: Normal » Major

Translation is broken, let's try to make this more visible.

Dave Reid’s picture

Status: Reviewed & tested by the community » Fixed

I'm not sure why I didn't need this change when I was testing things locally, but I committed it to 7.x-1.x: http://drupalcode.org/project/fieldable_panels_panes.git/commit/6f34e0b

jherencia’s picture

Thank you @Dave.

stevector’s picture

Status: Fixed » Needs review
FileSize
1.08 KB

One more patch. The last one throws an error if entity_translation is not being used.

Can I get a test from someone who is using entity_translation?

Dave Reid’s picture

Actually I think the real issue here is that we don't expose $form['language'] in the edit form of the pane entity like other forms do. Since $entity->language gets initialized to LANGUAGE_NONE, we can add it to ensure that it will be present in $form_state['values'] always.

Dave Reid’s picture

Status: Needs review » Fixed

Ok I fully tested adding $form['language'] and it works to avoid the error that stevector noticed and that entity translation functionalty works as expected on a fresh install now.

http://drupalcode.org/project/fieldable_panels_panes.git/commit/8cb2134

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.