Hi,
I am trying to add i18n support for Entityforms. I have created a branch to work on this.

I have it working for most properties of Entityform Types(similiar to Profile2 types) but it doesn't work for Text Formatted properties. I have looked at the examples and how Profile2 is doing it but it is not translating formatted properties. The text fields for these properties are always disabled. Does EntityDefaultI18nStringController support this?

Looking at EntityDefaultI18nStringController->translatableProperties() it doesn't seem to take into account formats.

if (!empty($info['translatable']) && !empty($info['i18n string'])) {
        $list[$name] = array(
          'title' => $info['label'],
        );
      }

I have tried modifying it to

if (!empty($info['translatable']) && !empty($info['i18n string'])) {
        $list[$name] = array(
          'title' => $info['label'],
        );
        if ($info['type'] == 'text_formatted') {
          $list[$name]['format'] = 'format';
        }
      }

But it doesn't work. It was a try base on how i18n block defines it's properties:

     'properties' => array(
        'title' => array(
          'title' => t('Title'),
          'empty' => '<none>',
        ),
        'body' => array(
          'title' => t('Body'),
          'format' => 'format',
        ),
      ),

Has anybody done anything like before or know of module I can look at?
Will I have to extend EntityDefaultI18nStringController to get this to work?

Thanks for any help and thanks for putting i18n support in the Entity API so I don't have to redo it all!

Files: 
CommentFileSizeAuthor
#1 entity-1973024-Add-format-support.patch749 bytesalmul0
PASSED: [[SimpleTest]]: [MySQL] 374 pass(es).
[ View ]

Comments

almul0’s picture

StatusFileSize
new749 bytes
PASSED: [[SimpleTest]]: [MySQL] 374 pass(es).
[ View ]

Hi, I am working on that branch to support fully translatable entity form properties. It involves several modules, here is a patch to support formatted text porperties on entities.

tedbow’s picture

Status:Active» Needs review

Changing to needs review