js.composer.error.post_length 텍스트를 업데이트할 수 없음

js.composer.error.post_length 텍스트를 업데이트하려고 합니다. 프로덕션, 스테이징 및 로컬 환경에서 2.9 및 3.1.0.beta2 버전을 사용 중이며 이 문제를 겪고 있습니다.

값이 설정되어 있음에도 불구하고 FE(프론트엔드)에는 [missing {{min}} value]라고 표시됩니다.

오류 로그에는 다음과 같이 표시됩니다:

NoMethodError (undefined method `scan' for {:one=>"Post must be at least %{count} character", :other=>"Post must be at least %{count} characters"}:Hash keys = text.scan(pattern) ^^
Message

NoMethodError (undefined method `scan' for {:one=>"Post must be at least %{count} character", :other=>"Post must be at least %{count} characters"}:Hash

    keys = text.scan(pattern)
               ^^^^^)
lib/i18n/i18n_interpolation_keys_finder.rb:6:in `find'
app/models/translation_override.rb:123:in `check_interpolation_keys'
app/models/translation_override.rb:64:in `upsert!'
app/controllers/admin/site_texts_controller.rb:88:in `update'
app/controllers/application_controller.rb:414:in `block in with_resolved_locale'
app/controllers/application_controller.rb:414:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/missing_avatars.rb:22:in `call'
lib/middleware/turbo_dev.rb:31:in `call'

Backtrace

lib/i18n/i18n_interpolation_keys_finder.rb:6:in `find'
app/models/translation_override.rb:123:in `check_interpolation_keys'
activesupport (7.0.4) lib/active_support/callbacks.rb:400:in `block in make_lambda'
activesupport (7.0.4) lib/active_support/callbacks.rb:199:in `block (2 levels) in halting'
activesupport (7.0.4) lib/active_support/callbacks.rb:687:in `block (2 levels) in default_terminator'
activesupport (7.0.4) lib/active_support/callbacks.rb:686:in `catch'
activesupport (7.0.4) lib/active_support/callbacks.rb:686:in `block in default_terminator'
activesupport (7.0.4) lib/active_support/callbacks.rb:200:in `block in halting'
activesupport (7.0.4) lib/active_support/callbacks.rb:595:in `block in invoke_before'
activesupport (7.0.4) lib/active_support/callbacks.rb:595:in `each'

Env

HTTP HOSTS: 127.0.0.1:3000

해당 문자열은 2021년에 변경되었습니다. 이제 %{min} 대신 %{count}를 사용하며, 복수형 문자열(one, other)로 변환되었습니다.

커스터마이징된 문자열은 다음과 같이 수정할 수 있습니다:

  • “js.composer.error.post_length” 검색
  • “편집” 클릭
  • "변경 사항 되돌리기"를 클릭하고 "예"로 확인
  • “검색으로 돌아가기” 클릭
  • “js.composer.error.post_length” 검색
  • 2개의 결과가 표시됩니다. 원하시는 경우 두 문자열 모두 커스터마이징하세요

이런 경우를 위해 영어로 폴백하는 에러 처리를 만들고 로그를 남기면 어떨까?

알 수 없는 이유로 이 문제를 해결하지 못했는데, JS 오류 'get_attributes’로 인해 확인 대화상자가 열리지 않았습니다. 다이얼로그 요소가 null이었거든요.

그런데 나중에 안전 모드를 켜서 작동하는지 확인해보니 모든 것이 자동으로 업데이트되었습니다. 안전 모드를 끄고 제 테마로 돌아가자 이번에는 모든 것이 의도대로 작동했습니다.

아마 안전 모드가 문제를 해결한 것 같습니다. 그리고 위에서 언급한 JS 오류도 더 이상 발생하지 않습니다. (처음부터 안전 모드를 시도해봤어야 했는데, 제 실수네요).

도움 주셔서 감사합니다!