File tree Expand file tree Collapse file tree
translate-messages/src/translate_messages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ def main():
1010 if not cli .config .no_wizard : wizard .run (cli )
1111
1212 log .info (f'{ cli .msgs .log_SEARCHING_FOR } { cli .config .locales_dir } ...' )
13- init .locales_dir (cli )
14- if Path (cli .config . locales_dir ).exists ():
13+ init .locales_path (cli )
14+ if Path (cli .locales_path ).exists ():
1515 log .success (f'{ cli .msgs .log_DIR_FOUND } !' )
16- print (f'\n >> { cli .config . locales_dir } ' )
16+ print (f'\n >> { cli .locales_path } ' )
1717 else :
1818 log .warn (f'{ cli .msgs .warn_DIR_NOT_FOUND } .' )
1919 sys .exit (1 )
Original file line number Diff line number Diff line change @@ -58,16 +58,15 @@ def config_filepath(cli): # for settings.load()
5858 cli .config_filepath = possible_config_file
5959 return
6060
61- def locales_dir (cli ):
61+ def locales_path (cli ):
6262 for path in Path .cwd ().rglob (cli .config .locales_dir ):
6363 if path .is_dir ():
64- cli .config . locales_dir = str (path )
64+ cli .locales_path = Path (path )
6565 return
66- cli .config . locales_dir = ''
66+ cli .locales_path = None
6767
6868def src_msgs (cli ):
6969 cli .msgs_filename = 'messages.json'
70- cli .locales_path = Path (cli .config .locales_dir )
7170 cli .en_path = cli .locales_path / 'en' / cli .msgs_filename
7271 if not cli .en_path .exists ():
7372 log .error (f'{ cli .msgs .err_EN_LOC_NOT_FOUND_AT } { cli .en_path } .' )
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ def write_translations(cli):
5757 sep_idx = lang_folder .index ('_' )
5858 lang_folder = f'{ lang_folder [:sep_idx ]} _{ lang_folder [sep_idx + 1 :].upper ()} '
5959
60- lang_folder_path = Path ( cli .config . locales_dir ) / lang_folder
60+ lang_folder_path = cli .locales_path / lang_folder
6161 msgs_path = lang_folder_path / cli .msgs_filename
6262 if msgs_path .exists ():
6363 msgs = data .json .read (msgs_path )
You can’t perform that action at this time.
0 commit comments