piotr-cz / cockpit-import

Spreadsheet import module for Cockpit CMS
MIT License
23 stars 4 forks source link

Loc rows are all labeled with "en" #5

Closed gryphonmyers closed 8 years ago

gryphonmyers commented 8 years ago

image

I haven't tested whether this is merely a display issue or if it imports into the wrong rows as well

piotr-cz commented 8 years ago

There might be indeed a problem, because I've tested only scenario when default Cockpit language is Polish and additional is English.

By the way: if you add a languageCode suffix to column names in spreadsheet file, these should be auto-mapped. For example:

productNo name name_en description description_en
piotr-cz commented 8 years ago

Okay, the problem is that additional language codes are hardcoded to 'en' but should be locale.

So whole block should read

localizations.push({
    code  : locale,
    output: '',
    filter: filter,
    column: undefined
});

Please confirm this is solution to the issue.

gryphonmyers commented 8 years ago

Yes that fixes the issue I was seeing. Want a PR or you got it?

piotr-cz commented 8 years ago

Fixed in a27a487030419e1cac98930d5471dde608fd78d5. Thanks for bugreport.