Skip to content

Commit 4e9827c

Browse files
committed
Renamed script_dir to lib_dir ↞ [auto-sync from https://github.com/adamlui/python-utils/tree/main/translate-messages]
1 parent 2ecf65b commit 4e9827c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

translate-messages/lib/init.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def cli(caller_file):
66

77
cli = sns(
88
name='translate-messages',
9-
version='2026.2.10.53',
9+
version='2026.2.10.54',
1010
author=sns(name='Adam Lui', email='adam@kudoa.com', url='https://github.com/adamlui'),
1111
description='Translate en/messages.json to other locales',
1212
urls=sns(
@@ -73,13 +73,13 @@ def config_file(cli):
7373
print(f'Default config created at {cli.config_path}')
7474

7575
def locales_dir(locales_dir):
76-
script_dir = os.path.abspath(os.path.dirname(__file__))
77-
for root, dirs, files in os.walk(script_dir): # search script dir recursively
76+
lib_dir = os.path.abspath(os.path.dirname(__file__))
77+
for root, dirs, files in os.walk(lib_dir): # search lib dir recursively
7878
if locales_dir in dirs:
7979
locales_dir = os.path.join(root, locales_dir) ; break
80-
else: # search script parent dirs recursively
81-
parent_dir = os.path.dirname(script_dir)
82-
while parent_dir and parent_dir != script_dir:
80+
else: # search lib parent dirs recursively
81+
parent_dir = os.path.dirname(lib_dir)
82+
while parent_dir and parent_dir != lib_dir:
8383
for root, dirs, files in os.walk(parent_dir):
8484
if locales_dir in dirs:
8585
locales_dir = os.path.join(root, locales_dir) ; break

0 commit comments

Comments
 (0)