diff --git a/.gitignore b/.gitignore index b4a772551..903f36f41 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ packages/ build/* !build/build.cake !build/build*.nuspec +!build/create_lang_nuspec_file.py !build/build.ps1 !build/LICENSE !build/icon.png diff --git a/build/build.Lang.template.nuspec b/build/build.Lang.template.nuspec new file mode 100644 index 000000000..15777b68a --- /dev/null +++ b/build/build.Lang.template.nuspec @@ -0,0 +1,59 @@ + + + + HandyControl.Lang.{lang} + 3.5.0 + HandyOrg + HandyOrg + HandyOrg + true + LICENSE + icon.png + https://github.com/HandyOrg/HandyControl + Contains some simple and commonly used WPF controls + Changes are detailed at https://github.com/HandyOrg/HandyControl/releases + Copyright © HandyOrg 2018-2023 + WPF C# Control + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/create_lang_nuspec_file.py b/build/create_lang_nuspec_file.py new file mode 100644 index 000000000..d8c50ea06 --- /dev/null +++ b/build/create_lang_nuspec_file.py @@ -0,0 +1,15 @@ +from pathlib import Path + + +def main(): + with open('build.Lang.template.nuspec', '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()