Commit graph

55 commits

Author SHA1 Message Date
Andy Allan
d58cae6ff6 Avoid using the zero key for pluralisation in English
This makes it impossible to translate to other languages that use the
`zero:` key, e.g. for other numbers that end in zero.

An alternative approach would be possible in future, when ruby-i18n
and rails and translatewiki all have full support for `0:` and `1:` keys.

Fixes #3997
2023-07-05 14:47:39 +01:00
Andy Allan
387d130e87 Add some validations for i18n values
These only apply to the en.yml file for now, but can be expanded
in due course.
2023-04-12 13:58:55 +01:00
Andy Allan
4af923dbf9 Ensure kramdown table alignment styles are converted to bootstrap classes
Adds tests for commit f42a7a2d8d
2023-02-22 09:46:52 +00:00
Tom Hughes
6033359bd0 Preserve rel=me on links in rich text
Fixes #3859
2022-12-29 18:02:23 +00:00
Andy Allan
4ab134d869 Use fallbacks for OCI resource names
This uses the fallbacks for OCI translations. For example, if a
local chapter doesn't have an explicitly translated name, it will
use a template for osm-lc resources and fill in the appropriate
translated community name.

Fixes #3814
2022-12-14 14:54:01 +00:00
Andy Allan
af6fec502a Validate URLs against supply-chain attacks
Unfortunately validates_url gem doesn't support mailto or xmpp urls,
so we need to write our own validation.
2022-11-02 18:21:00 +00:00
Andy Allan
561ee71129 Rubocop autofix: ambiguous operator precedence
This simply adds braces to clarify which mathematical operator comes
first.
2022-04-06 14:55:29 +01:00
Tom Hughes
03cad948e3 Fix new rubocop warnings 2022-03-15 19:24:09 +00:00
Tom Hughes
aad81eb74c Switch to Argon2 for password hashing 2021-11-03 20:39:31 +00:00
Andy Allan
37b03e47c6 Fix various code comments
These were found as part of #3233
2021-07-21 11:24:23 +01:00
Andy Allan
bb2afc3e8b Prevent addition of style attributes to all elements 2021-03-24 20:55:30 +00:00
Andy Allan
d7eac9b5a8 Strip away class attributes from sanitized outputs
There's a lot of shenanigans that are possible when you can apply
arbitrary classes to the rendered output.
2021-03-24 19:15:21 +00:00
Andy Allan
5d39bf8491 Add tests for richtext table classes 2021-03-24 17:55:15 +00:00
Tom Hughes
3512d6303c Fix new rubocop warnings 2021-03-23 19:48:13 +00:00
Andy Allan
2519841efe Return the centre of the image if the bbox has no extent
Fixes #3007. If all the provided points in the gpx file have the same
lat/lon, then an image where they are all at the centre seems plausible.
2020-12-23 15:01:01 +00:00
Andy Allan
c04d05686f Resolve some extra-long lines 2020-10-28 11:07:34 +01:00
Tom Hughes
e72092161b Update test results for presence of zh-HK translations 2020-10-19 19:26:17 +01:00
Tom Hughes
ea59d95f4a Fix some new rubocop warnings 2020-08-06 22:27:30 +01:00
Tom Hughes
0e2a66e8de Fix new rubocop warnings 2020-08-06 18:42:16 +01:00
Tom Hughes
2d3972249c Fix some rubocop todos 2020-08-02 19:38:58 +01:00
Tom Hughes
a221aabe3c Check that pluralizable translations have an "other" key 2020-06-11 19:21:41 +01:00
Tom Hughes
bf22c69286 Improve locale selection algorithm
Don't include locales which only have rails translations in
the candidates, and ensure that user specified options take
priority over less specific variants of earlier choices.
2020-06-04 17:33:11 +01:00
Tom Hughes
ef147d479e Fix new rubocop warnings 2020-04-19 19:06:07 +01:00
Tom Hughes
7a1615bc55 Fix rubocop-minitest warnings 2020-04-15 19:07:13 +01:00
Andreas Geyer-Schulz
f6f23ed0ee
Fix typo: change 'noreferer' to 'noreferrer'
as the correct rel attribute in external links.
2020-01-25 20:10:23 +01:00
Tom Hughes
4ee60c0f8f Make all translation lookup errors throw exceptions in test mode 2019-12-16 21:54:11 +00:00
Tom Hughes
4b646e17a8 Fix rubocop warnings 2019-08-14 19:27:02 +01:00
Tom Hughes
df232ec96f Add noopener and noreferer to links in user generated content 2019-01-16 10:10:51 +00:00
Wil
1d2a3841ab Resolve 34 Rubocop Lint/AmbiguousOperator conflicts 2018-09-10 11:43:50 +08:00
Tom Hughes
f7a35c5895 Fix new rubocop warnings 2018-06-18 09:00:49 +01:00
Benjamin Reynolds
d5672aed4a Remove quad_tile library and extract to gem
Quad tile functions are now installed via a gem with native extension
automatically. This improves the run time of the test suite by ~30% for
users that didn't bother to build the C version of the functions.

