In source code at line platform/core/base/src/Services/DownloadLocaleService.php:56
if (File::isDirectory(lang_path('vendor/themes'))) {
File::deleteDirectory(lang_path('vendor/themes'));
}
I see this code as redundant, because a script at platform/core/base/src/Services/DeleteUnusedTranslationFilesService.php:16 it removed non-existent theme translations.
if (File::isDirectory(lang_path('vendor/themes'))) {
foreach (BaseHelper::scanFolder(lang_path('vendor/themes')) as $theme) {
if (! File::isDirectory(theme_path($theme))) {
File::deleteDirectory(lang_path('vendor/themes/' . $theme));
}
}
}
Could you explain why the script at platform/core/base/src/Services/DownloadLocaleService.php:56 needs to delete the directory, considering that the script at platform/core/base/src/Services/DeleteUnusedTranslationFilesService.php:16 already handles the removal of unused translations?
Additionally, when the script at platform/core/base/src/Services/DownloadLocaleService.php:56 is executed, it will trigger the copy script at line platform/core/base/src/Services/DownloadLocaleService.php:70.
if (File::exists("{$path}/{$locale}.json") && ! File::exists(lang_path("vendor/themes/{$parentTheme}/{$locale}.json"))) {
File::copy("{$path}/{$locale}.json", lang_path("vendor/themes/{$parentTheme}/{$locale}.json"));
}
Instead of getting the complete translation for Shofy from translations-master/vi/vendor/themes/shofy/vi.json, it ends up being copied from translations-master/vi/vi.json, which is an incomplete translation.
Currently, version 1.0.3 is performing very well in updating translations. You can compare version 1.2.0 with version 1.0.3.
Also, how can I currently upgrade the translations for Shofy?
Thanks for support!