public static async Task GenerateResxAsync(string projectFolder, FileInfo fileInfo,
                                                   CancellationToken cancellationToken = default)
        {
            var inputLocalizationFile = new LocalizationFile();

            await inputLocalizationFile.LoadAsync(fileInfo, cancellationToken);

            // inputLocalizationFile.BuildBinaryResource();
            var resxFileName = await inputLocalizationFile.BuildResxAsync(cancellationToken);

            var designerFileName = inputLocalizationFile.BuildResxDesigner();

            await inputLocalizationFile.AddResourceToProject(projectFolder, resxFileName, designerFileName, cancellationToken);
        }
Example #2
0
        static void Main(string[] args)
        {
            InitConfiguration(args);

            if (!Directory.Exists(Configuration[CommandLineArgs.Source]))
            {
                throw new ArgumentException($"Folder doesn't exist: `{Configuration[CommandLineArgs.Source]}`");
            }

            var localizationFiles = FindLocalizationFiles(Configuration[CommandLineArgs.Source]);

            Task.WaitAll(
                localizationFiles.Select(localizationFile => LocalizationFile.GenerateResxAsync(
                                             Configuration[CommandLineArgs.Source]
                                             , localizationFile
                                             , CancellationToken.None)).ToArray()
                );
        }