Closes #1314
Closes #1899
2018-06-14 18:29:37 +01:00
Tom Hughes
43edc68ec7 Add tests for quad tiles 2018-02-04 17:33:44 +00:00
Tom Hughes
a83030dab7 Fix new rubocop warnings 2018-01-22 18:55:45 +00:00
Tom Hughes
b6b9d543ac Fix rubocop warnings 2017-10-29 19:43:02 +00:00
Tom Hughes
8dae890a76 Fix rubocop warnings 2017-10-05 19:18:38 +01:00
Andy Allan
396f2e28dd Rework coordinates to avoid scientific formatting of small numbers. Fixes #1509 2017-06-23 14:03:57 +01:00
Tom Hughes
b00b9ce626 Remove arguments from assert_nothing_raised
It has never done anything with the argument and rails 5.0 warns
that rails 5.1 will remove the argument.
2017-06-02 16:33:34 +01:00
Tom Hughes
5b33f3f8e3 Fix rubocop warnings 2017-06-02 00:08:30 +01:00
Tom Hughes
b9b255fa65 Work around upcoming minitest insanity
Minitest 6 will not allow assert_equal to compare for equality
with nil and minitest 5 has already started warning about it.

That's fine if you're comparing with a nil constant, but if you're
comparing with an expression that is sometimes nil and sometimes
not nil it's an absolute pain in the rear end.
2016-12-02 22:29:44 +00:00
Tom Hughes
44e778aedd Increase password stretching to 10000 interations
This is in line with current reccomendations from various sources.
2016-11-25 08:54:57 +00:00
Tom Hughes
9d106676b8 Replace quova with support for local Maxmind GeoIP lookups 2016-10-20 21:40:03 +01:00
Tom Hughes
5f4dcd34ff Fix some rubocop warnings 2016-09-15 22:41:07 +01:00
Tom Hughes
dd8ebf9b09 Fix rubocop warnings 2016-07-13 09:50:23 +01:00
Tom Hughes
5fd4fd13c2 Update to rails 4.2.7 2016-07-13 09:14:01 +01:00
Tom Hughes
1aff968589 Add some tests for the locale library 2016-01-07 18:45:18 +00:00
Tom Hughes
c9d35839be Fix new rubocopy warnings 2015-08-18 20:57:14 +01:00
Tom Hughes
f04211b172 Improve test coverage 2015-02-27 00:40:37 +00:00
Tom Hughes
dc2a2c8ebd Standardise on double quoted strings 2015-02-20 19:47:26 +00:00
Tom Hughes
5cbd4038ed Fix rubocop style issues 2015-02-20 08:56:16 +00:00
Tom Hughes
baf10cd392 Fix rubocop lint issues 2015-02-20 08:56:16 +00:00