symfony2admingenerator/AdmingeneratorGeneratorBundle — pull request #230 by loostro (2012-09-10 16:11:32+00:00)
Title: Allow translation parameters in generator.yml

## Allow translation parameters in generator.yml

Solves issue #210.

## Supported formats:

### Backwards compability format:

example: `You're editing {{ Book.title }} written by {{ Book.author.name }}!`

is converted to: `You're editing %Book.title% written by %Book.author.name%!`

with translation parameters:

%Book.title% -> Book.title
%Book.author.name% -> Book.author.name

### Feature - key/value format:

example: `You're editing %book% written by %author%!|{ %book%: Book.title, %author%: Book.author.name }|`
is converted to: `You're editing %book% written by %author%!`

example: `book.edit.title|{ %book%: Book.title, %author%: Book.author.name }|`
is converted to: `book.edit.title`

both cases with trasnlation parameters:

%book% -> Book.title
%author% -> Book.author.name

### Feature - abbreviated syntax pattern:

example: `You're editing %Book.title% written by %Book.author.name%!|{ Book.title, Book.author.name }|`
is converted to: `You're editing %Book.title% written by %Book.author.name%!`

example: `book.edit.title|{ Book.title, Book.author.name }|`
is converted to: `book.edit.title`

both cases with trasnlation parameters:

%Book.title% -> Book.title
%Book.author.name% -> Book.author.name

## Important notes

1. Parameter bag starts with `|{ ` and ends with ` }|` (note the space after opening and before closing tag).

2. Parameters are seperated with a comma and a space `, `.

3. Parameter bag should always be appended to original text.

`Your string with %var% goes here.|{ %var%: Var }|`

4. Regular expressions do not allow extra spaces, **following won't work!**

```
Your string with %var% and %param%.|{ %var%: Var, %param%: Param }|
```