Problem/Motivation

The Drush comment only export templates with translatable strings. It does not support exportation of the existing translations. Not does it support the inclusion of language dependent content in the exported template.

Proposed resolution

Add options the following option to the drush command

  • language: If set, the exported template will include the language dependent content (like plural formulas and language name)
  • translations: If set, the exported file will include translations.

Remaining tasks

Currently the exported file uses the .pot, one may want to ensure a file containing translations uses a $language.po extension. This may requires changes to potx itself (and not just the Drush command). Also, I'm not sure if potx support this when the Web UI is used.

Comments

pbuyle’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev

The patch in potx-drush_language-2175955-2.patch implements the suggested solution. It has been build and tested on the 7.x-1.x branch (after copying the potx.drush.inc file from the 6.x-3.x branch, see [#720986#42]). The only changes are on the potx.drush.inc file, so the patch should safely apply to the 6.x-3.x branch.

pbuyle’s picture

StatusFileSize
new2.6 KB
FreekVR’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, this works! Note that the patch also applies fine on the 7.x-3.x branch.

PascalAnimateur’s picture

I can confirm the patch works with potx 7.x-3.x-dev also. Should it be committed there too ?

drzraf’s picture

potx single --translations --language fr

Trying to get property of non-object potx.inc:638
Trying to get property of non-object potx.inc:649

Because this should be --language=fr, maybe code could catch this.

The only confusing thing is that filename is still general.pot rather than, eg, project.fr.po
(could be link to issue #2730189: drush extract output directory so that single can be set to export to stdout so one can redirect in whatever file he wants)

drdam’s picture

patch #2 OK for me

Subscribe the #5 : I think its a really good idea

dmsmidt’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev

Another +1 if we fix naming files in the follow up.

gábor hojtsy’s picture

Sent it to test with 8.1 assuming it applies. It still has the same drush.inc file.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

Would be great to have a 8.x patch as well, so we can commit to both branches at once. I would not like to commit features into the 7.x branch only at this point. (I know I was slacking off maintaining the module, so that is my fault).

gábor hojtsy’s picture

Status: Needs work » Needs review
StatusFileSize
new2.21 KB

Rerolled for 8.x

gábor hojtsy’s picture

StatusFileSize
new2.11 KB

Duh, that was rolled against 7.x still. Rerolling against 8.x for real now.

gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

  • Gábor Hojtsy committed e89c638 on 8.x-1.x
    Issue #2175955 by Gábor Hojtsy, pbuyle, PascalAnimateur, FreekVR, drzraf...

  • Gábor Hojtsy committed deffa85 on 8.x-1.x
    Issue #2175955 by Gábor Hojtsy, pbuyle, PascalAnimateur, FreekVR, drzraf...

  • Gábor Hojtsy committed 90afb49 on 7.x-3.x
    Issue #2175955 by Gábor Hojtsy, pbuyle, PascalAnimateur, FreekVR, drzraf...
gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all. Committed to 8.x including a followup commit to fix the missing language_list() :D Also committed to 7-3.x.

gábor hojtsy’s picture

Realized this was not ported to the Drush 9/10 integration API. Opened #3169697: New language and translations options were not added to Drush 9/10 integration.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.