Problem/Motivation
The l10n_gettext module is used to upload *.po files.
It parses the file and imports the strings found in the file.
AFAICT it is used on l.d.o to bulk import translations for a project (module, distribution,...)
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork l10n_server-3292190
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
sanduhrsComment #3
gábor hojtsyI don't think l10n_gettext is used on l.d.o. It was built as a way to allow for using localization server to translate arbitrary .po files and thus serve as an open source translation platform independent of Drupal packages/formats. See https://www.hojtsy.hu/blog/2010-may-05/using-drupal-collaborative-softwa... -- it did not fulfill that hope unfortunately, although that would meant other people would contribute and make the tool better.
Porting this module is not needed for localize.drupal.org.
Comment #4
sanduhrsComment #5
sanduhrsPostponed, as we do not currently need it.
Comment #6
sanduhrsComment #7
fmb commentedThis feature will not be supported by the new 3.0.x branch.
Comment #8
fmb commentedComment #10
fmb commentedComment #12
gábor hojtsyTLD is I think this is useful especially if we want to involve frontenders in improving the interface, as it makes testing the module manually much easier :) Longer version:
Reopening: the Gettext connector is one of the three Drupal 7 connectors, and it is the way to feed a test site with a project without drupal.org or a package directory, which is needed for manual testing of the port. It is also the only source that Drupal 7 actually served through the release form upload: the Drupal packages connector announced an uploads source but never had a handler for it (#1653328: Undefined index: upload handler in l10n_server_release_file_upload_submit() for l10n_drupal).
The port has two parts.
Upload plumbing in l10n_server. The release form shows a "Source file" field for projects of a connector that takes uploads (the
ConnectorUploadHandlerInterfaceexisted unused; it now takes the file and the saved release and returns the parse result), hands the file to the connector after saving the release, stores the resulting counts and the parse time on the release, and reports the number of source strings like Drupal 7 did. Once parsed, the form shows "Source last parsed" with the start over link instead of the field, like Drupal 7. On a new release the project is not known until the form is submitted, so the field accepts the extensions of every enabled upload connector and the validation checks the chosen project's connector.The Gettext connector (
gettext:upload): every msgid of the uploaded .po or .pot becomes a source string of the release, plural forms joined into one string as potx does, with a file record named after the upload, through the shared Gettext parser and the entity writer from #3582331: Refactor ParserService potx string discovery.Found on the way: a release could not be saved through the form without a download link, and a file record not without a revision, because the storage schemas force those columns not null while the entity API stores an empty value as NULL. Drupal 7 allowed both empty. The schemas now allow NULL there, and the entity writer's log line copes with a release without a link.
Tests: Drupal 7
L10nGettextTestCase::testUploadSource()first (the release form field, the import message, five source strings from the community test fixture with plural and context, the file record, the start over link on the edit form), and the portGettextUploadTestchecks the same on 3.0.x.LLM was used to find, diagnose explain and fix this issue. With human review.
Comment #14
gábor hojtsy