This is an automated email from the ASF dual-hosted git repository.
shahar1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new a4d56b4dce8 Ignore hidden directories when listing UI translation
locales (#70516)
a4d56b4dce8 is described below
commit a4d56b4dce8bcd660121e76b8000d791061bb16c
Author: Jarek Potiuk <[email protected]>
AuthorDate: Mon Jul 27 13:52:34 2026 +0200
Ignore hidden directories when listing UI translation locales (#70516)
Agent and editor tooling leaves dot-directories (e.g. a stray .claude/
scratch dir) inside the i18n locales folder. Every subdirectory was
treated as a locale, so all breeze ui translation commands aborted with
a confusing "No plural suffixes defined for language '.claude'" error
that gives no hint the directory is not a locale at all.
---
dev/breeze/src/airflow_breeze/commands/ui_commands.py | 2 +-
dev/breeze/tests/test_ui_commands.py | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/dev/breeze/src/airflow_breeze/commands/ui_commands.py
b/dev/breeze/src/airflow_breeze/commands/ui_commands.py
index 5ca44c68632..983b31b8160 100644
--- a/dev/breeze/src/airflow_breeze/commands/ui_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/ui_commands.py
@@ -191,7 +191,7 @@ def get_locale_files() -> list[LocaleFiles]:
locale=locale_dir.name, files=[f.name for f in
locale_dir.iterdir() if f.suffix == ".json"]
)
for locale_dir in LOCALES_DIR.iterdir()
- if locale_dir.is_dir()
+ if locale_dir.is_dir() and not locale_dir.name.startswith(".")
]
diff --git a/dev/breeze/tests/test_ui_commands.py
b/dev/breeze/tests/test_ui_commands.py
index 705828ac3a1..4287247e7e7 100644
--- a/dev/breeze/tests/test_ui_commands.py
+++ b/dev/breeze/tests/test_ui_commands.py
@@ -25,6 +25,7 @@ from airflow_breeze.commands.ui_commands import (
compare_keys,
expand_plural_keys,
flatten_keys,
+ get_locale_files,
get_plural_base,
)
@@ -277,6 +278,22 @@ class TestCompareKeys:
ui_commands.LOCALES_DIR = original_locales_dir
+class TestGetLocaleFiles:
+ def test_hidden_directories_are_not_treated_as_locales(self, tmp_path):
+ (tmp_path / "en").mkdir()
+ (tmp_path / "en" / "common.json").write_text(json.dumps({"greeting":
"Hello"}))
+ (tmp_path / ".claude" / ".cc-writes").mkdir(parents=True)
+
+ import airflow_breeze.commands.ui_commands as ui_commands
+
+ original_locales_dir = ui_commands.LOCALES_DIR
+ ui_commands.LOCALES_DIR = tmp_path
+ try:
+ assert get_locale_files() == [LocaleFiles(locale="en",
files=["common.json"])]
+ finally:
+ ui_commands.LOCALES_DIR = original_locales_dir
+
+
class TestLocaleSummary:
def test_locale_summary_creation(self):
summary = LocaleSummary(