HandyControl/build/create_lang_nuspec_file.py
2024-02-07 18:01:35 +08:00

16 lines
534 B
Python

from pathlib import Path
def main():
with open('build.Lang.template', 'r', encoding='utf-8') as template_file:
template_content = template_file.read()
resx_file_folder = Path('../src/Shared/HandyControl_Shared/Properties/Langs')
for lang in [path.stem.lstrip('Lang.') for path in resx_file_folder.glob('Lang.*.resx')]:
with open(f'build.Lang.{lang}.nuspec', 'w', encoding='utf-8') as nuspec_file:
nuspec_file.write(template_content.format(lang=lang))
if __name__ == '__main__':
main()