Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Translation][TwigBridge] Implementing variables extraction in "translation:update" #38884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
06fba65
Implementing variables extraction in "translation:update"
liarco Oct 29, 2020
e2934b5
Applying patch from fabbot
liarco Oct 29, 2020
bedb0be
Fixing regression: Twig t() now works when domain is set with trans_d…
liarco Oct 30, 2020
87d542f
Fixing variables metadata overwriting previously set data (PHP extrac…
liarco Oct 30, 2020
8142f75
Updating existing tests to include variables
liarco Oct 30, 2020
a333f13
Applying patch from fabbot
liarco Oct 30, 2020
38d9e55
Supporting both long and short array syntax (PHP extractor)
liarco Oct 30, 2020
edb5aa9
Improving/fixing existing tests and adding variables tests (PHP extra…
liarco Oct 30, 2020
31f96a0
Adding variables tests (Twig extractor)
liarco Oct 31, 2020
5c2e782
Clearer naming
liarco Oct 31, 2020
c3e2e88
Avoid overwriting metadata completely when adding variables note (Twi…
liarco Oct 31, 2020
c50ce67
Supporting "t()" functions (Twig) without "|trans()" filter (e.g. as …
liarco Oct 31, 2020
6e4013c
Fixing duplicate notes. Extractors now keep the higher variables coun…
liarco Oct 31, 2020
3e0bb8e
Improving readability
liarco Oct 31, 2020
deb72d3
Always update variables with latest from code
liarco Oct 31, 2020
e8cee75
Fixing bug preventing update of variables from source in some cases
liarco Nov 13, 2020
63a52b9
Fixing unintended CS errors (thanks @wouterj)
liarco Nov 13, 2020
2a10f37
Applying patch from fabbot (reviewed manually)
liarco Dec 18, 2020
0a5366f
Minor fixes
liarco Mar 9, 2021
46d26ec
Using constants for metadata key and prefix
liarco Mar 9, 2021
1612c08
Fixing CI
liarco Mar 9, 2021
8ec6086
Improving code quality
liarco Mar 9, 2021
0025c52
Fixing static analysis (Psalm)
liarco Mar 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Applying patch from fabbot
  • Loading branch information
liarco committed Mar 9, 2021
commit e2934b599a84de5de300bdb54951665942dc2c3c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private function getReadVariablesFromNode(Node $node): ?array

foreach ($node as $key => $variable) {
welcoMattic marked this conversation as resolved.
Show resolved Hide resolved
// Odd children are variable names, even ones are values
if ($key % 2 == 1) {
if (1 == $key % 2) {
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions 4 src/Symfony/Bridge/Twig/Translation/TwigExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ protected function extractTemplate(string $template, MessageCatalogue $catalogue
$catalogue->setMetadata($id, ['notes' => [
[
'category' => 'symfony-extractor-variables',
'content' => 'Available variables: ' . join(', ', $message[2]),
]
'content' => 'Available variables: '.implode(', ', $message[2]),
],
]], $message[1] ?: $this->defaultDomain);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ protected function parseTokens(array $tokens, MessageCatalogue $catalog, string
$catalog->setMetadata($message, ['notes' => [
[
'category' => 'symfony-extractor-variables',
welcoMattic marked this conversation as resolved.
Show resolved Hide resolved
'content' => 'Available variables: ' . join(', ', $variables),
]
'content' => 'Available variables: '.implode(', ', $variables),
],
]], $domain);
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.