Skip to content

Latest commit

 

History

History
48 lines (29 loc) · 1.67 KB

translations.md

File metadata and controls

48 lines (29 loc) · 1.67 KB

Translations

There are two types of translations:

  • Cocorico texts:

  • Users content:

    • stored in Database
    • manually or automatically translated through MS Translator API.
  • In case of error or to ignore some translations add /** @Ignore */ above the text to not translate.

  • To make some entity contents translatable, prefix them with the text entity.

      Ex: $status = array(1 => 'entity.custom.name', ...)
    
  • To customize how entity contents are translatable see Cocorico\CoreBundle\Translator\EntityExtractor

  • To make some admin contents translatable prefix them with admin.

      Ex: 'label' => 'admin.listing.title'
    

Extract translations

To extract translations keys from whole application: In english languages: php bin/console translation:extract en --config=cocorico php bin/console cache:clear --env=dev

To extract translations keys from external bundle: In english languages : php bin/console translation:extract en --bundle=CocoricoListingAlertBundle

To translate keys you have choice to:

Do not generate entities

Do not generate entities from generate:entities because of this doctrine remark and the use of mapped super class

This command is not suited for constant usage. It is a little helper and does not support all the mapping edge cases very well. You still have to put work in your entities after using this command.