Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

FileSize
2.7 KB

I haven't run the test, but yeah this should be a good start.

dawehner’s picture

Status: Active » Needs review

The testbot seems to be enable on this project, so let's see.

xjm’s picture

Status: Needs review » Needs work

The last submitted patch, 1: 2311935-potx.patch, failed testing.

Gábor Hojtsy’s picture

Gábor Hojtsy’s picture

Issue tags: +Drupal 8 compatibility
Gábor Hojtsy’s picture

Status: Postponed » Needs work
Issue tags: +Needs tests, +D8MI

Status: Needs work » Needs review

dawehner queued 1: 2311935-potx.patch for re-testing.

Gábor Hojtsy’s picture

Issue tags: -Needs tests
FileSize
1.38 KB

#2322839: Unify YAML translation extraction, and allow extension by contrib. makes this theoretically easier to do but then it does not support a direct value extraction from an arbitrary key if its not an array. So this will still fail. We either need to make up some sensible syntax for the 'not an array, take the key' variant or just go back to the manual parsing solution for this file. Will summon @herom for this question :)

Sorry no interdiff, but I used the test yaml file and the test PHP code verbatim from @dawehner.

Status: Needs review » Needs work

The last submitted patch, 9: permissions-support-potx.patch, failed testing.

The last submitted patch, 1: 2311935-potx.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs work » Needs review
FileSize
2.61 KB

Rolled a variant of @dawehner's patch instead.

Status: Needs review » Needs work

The last submitted patch, 12: 2311935-potx-12.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs work » Needs review
FileSize
2.61 KB
499 bytes

Helps to check the file name with the good variable.

herom’s picture

FileSize
2.72 KB

I think this might pop up in other places. So, let's try handling this the NEW way.
I have used the empty string ('') as special key, to mark all top-level keys as translatable. This won't be recursive, and will leave array values alone.

Edit:
It will look like this

+++ b/yaml_translation_patterns.yml
@@ -22,5 +22,9 @@
+*.permissions.yml:
+  - title
+  - description
+  - ''
herom’s picture

FileSize
1.4 KB
2.77 KB

Updated to use '%top-level-key', after discussing with @Gabor.

  • Gábor Hojtsy committed 82b017b on 6.x-3.x
    Issue #2311935 by Gábor Hojtsy, herom, dawehner: Add support for ....
Gábor Hojtsy’s picture

Version: 6.x-3.x-dev » 7.x-2.x-dev
Status: Needs review » Patch (to be ported)

Made some minor whitespace fixes and committed. Thanks a lot!

BTW I've been pondering a bit around %top-level-key vs. %top-level-value, because you actually make the value translatable, but in all other cases, you put in the key name, so referring to the key here makes sense for consistency. Also for those not aware this was suggested for 'consistency' with %key, %value, %parent, etc. in config schema.

herom’s picture

Version: 7.x-2.x-dev » 6.x-3.x-dev
Status: Patch (to be ported) » Fixed
Gábor Hojtsy’s picture

Status: Fixed » Closed (duplicate)

  • Gábor Hojtsy committed 82b017b on 7.x-2.x
    Issue #2311935 by Gábor Hojtsy, herom, dawehner: Add support for ....

  • Gábor Hojtsy committed 82b017b on 7.x-3.x
    Issue #2311935 by Gábor Hojtsy, herom, dawehner: Add support for ....