0
0
Fork 0

Fix incorrect serialization of regional languages in contentMap (#27207)

This commit is contained in:
Claire 2023-10-06 17:46:04 +02:00 committed by GitHub
parent 3171afc36a
commit 3262d1f1b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -14,6 +14,8 @@ module ActivityPub::CaseTransform
when String
camel_lower_cache[value] ||= if value.start_with?('_:')
"_:#{value.delete_prefix('_:').underscore.camelize(:lower)}"
elsif LanguagesHelper::ISO_639_1_REGIONAL.key?(value.to_sym)
value
else
value.underscore.camelize(:lower)
end