Skip to content

Draft: Remove useless patch code of po_to_json

路志远请求将remove-code-of-po-to-json合并到main-jh

What does this MR do and why?

Related issue: #2948 (closed)

What

Delete useless code below because they are not used anywhere anymore.

  • Gitlab::Patch::GettextI18nRailsJsTask
  • Gitlab::Patch::PoToJson

Why

These "Patch" codes were previously used in the rake gettext:po_to_json command to generate the required front-end i18n file, such as app/assets/javascripts/locale/en/app.js.

The po_to_json command is now deprecated and replaced by bin/rake gettext:compile (See Upstream MR).

Screenshots or screen recordings

No UI changes.

How to set up and validate locally

Verify these commands work correctly: bin/rake jh:gettext:regenerate and bin/rake gettext:compile

  1. bin/rake gettext:compile

    # Delete `app.js` file
    $ rm app/assets/javascripts/locale/en/app.js
    
    # Execute compile command
    $ bin/rake gettext:compile
    
    # Expect `app.js` to be regenerated
    $ ls app/assets/javascripts/locale/en/app.js
  2. bin/rake jh:gettext:regenerate

    $ old_i18n_string="JH|VulnerabilityExports|Tool"
    $ new_i18n_string="JH|VulnerabilityExports|Tooooool"
    $ filename="jh/app/services/jh/vulnerability_exports/exporters/csv_service.rb"
    
    $ sed -i '' "s/$old_i18n_string/$new_i18n_string/g" $filename
    
    # Expect the `gitlab.po` file to be updated
    $ bin/rake jh:gettext:regenerate

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

路志远 编辑于

合并请求报告

加载中