You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "gyli (via GitHub)" <gi...@apache.org> on 2026/09/15 16:05:42 UTC

[PR] Exclude Chinese locale files from replace-bad-characters check [airflow]

gyli opened a new pull request, #73200:
URL: https://github.com/apache/airflow/pull/73200

   The `replace-bad-characters` pre-commit hook rewrites `“` (U+201C) and `”` (U+201D)
   to straight `"` quotes. Those code points are not only English "smart quotes" — they
   are also the full-width quotation marks that Chinese prose uses to quote English
   terms. The hook therefore silently corrupts Chinese translations:
   
   ```
   "“DAG” 是任务的集合"   ->   ""DAG" 是任务的集合"
   ```
   
   This blocks translators from using correct Chinese punctuation. It came up in
   #73113, which fills in the missing zh-CN translations and wants full-width
   quotation marks when quoting English text inside Chinese prose.
   
   The hook's replacement list is global with no per-character allowlist, so the
   available lever is the path `exclude`. This adds the `zh-` locale prefix, covering
   both `zh-CN` and `zh-TW` (and any future Chinese locale) with one entry.
   
   The substitution stays in force everywhere else — including every other locale and
   all source code — where curly quotes are genuinely unwanted.
   
   ### Scope note
   
   The exclude also exempts these files from the hook's other replacements (tab → 4
   spaces, `&nbsp;` → space). That is harmless for these JSON translation files, which
   are formatted by prettier. A narrower alternative would be to teach the script to
   skip only the quote substitutions for locale paths, but that pushes locale-specific
   knowledge into a generic script; happy to switch if reviewers prefer that.
   
   related: #73113
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Exclude Chinese locale files from replace-bad-characters check [airflow]

Posted by "gyli (via GitHub)" <gi...@apache.org>.
gyli commented on code in PR #73200:
URL: https://github.com/apache/airflow/pull/73200#discussion_r4050060536


##########
.pre-commit-config.yaml:
##########
@@ -657,7 +657,8 @@ repos:
           ^providers/edge3/src/airflow/providers/edge3/plugins/www/openapi-gen/|
           .*/dist/.*|
           \.go$|
-          /go\.(mod|sum)$
+          /go\.(mod|sum)$|
+          ^airflow-core/src/airflow/ui/public/i18n/locales/zh-

Review Comment:
   cc de: @jscheffl, fr: @pierrejeambrun @vincbeck, pl: @potiuk @mobuchowski



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Exclude Chinese locale files from replace-bad-characters check [airflow]

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #73200:
URL: https://github.com/apache/airflow/pull/73200#issuecomment-5695453634

   I kinda don't like “. I think `\"` actually works ok. no super strong opinion. @jason810496 thoughts?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Exclude Chinese locale files from replace-bad-characters check [airflow]

Posted by "Andrushika (via GitHub)" <gi...@apache.org>.
Andrushika commented on code in PR #73200:
URL: https://github.com/apache/airflow/pull/73200#discussion_r4022287670


##########
.pre-commit-config.yaml:
##########
@@ -657,7 +657,8 @@ repos:
           ^providers/edge3/src/airflow/providers/edge3/plugins/www/openapi-gen/|
           .*/dist/.*|
           \.go$|
-          /go\.(mod|sum)$
+          /go\.(mod|sum)$|
+          ^airflow-core/src/airflow/ui/public/i18n/locales/zh-

Review Comment:
   The same characters are also used in Polish, French, German etc. (`”` in Polish, `“` in German, `’` in French)
   How about excluding all translation files except english?
   ```suggestion
             ^airflow-core/src/airflow/ui/public/i18n/locales/(?!en/).+/
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Exclude Chinese locale files from replace-bad-characters check [airflow]

Posted by "gyli (via GitHub)" <gi...@apache.org>.
gyli commented on PR #73200:
URL: https://github.com/apache/airflow/pull/73200#issuecomment-5683690432

   cc @Lee-W 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org