17615[BUGFIX] Numeric translation keys aren't translated right in XML files
Commit message
Review
-
Code review CR +2
- Andreas Wolf +2
-
Verified V +2
- Andreas Wolf +2
Files 3
Review log 22
-
Dmitry Dulepov commented on patch set 1 02/09/13, 22:11
Fails; I would prefer that you didn't submit this I believe this will not work properly. array_merge overrides elements with the same key but the "+" operator does not override elements with the same key from the first array. The goal of this code is to override source with target. Simple test: ============= $ php -r '$source = array("1" => "from source"); $target = array("1" => "from target"); print_r($source + $target);' Array ( [1] => from source ) $ ============= If I am wrong, please, tell me and I will remove my -1. -
Reinhard Führicht commented on patch set 1 02/09/13, 22:11
I created a simple translation file: <label index="1">Translation for 1</label> <label index="2">Translation for 2</label> <label index="20">Translation for 20</label> And a simple TS: page { 1 = TEXT 1.data = LLL:path/to/file/lang.xml:1 2 = TEXT 2.data = LLL:path/to/file/lang.xml:2 3 = TEXT 3.data = LLL:path/to/file/lang.xml:20 } I am not familiar with how to add unit tests to TYPO3. I had a look at the sources from GIT, but there is no "tests" directory or similar. I could try to add unit tests for that, but I would need a hint or two on how to do that. -
Reinhard Führicht commented on patch set 1 02/09/13, 22:11
Thanks for the hint! I will give it a try. -
Reinhard Führicht commented on patch set 1 02/09/13, 22:11
Of course, you are right. Thanks for pointing that out, I missed it in the docs. Then it should be enough to switch the two arrays $parsedData and $parsedDataTarget, right? I will try to add a unit test too and create a new patch. -
Andreas Wolf commented on patch set 2 02/09/13, 22:11
(1 inline comment)locallangNumericKeys.xml:17I'd like to have some key like 10 here, as this means a gap in the numbering and would definitely lead to a failure if the keys are renumbered. The fixture is also clearer then, because the renumbering (1..3->0..2) is not as obvious here as it would be with 1..10->0..3. -
Reinhard Führicht uploaded patch set 2 02/09/13, 22:11
-
Andreas Wolf commented on patch set 4 02/09/13, 22:11
Verified; Looks good to me, but someone else must approve -
Andreas Wolf uploaded patch set 5 02/09/13, 22:11
-
Andreas Wolf commented on patch set 5 V 0 02/09/13, 22:11
by team member; Looks good to me, approved Refined Dmitry's changes to have a data provider and test each of the different values independently. -
Dmitry Dulepov uploaded patch set 4 02/09/13, 22:11
-
Dmitry Dulepov commented on patch set 4 02/09/13, 22:11
Verified; Looks good to me, but someone else must approve I changed unit test to test for actual label overloading. -
Reinhard Führicht uploaded patch set 3 02/09/13, 22:11
-
Reinhard Führicht commented on patch set 4 02/09/13, 22:11
Hi Dmitry, I thought about doing that too. Correct me if I am wrong, but if this patch breaks something, "canOverrideLlxml" should fail as it already test the "overloading" feature. Is it necessary to test it again with numeric keys? Or should we create a separate test "canOverloadNumericKeys"? Don't get me wrong, I don't want to nag. I just want to do it the right way. -
Philipp Gampe commented on patch set 1 02/09/13, 22:11
Looks good to me, but someone else must approve Do you have a test extension, or even better could you create unit tests for this? -
Mattias Nilsson commented on patch set 1 02/09/13, 22:11
Looks good to me, but someone else must approve -
Mr. Jenkins commented on patch set 1 02/09/13, 22:11
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/7188/ : SUCCESS -
Mr. Jenkins commented on patch set 2 02/09/13, 22:11
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/7389/ : SUCCESS -
Mr. Jenkins commented on patch set 3 02/09/13, 22:11
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/7406/ : SUCCESS -
Mr. Jenkins commented on patch set 4 02/09/13, 22:11
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/7410/ : SUCCESS -
Mr. Jenkins commented on patch set 5 02/09/13, 22:11
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/7437/ : SUCCESS -
Wouter Wolters commented on patch set 1 02/09/13, 22:11
Hi Reinhard, For the Unit tests see http://git.typo3.org/TYPO3v4/Core.git/blob/HEAD:/typo3/sysext/core/Tests/Unit/Localization/Parser/LocallangXmlParserTest.php -
Andreas Wolf merged patch set 6 02/09/13, 22:11