Skip to content

Configuration

phil/translation-bundle
# config/packages/phil_translation.yaml
phil_translation:
    store: doctrine            # or "memory", for tests
    entity_manager: default
    granularity: block         # or "sentence"
    prefill: true
    min_score: 0.7
    max_suggestions: 5
    sources: ~                 # a SourceDocuments service
    policy: ~                  # a TranslationPolicy service
    layout: '@PhilTranslation/layout.html.twig'
    variants: [fr-CA, en-CA]   # the regional variants that inherit from their parent
    translators: ~             # a Translators service
    inflector: ~               # an Inflector service, such as Phil\TranslationMemory\Glossary\RegularPlurals
    machine_translation:
        enabled: false
        translator: ~          # a MachineTranslator service
OptionDefaultMeaning
storedoctrineWhere segments, terms and the memory are kept: Doctrine, or PHP arrays that last one request — for tests
entity_managerdefaultThe Doctrine entity manager of the tables
granularityblockHow documents are cut: one segment per text field of a block, or one per sentence
prefilltrueWhether new segments are proposed the exact matches of the memory, as suggested
min_score0.7The lowest score of a fuzzy match, from 0.01 to 1; 1 keeps exact matches only
max_suggestions5The most matches proposed for a segment, at least 1
sourcesnoneThe service, a SourceDocuments, that finds the documents to translate; the screen needs it
policynoneThe service, a TranslationPolicy, that says who may translate and review; the screen needs it
layout@PhilTranslation/layout.html.twigThe Twig layout the screen and the glossary pages extend; it defines the blocks title and content
variants[fr-CA, en-CA]The regional variants, as BCP 47 tags with a parent, that inherit the targets of their parent language; see Regional variants
translatorsnoneThe service, a Translators, that names the current user and the public credit of each translator; see Comments and credits
inflectornoneThe service, an Inflector, whose forms the glossaries add to their terms
machine_translation.enabledfalseWhether machine translation is on; see Machine translation
machine_translation.translatornoneThe service, a MachineTranslator, an adapter named after its service; needed when enabled is true

Changing granularity on documents already prepared changes every key: their segments are prepared again, the old ones removed and the new ones proposed what the memory learnt from the old.

Services

ServicePublicRole
Phil\TranslationBundle\Application\TranslationsyesThe translation of documents
Phil\TranslationBundle\Application\GlossariesyesThe glossaries
Phil\TranslationBundle\Application\CommentsyesThe comments on segments
Phil\TranslationMemory\Memory\TranslationMemoryyesThe memory, for lookups of the application's own
Phil\TranslationBundle\Infrastructure\Http\TranslationControlleryesThe screen
Phil\TranslationBundle\Infrastructure\Http\GlossaryControlleryesThe glossary pages
Phil\TranslationBundle\Infrastructure\Twig\CreditsExtensionnoThe Twig function phil_translation_credits()
Phil\TranslationBundle\Domain\Repository\Contract\CommentRepositoryaliasThe store of comments
Phil\TranslationMemory\VariantsnoThe regional variants of the configuration
Phil\TranslationMemory\Glossary\RegularPluralsnoThe regular plurals of English and French, for inflector
Phil\TranslationBundle\Domain\Repository\SegmentRepositoryaliasThe store of segments
Phil\TranslationBundle\Domain\Repository\TermRepositoryaliasThe store of terms
Phil\TranslationMemory\Memory\MemoryStorealiasThe store of the memory
Phil\TranslationMemory\Segmentation\UjoSegmenternoThe segmenter of the configured granularity