Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The PO parsing code is pretty ugly for the moment and needs a lot of love.
Postponed until #1189184: OOP & PSR-0-ify gettext .po file parsing and generation is committed
Comment | File | Size | Author |
---|---|---|---|
#28 | 1637662-nr-bot.txt | 144 bytes | needs-review-queue-bot |
#15 | 1637662-15.patch | 24.52 KB | andypost |
#15 | interdiff.txt | 22.13 KB | andypost |
#14 | 1637662-14.patch | 3 KB | andypost |
Comments
Comment #1
aspilicious CreditAttribution: aspilicious commentedactive again
Comment #2
Gábor HojtsyAny bright ideas for cleanup? (I've had some initial code for simplifying the writer at http://drupal.org/node/1189184#comment-5705348, which I believe did not make it into the final patch, but not sure if someone has great ideas for the parser as well :). All-in-all I think the main priority in this area right now should be #1637348: Import Gettext .po files in progressive batches to avoid time limits, which is feature-freeze breaking. Cleanups are not. So I'd move this off the sprint too for that reason.
Comment #7
jludwig CreditAttribution: jludwig at SciShield commentedWhile updating some deprecated code in https://www.drupal.org/node/2911606 I noticed that both Drupal\Component\Gettext\PoItem and Drupal\Component\Gettext\Gettext depend on Drupal core.
LOCALE_PLURAL_DELIMITER is defined in core/includes/common.inc
I believe this violates the Drupal Components rule, which states that "Drupal Components are independent libraries that do not depend on the rest of Drupal in order to function." It was hidden from the automated test that checks this, though, because LOCALE_PLURAL_DELIMITER is not namespaced.
Comment #8
Gábor HojtsyThere is very likely an issue to merge this into the component. Although the global constant would probably need to be kept until 9.x for backwards compatibility. (I looked but could not find the issue right away).
Comment #9
penyaskitoLanded here while looking at #2918489: Plurals are not exported correctly when exporting source translations.
When this happens,
\Drupal\Component\Gettext\PoItem::$_langcode
looks like never used, at least when calling\Drupal\Component\Gettext\PoItem::setFromArray
Comment #10
zaporylieAccidentally came across leading underscores in private member variables within Gettext component (#2921676: Leading underscore character used for private member variables) and, through inline @todos, realized about this issue.
Comment #13
andypostThe rest of usage replaced in #2911606: Replace usage of the deprecated LOCALE_PLURAL_DELIMITER constant
Comment #14
andypostRemoval of
commin.inc
's constant is the first blocker for the issue - this constant is more about how Drupal manage item components so I moved it hereComment #15
andypostThe rest of core
Comment #16
andypostComment #17
andypostCR exists so I just linked it https://www.drupal.org/node/3014611
Comment #19
andypost#2911606: Replace usage of the deprecated LOCALE_PLURAL_DELIMITER constant commited
Now it needs to decide what todo next here
Comment #28
needs-review-queue-bot CreditAttribution: needs-review-queue-bot as a volunteer commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.