Give the gift of Drupal. All merchandise is 50% off through 2016.
This issue is about testing the Symfony Translation component for a Gettext replacement.
As motivated inwe need a better component for Gettext processing.
Key parts that need to be addressed are:
- Can we support the installer?
- Can we load a .po file into the database?
- Can we dump from the database to a .po file?
- Can we edit translations?
The questions seems trivial but are they?
Use the Symfony components Translation and Config to Drupal to load / save PO files and handle translation.
- being able to write different input/output formats to use for version control. xml, yaml, php
- no tests anymore for translations needed. These should reside within Symfony.
- do we loose Gettext comments and is that bad?
- dependency on the development pace Symfony provides.
Symfony uses a different format regarding handling translations compared to the Gettext format:
1. Messages are stored into a MessageCatalog which supports domains. Drupal uses Context for that.
2. Singular and Plural message source ids are disjunct. (Not really sure how Drupal does this)
When Symfony has
$messages = array( 'One sheep' => 'Un mouton', '@count sheeps' => 'Un mouton|@count sheeps' );
is uses only the
@count sheeps when doing
format_plural(3, 'One sheep', '@count sheeps')
That is Symfony has it's own pluralization rules. We can add our own Rules through
Symfony must definitely change their plural seperator which is now a '|'. This should be something like our '\03' LOCALE_PLURAL_DELIMITER.
We need the PO header for our plural calculations. Symfony does not yet parse the header. It uses PluralizationRules which is extendible by custom rules. This related closely to
But we do write PO files and want them to have a PO Header. See pull request https://github.com/symfony/symfony/pull/4249 discusses the progress.
Comments '#' are not yet handled by the PoFileLoader. Do we need these?
The major Symfony PR is [WIP]: Allow Drupal to use Translate component which lead to some small commits done through:
#4336 [BUG] PoFileLoader pluralhandling uses interval instead of index.
#4337 Fixed for allowing empty translation.
#3339 Allow for missing whitelines.
User interface changes
FAILED: [[SimpleTest]]: [MySQL] 36,592 pass(es), 25 fail(s), and 0 exception(s). View
FAILED: [[SimpleTest]]: [MySQL] 36,563 pass(es), 47 fail(s), and 0 exception(s). View
FAILED: [[SimpleTest]]: [MySQL] 36,540 pass(es), 58 fail(s), and 0 exception(s). View
FAILED: [[SimpleTest]]: [MySQL] 36,529 pass(es), 64 fail(s), and 0 exception(s). View
FAILED: [[SimpleTest]]: [MySQL] 36,526 pass(es), 66 fail(s), and 0 exception(s). View