[openstreetmap/openstreetmap-website] Add some validations for i18n values (PR #4007)

Andy Allan notifications at github.com
Wed Apr 12 13:30:47 UTC 2023


@gravitystorm commented on this pull request.



> @@ -55,6 +55,20 @@ class I18nTest < ActiveSupport::TestCase
     end
   end
 
+  def test_en_for_raw_html
+    en = YAML.load_file(Rails.root.join("config/locales/en.yml"))
+    assert_nothing_raised do
+      check_values_for_raw_html(en)
+    end
+  end
+
+  def test_en_for_nil_values

I had a `nil` value in the branch I was working on when developing this PR, due to some fat fingering in a different commit. I had left a key with nothing after the colon while refactoring.

The `nil` value didn't make it past any pull review (I fixed it before submitting that other PR), so it's slightly hypothetical. But it did cause the other test to error out, so I thought it might be worth adding separately, so that you get a clean error message.

I'm happy to remove it if you think it's unnecessary or potentially confusing.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4007#discussion_r1164140584
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4007/review/1381328182 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230412/7db22aa5/attachment.htm>


More information about the rails-dev mailing list