From cfd002cbd889c0691133c82c6ec8f9a9e9cf431b Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 11 May 2012 22:00:46 +0200 Subject: [PATCH 1/4] Changed the regex delimiter for "The url should match" Using / as a regex delimiter when matching an url is a pain because it forces to escape all / in the url (and there more often / than " in an URL). --- i18n/cs.xliff | 2 +- i18n/de.xliff | 2 +- i18n/es.xliff | 2 +- i18n/fr.xliff | 4 ++-- i18n/ja.xliff | 4 ++-- i18n/nl.xliff | 2 +- i18n/pl.xliff | 2 +- i18n/pt.xliff | 2 +- i18n/ru.xliff | 2 +- i18n/sv.xliff | 2 +- src/Behat/MinkExtension/Context/MinkContext.php | 2 +- src/Behat/MinkExtension/Context/MinkDictionary.php | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/i18n/cs.xliff b/i18n/cs.xliff index 01d5afe..109c8f8 100644 --- a/i18n/cs.xliff +++ b/i18n/cs.xliff @@ -99,7 +99,7 @@ [^"]+)"$/]]> - (?:[^"]|\\")*)"$/]]> + (?:[^"]|\\")*)"$/]]> (?:[^"]|\\")*)"$/]]> diff --git a/i18n/de.xliff b/i18n/de.xliff index f74ded4..07811df 100644 --- a/i18n/de.xliff +++ b/i18n/de.xliff @@ -99,7 +99,7 @@ [^"]+)" sein$/]]> - (?:[^"]|\\")*)"$/]]> + (?:[^"]|\\")*)"$/]]> (?:[^"]|\\")*)" übereinstimmen$/]]> diff --git a/i18n/es.xliff b/i18n/es.xliff index f2e387a..1fc0f7a 100644 --- a/i18n/es.xliff +++ b/i18n/es.xliff @@ -99,7 +99,7 @@ [^"]+)"$/]]> - (?:[^"]|\\")*)"$/]]> + (?:[^"]|\\")*)"$/]]> (?:[^"]|\\")*)"$/]]> diff --git a/i18n/fr.xliff b/i18n/fr.xliff index f0d32ac..6171698 100644 --- a/i18n/fr.xliff +++ b/i18n/fr.xliff @@ -99,8 +99,8 @@ [^"]+)"$/]]> - (?:[^"]|\\")*)"$/]]> - (?:[^"]|\\")*)"$/]]> + (?:[^"]|\\")*)"$/]]> + (?:[^"]|\\")*)"$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/ja.xliff b/i18n/ja.xliff index 24f78c4..35b6247 100644 --- a/i18n/ja.xliff +++ b/i18n/ja.xliff @@ -99,8 +99,8 @@ [^\s]+) を表示していること$/]]> - \/([^\/]|\\\/)*\/)$/]]> - \/([^\/]|\\\/)*\/)" にマッチすること$/]]> + "([^"]|\\")*")$/]]> + "([^"]|\\")*") にマッチすること$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/nl.xliff b/i18n/nl.xliff index 6723a4a..527590b 100644 --- a/i18n/nl.xliff +++ b/i18n/nl.xliff @@ -95,7 +95,7 @@ [^"]+)" zijn$/]]> - (?:[^"]|\\")*)"$/]]> + (?:[^"]|\\")*)"$/]]> (?:[^"]|\\")*)"$/]]> diff --git a/i18n/pl.xliff b/i18n/pl.xliff index 7481f31..572bad6 100644 --- a/i18n/pl.xliff +++ b/i18n/pl.xliff @@ -99,7 +99,7 @@ [^"]+)"$/]]> - (?:[^"]|\\")*)"$/]]> + (?:[^"]|\\")*)"$/]]> (?:[^"]|\\")*)"$/]]> diff --git a/i18n/pt.xliff b/i18n/pt.xliff index 9193ce8..532eeeb 100644 --- a/i18n/pt.xliff +++ b/i18n/pt.xliff @@ -95,7 +95,7 @@ [^"]+)"$/]]> - (?:[^"]|\\")*)"$/]]> + (?:[^"]|\\")*)"$/]]> (?:[^"]|\\")*)"$/]]> diff --git a/i18n/ru.xliff b/i18n/ru.xliff index 9111b1f..cc5102c 100644 --- a/i18n/ru.xliff +++ b/i18n/ru.xliff @@ -107,7 +107,7 @@ [^"]+)"$/]]> - \/([^\/]|\\\/)*\/)$/]]> + "([^"]|\\")*")$/]]> (?:[^"]|\\")*)"$/]]> diff --git a/i18n/sv.xliff b/i18n/sv.xliff index 58e0f9a..c2b0ba5 100644 --- a/i18n/sv.xliff +++ b/i18n/sv.xliff @@ -95,7 +95,7 @@ [^"]+)"$/]]> - (?:[^"]|\\")*)"$/]]> + (?:[^"]|\\")*)"$/]]> (?:[^"]|\\")*)"$/]]> diff --git a/src/Behat/MinkExtension/Context/MinkContext.php b/src/Behat/MinkExtension/Context/MinkContext.php index 0bbf7b6..80fad9e 100644 --- a/src/Behat/MinkExtension/Context/MinkContext.php +++ b/src/Behat/MinkExtension/Context/MinkContext.php @@ -186,7 +186,7 @@ class MinkContext extends RawMinkContext implements TranslatedContextInterface /** * Checks, that current page PATH matches regular expression. * - * @Then /^the (?i)url(?-i) should match (?P\/([^\/]|\\\/)*\/)$/ + * @Then /^the (?i)url(?-i) should match (?P"([^"]|\\")*")$/ */ public function assertUrlRegExp($pattern) { diff --git a/src/Behat/MinkExtension/Context/MinkDictionary.php b/src/Behat/MinkExtension/Context/MinkDictionary.php index e492a08..b37cc44 100644 --- a/src/Behat/MinkExtension/Context/MinkDictionary.php +++ b/src/Behat/MinkExtension/Context/MinkDictionary.php @@ -254,7 +254,7 @@ trait MinkDictionary /** * Checks, that current page PATH matches regular expression. * - * @Then /^the (?i)url(?-i) should match (?P\/([^\/]|\\\/)*\/)$/ + * @Then /^the (?i)url(?-i) should match (?P"([^"]|\\")*")$/ */ public function assertUrlRegExp($pattern) { From eaa9a7b932ad83ad449c91add62f22984d6424c7 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 11 May 2012 22:11:58 +0200 Subject: [PATCH 2/4] Updated regexes in translations files --- i18n/cs.xliff | 4 ++-- i18n/de.xliff | 4 ++-- i18n/es.xliff | 4 ++-- i18n/fr.xliff | 4 ++-- i18n/nl.xliff | 4 ++-- i18n/pl.xliff | 4 ++-- i18n/pt.xliff | 4 ++-- i18n/ru.xliff | 2 +- i18n/sv.xliff | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/i18n/cs.xliff b/i18n/cs.xliff index 109c8f8..74ec33a 100644 --- a/i18n/cs.xliff +++ b/i18n/cs.xliff @@ -99,8 +99,8 @@ [^"]+)"$/]]> - (?:[^"]|\\")*)"$/]]> - (?:[^"]|\\")*)"$/]]> + "(?:[^"]|\\")*")$/]]> + "(?:[^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/de.xliff b/i18n/de.xliff index 07811df..82876d0 100644 --- a/i18n/de.xliff +++ b/i18n/de.xliff @@ -99,8 +99,8 @@ [^"]+)" sein$/]]> - (?:[^"]|\\")*)"$/]]> - (?:[^"]|\\")*)" übereinstimmen$/]]> + "(?:[^"]|\\")*")$/]]> + "(?:[^"]|\\")*") übereinstimmen$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/es.xliff b/i18n/es.xliff index 1fc0f7a..3df4ab1 100644 --- a/i18n/es.xliff +++ b/i18n/es.xliff @@ -99,8 +99,8 @@ [^"]+)"$/]]> - (?:[^"]|\\")*)"$/]]> - (?:[^"]|\\")*)"$/]]> + "(?:[^"]|\\")*")$/]]> + "(?:[^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/fr.xliff b/i18n/fr.xliff index 6171698..8cc6f4e 100644 --- a/i18n/fr.xliff +++ b/i18n/fr.xliff @@ -99,8 +99,8 @@ [^"]+)"$/]]> - (?:[^"]|\\")*)"$/]]> - (?:[^"]|\\")*)"$/]]> + "(?:[^"]|\\")*")$/]]> + "(?:[^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/nl.xliff b/i18n/nl.xliff index 527590b..2c7cf30 100644 --- a/i18n/nl.xliff +++ b/i18n/nl.xliff @@ -95,8 +95,8 @@ [^"]+)" zijn$/]]> - (?:[^"]|\\")*)"$/]]> - (?:[^"]|\\")*)"$/]]> + "(?:[^"]|\\")*")$/]]> + "(?:[^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/pl.xliff b/i18n/pl.xliff index 572bad6..8ba30cc 100644 --- a/i18n/pl.xliff +++ b/i18n/pl.xliff @@ -99,8 +99,8 @@ [^"]+)"$/]]> - (?:[^"]|\\")*)"$/]]> - (?:[^"]|\\")*)"$/]]> + "(?:[^"]|\\")*")$/]]> + "(?:[^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/pt.xliff b/i18n/pt.xliff index 532eeeb..e46c41f 100644 --- a/i18n/pt.xliff +++ b/i18n/pt.xliff @@ -95,8 +95,8 @@ [^"]+)"$/]]> - (?:[^"]|\\")*)"$/]]> - (?:[^"]|\\")*)"$/]]> + "(?:[^"]|\\")*")$/]]> + "(?:[^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/ru.xliff b/i18n/ru.xliff index cc5102c..cf102cb 100644 --- a/i18n/ru.xliff +++ b/i18n/ru.xliff @@ -108,7 +108,7 @@ "([^"]|\\")*")$/]]> - (?:[^"]|\\")*)"$/]]> + "(?:[^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/sv.xliff b/i18n/sv.xliff index c2b0ba5..d3c60b8 100644 --- a/i18n/sv.xliff +++ b/i18n/sv.xliff @@ -95,8 +95,8 @@ [^"]+)"$/]]> - (?:[^"]|\\")*)"$/]]> - (?:[^"]|\\")*)"$/]]> + "(?:[^"]|\\")*")$/]]> + "(?:[^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> From 1f839e297a5a36e8064f60634065af3a44b4527d Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 11 May 2012 22:19:15 +0200 Subject: [PATCH 3/4] Added missing sentences in the french translation --- i18n/fr.xliff | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/i18n/fr.xliff b/i18n/fr.xliff index 8cc6f4e..e99848e 100644 --- a/i18n/fr.xliff +++ b/i18n/fr.xliff @@ -66,6 +66,14 @@ (?:[^"]|\\")*)"$/]]> (?:[^"]|\\")*)"$/]]> + + "(?:[^"]|\\")*")$/]]> + "(?:[^"]|\\")*")$/]]> + + + "(?:[^"]|\\")*")$/]]> + "(?:[^"]|\\")*")$/]]> + (?:[^"]|\\")*)"$/]]> (?:[^"]|\\")*)"$/]]> From bab40334b62cbf818122e6993d3f7ae505d19a2d Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 11 May 2012 22:22:47 +0200 Subject: [PATCH 4/4] Another run of fixes (this time, the pattern is the same than the step) --- i18n/cs.xliff | 4 ++-- i18n/de.xliff | 4 ++-- i18n/es.xliff | 4 ++-- i18n/fr.xliff | 4 ++-- i18n/nl.xliff | 4 ++-- i18n/pl.xliff | 4 ++-- i18n/pt.xliff | 4 ++-- i18n/ru.xliff | 2 +- i18n/sv.xliff | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/i18n/cs.xliff b/i18n/cs.xliff index 74ec33a..cb8d58c 100644 --- a/i18n/cs.xliff +++ b/i18n/cs.xliff @@ -99,8 +99,8 @@ [^"]+)"$/]]> - "(?:[^"]|\\")*")$/]]> - "(?:[^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/de.xliff b/i18n/de.xliff index 82876d0..4979456 100644 --- a/i18n/de.xliff +++ b/i18n/de.xliff @@ -99,8 +99,8 @@ [^"]+)" sein$/]]> - "(?:[^"]|\\")*")$/]]> - "(?:[^"]|\\")*") übereinstimmen$/]]> + "([^"]|\\")*")$/]]> + "([^"]|\\")*") übereinstimmen$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/es.xliff b/i18n/es.xliff index 3df4ab1..cb07774 100644 --- a/i18n/es.xliff +++ b/i18n/es.xliff @@ -99,8 +99,8 @@ [^"]+)"$/]]> - "(?:[^"]|\\")*")$/]]> - "(?:[^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/fr.xliff b/i18n/fr.xliff index e99848e..b3a1d3b 100644 --- a/i18n/fr.xliff +++ b/i18n/fr.xliff @@ -107,8 +107,8 @@ [^"]+)"$/]]> - "(?:[^"]|\\")*")$/]]> - "(?:[^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/nl.xliff b/i18n/nl.xliff index 2c7cf30..9b1c193 100644 --- a/i18n/nl.xliff +++ b/i18n/nl.xliff @@ -95,8 +95,8 @@ [^"]+)" zijn$/]]> - "(?:[^"]|\\")*")$/]]> - "(?:[^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/pl.xliff b/i18n/pl.xliff index 8ba30cc..38b3332 100644 --- a/i18n/pl.xliff +++ b/i18n/pl.xliff @@ -99,8 +99,8 @@ [^"]+)"$/]]> - "(?:[^"]|\\")*")$/]]> - "(?:[^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/pt.xliff b/i18n/pt.xliff index e46c41f..558e5b6 100644 --- a/i18n/pt.xliff +++ b/i18n/pt.xliff @@ -95,8 +95,8 @@ [^"]+)"$/]]> - "(?:[^"]|\\")*")$/]]> - "(?:[^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/ru.xliff b/i18n/ru.xliff index cf102cb..528af9c 100644 --- a/i18n/ru.xliff +++ b/i18n/ru.xliff @@ -108,7 +108,7 @@ "([^"]|\\")*")$/]]> - "(?:[^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]> diff --git a/i18n/sv.xliff b/i18n/sv.xliff index d3c60b8..d73bc53 100644 --- a/i18n/sv.xliff +++ b/i18n/sv.xliff @@ -95,8 +95,8 @@ [^"]+)"$/]]> - "(?:[^"]|\\")*")$/]]> - "(?:[^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> + "([^"]|\\")*")$/]]> [^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/]]>