[openstreetmap/openstreetmap-website] Add some validations for i18n values (PR #4007)
Andy Allan
notifications at github.com
Wed Apr 12 13:03:48 UTC 2023
These only apply to the en.yml file for now, but can be expanded in due course.
I had a long search for any third-party utilities that could do this for us, but I didn't find anything appropriate. None of the generic yaml validators that I found allowed custom validations of values (most were just focussed on validating the type of the value, int/string/hash etc against a fixed schema). I also checked for any i18n-specific validators, but again I didn't find any that could validate the values.
I expect to expand these checks to cover the rest of the translations, but there are currently a bunch of translations in the output that contain html elements (that aren't included in en.yml, which is interesting). I also expect to expand these check to add more validations, perhaps validating urls point to the same domain, and things like that.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/4007
-- Commit Summary --
* Add some validations for i18n values
-- File Changes --
M test/lib/i18n_test.rb (35)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/4007.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4007.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4007
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4007 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230412/698e392b/attachment.htm>
More information about the rails-dev
mailing list