src/Graviton/SchemaBundle/SchemaUtils.php
public function makeTranslatable(Schema $property, $languages)
    {
        $property->setType('object');
        $property->setTranslatable(true);

        array_walk(
            $languages,
            function ($language) use ($property) {
                $schema = new Schema;
                $schema->setType('string');
                $schema->setTitle('Translated String');
                $schema->setDescription('String in ' . $language . ' locale.');
                $property->addProperty($language, $schema);
            }
        );
        $property->setRequired(['en']);
        return $property;
    }
public function makeTranslatable(Schema $property, $languages)
    {
        $property->setType('object');
        $property->setTranslatable(true);

        array_walk(
            $languages,
            function ($language) use ($property) {
                $schema = new Schema;
                $schema->setType('string');
                $schema->setTitle('Translated String');
                $schema->setDescription('String in ' . $language . ' locale.');
                $property->addProperty($language, $schema);
            }
        );
        $property->setRequired(['en']);
        return $property;
    }
public function makeTranslatable ( Schema $ property , $ languages ) { $ property -> setType ( 'object' ) ; $ property -> setTranslatable ( true ) ; array_walk ( $ languages , function ( $ language ) use ( $ property ) { $ schema = new Schema ; $ schema -> setType ( 'string' ) ; $ schema -> setTitle ( 'Translated String' ) ; $ schema -> setDescription ( 'String in ' . $ language . ' locale.' ) ; $ property -> addProperty ( $ language , $ schema ) ; } ) ; $ property -> setRequired ( [ 'en' ] ) ; return $ property ; }
turn a property into a translatable property

@param Schema   $property  simple string property
@param string[] $languages available languages

@return Schema
turn a property into a translatable property