PrestaShop / PrestaShop/TranslationToolsBundle
Function flattenFiles in making problems
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 5
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
Could you please add verification code to verify if locale code is not yet present in filename??
something like this is working form me:
public static function flattenFiles($files, $outputPath, $locale, $filesystem, $addLocale = true)
{
foreach ($files as $file) {
$flatName = preg_replace('#[\/\\\]#', '', $file->getRelativePath()).$file->getFilename();
if ($addLocale) {
if(!in_array($locale, explode('.', $flatName))){
$flatName = preg_replace('#\.xlf#', '.'.$locale.'.xlf', $flatName);
}
}
$filesystem->copy($file->getRealpath(), $outputPath.'/'.$flatName);
}
return true;
}
this is about function in this path: /Translation/Extractor/Util/Flattenizer.php
I hope I'm clear in this explanation if not please let me know.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open Translation/Extractor/Util/Flattenizer.php and inspect the flattenFiles function, especially how $flatName is built when $addLocale is enabled. Verify the locale check against filenames and confirm that flattening adds the locale only when it is not already present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- localization
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100