From 3845d36eed7c94a8a53e5eaaed722ef3ef0f901f Mon Sep 17 00:00:00 2001 From: Masaki Hara Date: Mon, 15 Jun 2020 16:18:43 +0900 Subject: [PATCH] Conform to YAML spec where flow indicators can't be in shorthand tags --- doc/tags.md | 6 +++--- spec/lib/i18n_flow/validator/symmetry_spec.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/tags.md b/doc/tags.md index 89b2f59..9084768 100644 --- a/doc/tags.md +++ b/doc/tags.md @@ -172,7 +172,7 @@ Linter won't complain about `ja.desc` ------------- It's similar to `!only`, but is stricter. -It can take comma-separated locales as a parameter just like `!only:en` or `!only:en,ja,zh-HK`, and ensures that a key only exists in files of the specified locales. +It can take comma-separated locales as a parameter just like `!only:en` or `!`, and ensures that a key only exists in files of the specified locales. @@ -235,7 +235,7 @@ Linter will complain about `en.desc`, because the key is supposed to exist only ```yaml en: title: 'Non zero sum' - desc: !only:en,ja 'A situation in...' + desc: ! 'A situation in...' ```
@@ -261,7 +261,7 @@ The key can exist in the specified locales `en,ja` ```yaml en: title: 'Non zero sum' - desc: !only:en,ja 'A situation in...' + desc: ! 'A situation in...' ``` diff --git a/spec/lib/i18n_flow/validator/symmetry_spec.rb b/spec/lib/i18n_flow/validator/symmetry_spec.rb index 7fc17e0..619060b 100644 --- a/spec/lib/i18n_flow/validator/symmetry_spec.rb +++ b/spec/lib/i18n_flow/validator/symmetry_spec.rb @@ -252,12 +252,12 @@ ast_1 = parse_yaml(<<-YAML)['en'] en: key_1: text_1 - key_2: !only:en,ja text_2 + key_2: ! text_2 YAML ast_2 = parse_yaml(<<-YAML)['ja'] ja: key_1: text_1 - key_2: !only:en,ja text_2 + key_2: ! text_2 YAML allow(validator).to receive(:ast_1).and_return(ast_1)