Skip to content

[2.1][Translator] Symfony translation process & gettext #4245

Closed
@goetas

Description

@goetas

I have a question about symfony translation process.

Currently it seems that symfony does not support POT files. I've added into my symfony fork a custom PotFileDumper.

There is some symfony design choices that i not understand:

Q1: Why Symfony\Component\Translation\Dumper\FileDumper always crate files as {path}.{locale}.{extension}? With POT files {locale} has not sense because POT file is not yet localized. (http://en.wikipedia.org/wiki/File:Gettext.svg)

Q2: All message extractors (Symfony\Component\Translation\Extractor\ExtractorInterface) uses a "prefix" to mark the untranslated string. This behaviour in a gettext environment (using tools like Virtaal or Pootle) is very boring, this because in gettext an untranslated string is an empty string (not a prefixed string). (http://www.gnu.org/software/gettext/manual/gettext.html#Untranslated-Entries)

Q3: As i can see inside TranslationUpdateCommand, translation can be extract only form "Bundle"/Resources/views directory. Also this is very boring because i can have a very large set of software components, and i will need to extract translations from them. ( php files that uses function with __('String to translate') syntax).

Q4: The translation:update command is intended to extract messages from source, or to update MessageCatalogue adding the untranslated strings?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions