forked from lokalise/i18n-ally
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test cases for php from @terales
- Loading branch information
Showing
309 changed files
with
1,670 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"i18n-ally.enabledFrameworks": ["laravel"], | ||
"i18n-ally.enabledParsers": ["json"], | ||
"i18n-ally.localesPaths": ".", | ||
"i18n-ally.pathMatcher": "messages.{locale}.json", | ||
"i18n-ally.keystyle": "flat", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Extraction tests runs automatically. | ||
|
||
Prepare tests in this format: | ||
``` | ||
source class name/ | ||
├─ expression_from_extraction (concatenation, interpolation, functions, methods)/ | ||
│ ├─ test_case_name/ | ||
│ │ ├─ input/ | ||
│ │ │ ├─ source files | ||
│ │ │ ├─ sink file | ||
│ │ ├─ output/ | ||
│ │ │ ├─ changed input files (source, sinks, etc) | ||
``` | ||
|
||
# Test structure | ||
``` | ||
<?php // setup test data so test compiles | ||
$name = 'John'; // | ||
$msg = sprintf('Welcome, %s!', $name); // prepare the last expression | ||
// that should trigger the extraction intention. | ||
// ONLY the last intention would be executed | ||
``` | ||
|
||
# Style guide | ||
|
||
### Use underscores to separate words in folder and file names | ||
``` | ||
// bad | ||
function as placeholder name | ||
function-as-placeholder-name | ||
function_as-placeholder-name | ||
// GOOD | ||
function_as_placeholder_name | ||
``` | ||
|
||
### Use lower case letters in files and folders names | ||
``` | ||
// bad | ||
Skip_html | ||
skip_HTML | ||
// GOOD | ||
skip_html | ||
``` | ||
|
||
### Omit articles (`a`, `the`) | ||
``` | ||
// bad | ||
skip_the_html | ||
// GOOD | ||
skip_html | ||
``` | ||
|
||
### Omit strings word as we always deal with strings during code inspections/extraction | ||
``` | ||
// bad | ||
strings_interpolation | ||
// GOOD | ||
interpolation | ||
``` |
3 changes: 3 additions & 0 deletions
3
...umber_to_placeholders_with_identical_name_but_different_expression/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
.../add_number_to_placeholders_with_identical_name_but_different_expression/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
$key = 'key'; | ||
$arrayExample = ['key' => 'value']; | ||
|
||
$msg = "Both '" . $arrayExample['key'] . "' and '" . $arrayExample[$key] . "' are valid"; |
3 changes: 3 additions & 0 deletions
3
...mber_to_placeholders_with_identical_name_but_different_expression/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"both_and_are_valid": "Both '{arrayExample}' and '{arrayExample_2}' are valid" | ||
} |
5 changes: 5 additions & 0 deletions
5
...add_number_to_placeholders_with_identical_name_but_different_expression/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
$key = 'key'; | ||
$arrayExample = ['key' => 'value']; | ||
|
||
$msg = $translator->trans('both_and_are_valid', ['arrayExample' => $arrayExample['key'], 'arrayExample_2' => $arrayExample[$key]]); |
3 changes: 3 additions & 0 deletions
3
...tures/php/extraction-tests/PlainPhpSource/concatenation/both_sides/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
test/fixtures/php/extraction-tests/PlainPhpSource/concatenation/both_sides/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
$very = 'Very'; | ||
$name = 'John'; | ||
|
||
$msg = $very. " welcome, ". $name; |
3 changes: 3 additions & 0 deletions
3
...ures/php/extraction-tests/PlainPhpSource/concatenation/both_sides/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"welcome": "{very} welcome, {name}" | ||
} |
5 changes: 5 additions & 0 deletions
5
test/fixtures/php/extraction-tests/PlainPhpSource/concatenation/both_sides/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
$very = 'Very'; | ||
$name = 'John'; | ||
|
||
$msg = $translator->trans('welcome', ['very' => $very, 'name' => $name]); |
16 changes: 16 additions & 0 deletions
16
test/fixtures/php/extraction-tests/PlainPhpSource/concatenation/both_sides_xliff/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"keyNamingPattern": "DEFAULT_PATTERN", | ||
"name": "messages", | ||
"sink": { | ||
"placeHolderName": "{%name%}", | ||
"sinkType": "xliffSink", | ||
"sinkFileName": "messages.xlf" | ||
}, | ||
"source": { | ||
"functionName": "$translator->trans", | ||
"placeholderArgumentsTemplate": "'%key%', %map%", | ||
"simpleArgumentsTemplate": "'%key%'", | ||
"sourceType": "plainPhpSource", | ||
"sourceFileName": "source.php" | ||
} | ||
} |
Empty file.
5 changes: 5 additions & 0 deletions
5
...tures/php/extraction-tests/PlainPhpSource/concatenation/both_sides_xliff/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
$very = 'Very'; | ||
$name = 'John'; | ||
|
||
$msg = $very. " welcome, ". $name; |
11 changes: 11 additions & 0 deletions
11
...es/php/extraction-tests/PlainPhpSource/concatenation/both_sides_xliff/output/messages.xlf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0"?> | ||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> | ||
<file source-language="en" target-language="en" datatype="plaintext" original="file.ext"> | ||
<body> | ||
<trans-unit id="welcome"> | ||
<source>welcome</source> | ||
<target>{very} welcome, {name}</target> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> |
5 changes: 5 additions & 0 deletions
5
...ures/php/extraction-tests/PlainPhpSource/concatenation/both_sides_xliff/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
$very = 'Very'; | ||
$name = 'John'; | ||
|
||
$msg = $translator->trans('welcome', ['very' => $very, 'name' => $name]); |
3 changes: 3 additions & 0 deletions
3
...on-tests/PlainPhpSource/concatenation/constant_as_placeholder_name/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
...traction-tests/PlainPhpSource/concatenation/constant_as_placeholder_name/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
$msg = 'Welcome, ' . __FILE__ . '!'; |
3 changes: 3 additions & 0 deletions
3
...n-tests/PlainPhpSource/concatenation/constant_as_placeholder_name/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"welcome": "Welcome, {file}!" | ||
} |
3 changes: 3 additions & 0 deletions
3
...raction-tests/PlainPhpSource/concatenation/constant_as_placeholder_name/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
$msg = $translator->trans('welcome', ['file' => __FILE__]); |
3 changes: 3 additions & 0 deletions
3
...ures/php/extraction-tests/PlainPhpSource/concatenation/constructor/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
test/fixtures/php/extraction-tests/PlainPhpSource/concatenation/constructor/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
throw new \Exception('Welcome, ' . $name . '!'); |
3 changes: 3 additions & 0 deletions
3
...res/php/extraction-tests/PlainPhpSource/concatenation/constructor/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"welcome": "Welcome, {name}!" | ||
} |
4 changes: 4 additions & 0 deletions
4
.../fixtures/php/extraction-tests/PlainPhpSource/concatenation/constructor/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
throw new \Exception($translator->trans('welcome', ['name' => $name])); |
3 changes: 3 additions & 0 deletions
3
...inPhpSource/concatenation/fallback_undetectable_placeholder_naming/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
...ts/PlainPhpSource/concatenation/fallback_undetectable_placeholder_naming/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
$name = 'John'; | ||
$generic = 'customer'; | ||
|
||
$msg = 'Welcome, ' . (!empty($name) ? $name : $generic) . '!'; |
3 changes: 3 additions & 0 deletions
3
...nPhpSource/concatenation/fallback_undetectable_placeholder_naming/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"welcome": "Welcome, {expr}!" | ||
} |
5 changes: 5 additions & 0 deletions
5
...s/PlainPhpSource/concatenation/fallback_undetectable_placeholder_naming/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
$name = 'John'; | ||
$generic = 'customer'; | ||
|
||
$msg = $translator->trans('welcome', ['expr' => (!empty($name) ? $name : $generic)]); |
3 changes: 3 additions & 0 deletions
3
...on-tests/PlainPhpSource/concatenation/function_as_placeholder_name/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...traction-tests/PlainPhpSource/concatenation/function_as_placeholder_name/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
$msg = "Welcome, " . trim($name) . "!"; |
3 changes: 3 additions & 0 deletions
3
...n-tests/PlainPhpSource/concatenation/function_as_placeholder_name/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"welcome": "Welcome, {trim}!" | ||
} |
4 changes: 4 additions & 0 deletions
4
...raction-tests/PlainPhpSource/concatenation/function_as_placeholder_name/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
$msg = $translator->trans('welcome', ['trim' => trim($name)]); |
3 changes: 3 additions & 0 deletions
3
...enation/function_diff_placeholder_for_same_function_with_diff_args/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...concatenation/function_diff_placeholder_for_same_function_with_diff_args/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
$msg = "Welcome, " . trim($name) . " and " . trim(strip_tags($name)) . "!"; |
3 changes: 3 additions & 0 deletions
3
...nation/function_diff_placeholder_for_same_function_with_diff_args/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"welcome_and": "Welcome, {trim} and {trim_2}!" | ||
} |
4 changes: 4 additions & 0 deletions
4
...oncatenation/function_diff_placeholder_for_same_function_with_diff_args/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
$msg = $translator->trans('welcome_and', ['trim' => trim($name), 'trim_2' => trim(strip_tags($name))]); |
3 changes: 3 additions & 0 deletions
3
...Source/concatenation/function_same_placeholder_for_same_expression/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...ainPhpSource/concatenation/function_same_placeholder_for_same_expression/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
$msg = "Welcome, " . trim($name) . " and " . trim($name) . "!"; |
3 changes: 3 additions & 0 deletions
3
...ource/concatenation/function_same_placeholder_for_same_expression/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"welcome_and": "Welcome, {trim} and {trim}!" | ||
} |
4 changes: 4 additions & 0 deletions
4
...inPhpSource/concatenation/function_same_placeholder_for_same_expression/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
$msg = $translator->trans('welcome_and', ['trim' => trim($name)]); |
3 changes: 3 additions & 0 deletions
3
...extraction-tests/PlainPhpSource/concatenation/function_whitelisted/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
...s/php/extraction-tests/PlainPhpSource/concatenation/function_whitelisted/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
$msg = purpose('Welcome ' . $name); | ||
|
||
$msg = notInWhileList('Welcome ' . $name); |
3 changes: 3 additions & 0 deletions
3
...xtraction-tests/PlainPhpSource/concatenation/function_whitelisted/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"welcome": "Welcome {name}" | ||
} |
6 changes: 6 additions & 0 deletions
6
.../php/extraction-tests/PlainPhpSource/concatenation/function_whitelisted/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
$msg = purpose($translator->trans('welcome', ['name' => $name])); | ||
|
||
$msg = notInWhileList('Welcome ' . $name); |
3 changes: 3 additions & 0 deletions
3
...oncatenation/group_placeholders_with_identical_name_and_expression/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...urce/concatenation/group_placeholders_with_identical_name_and_expression/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$arrayExample = ['key' => 'value']; | ||
|
||
$msg = "Both '" . $arrayExample['key'] . "' and '" . $arrayExample['key'] . "' are valid"; |
3 changes: 3 additions & 0 deletions
3
...ncatenation/group_placeholders_with_identical_name_and_expression/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"both_and_are_valid": "Both '{arrayExample}' and '{arrayExample}' are valid" | ||
} |
4 changes: 4 additions & 0 deletions
4
...rce/concatenation/group_placeholders_with_identical_name_and_expression/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$arrayExample = ['key' => 'value']; | ||
|
||
$msg = $translator->trans('both_and_are_valid', ['arrayExample' => $arrayExample['key']]); |
3 changes: 3 additions & 0 deletions
3
...p/extraction-tests/PlainPhpSource/concatenation/language_construct/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...res/php/extraction-tests/PlainPhpSource/concatenation/language_construct/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
echo 'Welcome, ' . $name . '!'; |
3 changes: 3 additions & 0 deletions
3
.../extraction-tests/PlainPhpSource/concatenation/language_construct/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"welcome": "Welcome, {name}!" | ||
} |
4 changes: 4 additions & 0 deletions
4
...es/php/extraction-tests/PlainPhpSource/concatenation/language_construct/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
echo $translator->trans('welcome', ['name' => $name]); |
3 changes: 3 additions & 0 deletions
3
...extraction-tests/PlainPhpSource/concatenation/map_value_assignment/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...s/php/extraction-tests/PlainPhpSource/concatenation/map_value_assignment/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
$arrayExample = ['key' => 'Welcome, ' . $name . '!']; |
3 changes: 3 additions & 0 deletions
3
...xtraction-tests/PlainPhpSource/concatenation/map_value_assignment/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"welcome": "Welcome, {name}!" | ||
} |
4 changes: 4 additions & 0 deletions
4
.../php/extraction-tests/PlainPhpSource/concatenation/map_value_assignment/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
$name = 'John'; | ||
|
||
$arrayExample = ['key' => $translator->trans('welcome', ['name' => $name])]; |
3 changes: 3 additions & 0 deletions
3
...tests/PlainPhpSource/concatenation/multiple_placeholders_same_name/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
...ction-tests/PlainPhpSource/concatenation/multiple_placeholders_same_name/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
$key = 'key'; | ||
$key2 = 'key2'; | ||
$arrayExample = ['key' => 'value']; | ||
|
||
$msg = "User-facing string: '" . $arrayExample[$key] . "' and '" . $arrayExample[$key2] . "'"; |
3 changes: 3 additions & 0 deletions
3
...ests/PlainPhpSource/concatenation/multiple_placeholders_same_name/output/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"userfacing_string_and": "User-facing string: '{arrayExample}' and '{arrayExample_2}'" | ||
} |
6 changes: 6 additions & 0 deletions
6
...tion-tests/PlainPhpSource/concatenation/multiple_placeholders_same_name/output/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
$key = 'key'; | ||
$key2 = 'key2'; | ||
$arrayExample = ['key' => 'value']; | ||
|
||
$msg = $translator->trans('userfacing_string_and', ['arrayExample' => $arrayExample[$key], 'arrayExample_2' => $arrayExample[$key2]]); |
3 changes: 3 additions & 0 deletions
3
...ction-tests/PlainPhpSource/concatenation/multiple_simple_variables/input/messages.en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
.../extraction-tests/PlainPhpSource/concatenation/multiple_simple_variables/input/source.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
$name = 'John'; | ||
$price = 10.50; | ||
|
||
$msg = "Price for " . $name . ": " . $price; |
Oops, something went wrong.