# frozen_string_literal: true # 번역 키를 그대로 출력하는 보드 메뉴 제목 두 곳만 바꿉니다. # 원본 구조가 바뀌면 전체 파일을 덮어쓰지 않고 중단해 다른 수정 사항을 보존합니다. root = ENV.fetch("DISCOURSE_ROOT", "/var/www/discourse") targets = { "boards-board-viewer.gjs" => ["boards.board.controls", "보드 메뉴"], "boards-column.gjs" => ["boards.board.column_controls", "열 메뉴"], } targets.each do |file, (key, title)| path = File.join(root, "plugins/boards/assets/javascripts/discourse/components", file) next unless File.exist?(path) original = File.read(path) needle = "@title=\"#{key}\"" replacement = "@title=\"#{title}\"" next if original.include?(replacement) abort "보드 원본 구조가 달라졌습니다: #{file}" unless original.scan(needle).size == 1 File.write(path, original.sub(needle, replacement)) end puts "보드 메뉴 한국어 제목 확인 완료"