alexxed / narro

Automatically exported from code.google.com/p/narro
2 stars 4 forks source link

The ini importer skips keys that contain spaces in them #139

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

Trying to adapt Narro to manage Joomla .ini files (like
ca-ES.mod_statistics.ini attached): - I've changed some lines in
NarroMozillaIniFileImporter.class.php
- Renamed en-GB.mod_statistics.ini to ca-ES.mod_statistics.ini
- Put ca-ES.mod_statistics.ini into en-US folder and another copy of
ca-ES.mod_statistics.ini into ca-ES folder
- Create compressed file containing en-US and ca-ES folders
- Import from compressed file

Then we can use Narro to manage suggestions and approve them.

But, when I try to export, I get:

Starting export for the project jsocial using as template
/opt/lampp/htdocs/narro/narro/data/import/7/en-US
Starting to export in directory
"/opt/lampp/htdocs/narro/narro/data/import/7/ca-ES"
Starting to process 1 files
Exporting file "ca-ES.mod_statistics.ini" using template
"/opt/lampp/htdocs/narro/narro/data/import/7/ca-ES/ca-ES.mod_statistics.ini"
Skipped line "MOD_LATESTDISC MEMBERS=Members " from the template
"ca-ES.mod_statistics.ini".
Skipped line "MOD_LATESTDISC GROUPS=Groups " from the template
"ca-ES.mod_statistics.ini".
Skipped line "MOD_LATESTDISC DISCUSSION=Discussion " from the template
"ca-ES.mod_statistics.ini".
Skipped line "MOD_LATESTDISC ALBUMS=Albums " from the template
"ca-ES.mod_statistics.ini".
Skipped line "MOD_LATESTDISC PHOTOS=Photos" from the template
"ca-ES.mod_statistics.ini".
Skipped line "MOD_LATESTDISC BULLETINS=Bulletins " from the template
"ca-ES.mod_statistics.ini".
Skipped line "MOD_LATESTDISC ACTIVITIES=Activities " from the template
"ca-ES.mod_statistics.ini".
Skipped line "MOD_LATESTDISC WALL POSTS=Wall Posts " from the template
"ca-ES.mod_statistics.ini".
Skipped line "MOD_LATESTDISC MALES=Males" from the template
"ca-ES.mod_statistics.ini".
Skipped line "MOD_LATESTDISC FEMALES=Females" from the template
"ca-ES.mod_statistics.ini".
Skipped line "MOD_LATESTDISC UNSPECIFIED=Unspecified " from the template
"ca-ES.mod_statistics.ini".
Found a empty template
(/opt/lampp/htdocs/narro/narro/data/import/7/en-US/ca-ES.mod_statistics.ini),
copying the original
...

All lines are skipped and finally ca-ES.mod_statistics.ini results as the
original one.

Original issue reported on code.google.com by alex...@gmail.com on 13 May 2009 at 7:04

GoogleCodeExporter commented 9 years ago
The regular expression should be enlarged in
includes/narro/importer/NarroMozillaIniFileImporter.class.php

Replace "0-9a-zA-Z\-\_\.\?\{\}" everywhere in the file with 
"0-9a-zA-Z\-\_\.\?\{\}\s"
(should be 3 times).
Replace "A-Z0-9a-z\.\_\-\?\{\}" in the file with "A-Z0-9a-z\.\_\-\?\{\}\s"

I'll keep this open to investigate if I can risk taking anything but equal sign 
on
the left.

Original comment by alex...@gmail.com on 13 May 2009 at 7:06

GoogleCodeExporter commented 9 years ago

Original comment by alex...@gmail.com on 12 Oct 2011 at 6:11