CakeDC / Enum

Enumeration list for CakePHP
MIT License
27 stars 17 forks source link

Enum translation #19

Closed aiphee closed 7 years ago

aiphee commented 8 years ago

Is it possible to use different name for saving and displaying for multilingual purposes?

pmoraes commented 8 years ago

Hi @aiphee it does not support yet.

inoas commented 8 years ago

A strategy like privateArray would help with that as constant values cannot easily be translated.

ADmad commented 8 years ago

Adding translation support would be easy. You could just update EnumBehavior::enum() to run the list values through __() or similar before returning.

inoas commented 8 years ago

When we get to use it (currently just planned), we will patch it and contribute back, if no one beats us to it. We'd probably prefer __d() with the domain set to the current plugin (if it is set) over __().