Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitadf715c

Browse files
committed
Forbid initializing existent po
1 parenta809821 commitadf715c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎babel_runner.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_project_info() -> dict:
2929

3030

3131
defextract_messages():
32-
"""Extract messages from all source files intotemplate file"""
32+
"""Extract messages from all source files intomessage catalog template"""
3333
os.makedirs(LOCALES_DIR,exist_ok=True)
3434
project_data=get_project_info()
3535
subprocess.run(
@@ -55,7 +55,11 @@ def extract_messages():
5555

5656

5757
definit_locale(locale:str):
58-
"""Initialize a new locale based on existing"""
58+
"""Initialize a new locale based on existing message catalog template"""
59+
pofile=os.path.join(LOCALES_DIR,locale,"LC_MESSAGES",f"{DOMAIN}.po")
60+
ifos.path.exists(pofile):
61+
print(f"There is already a message catalog for locale{locale}, skipping.")
62+
return
5963
cmd= ["pybabel","init","-i",POT_FILE,"-d",LOCALES_DIR,"-l",locale]
6064
subprocess.run(cmd,check=True)
6165

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp