[Koha-bugs] [Bug 13897] Use XML files for installer data

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Dec 17 14:51:38 CET 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13897

--- Comment #22 from Bernardo Gonzalez Kriegel <bgkriegel at gmail.com> ---
Great to have so many comment :)

(In reply to David Cook from comment #12)
> 
> Since this is installer data, I don't think it necessarily has to be fast? I
> figure the most important part is to make it easy to read and update? 

Agreed, I think it's worth it

> Actually, I don't know if we necessarily need to change C4/Installer.pm? 
> 
> We could use YAML as a declarative format for the database data, and then
> the Release Manager/Release Maintainer could run a tool to compile it into a
> SQL script.

I think, as Katrin and Jonathan, that it's better not to compile sql, just use
the files, then a change in C4/Installer.pm is needed.


(In reply to Jonathan Druart from comment #16)
> > > Why not write our own stuff, yml-based?
> ...
> I would:
> - Retrieve and parse the whole YAML file
> - Generate the SQL queries (like 1 per table)
> - Execute the INSERT statements (using DBIx::RunSQL->run_sql)

In the new patch I'm inserting directly. 
We can try to measure the delay, if any


(In reply to Katrin Fischer from comment #18)
> > Going back to the actual problem this patchset is trying to resolve.. can
> > you remind me what it is about the SQL format files in the first place means
> > we can't easily support translating them without moving to some intermediary
> > file format?
> 
> I think the problem is that you can't 'mark' what needs translation. You
> only want to translate a small bit of the SQL files, the descriptions while
> preventing people to translate values that should not be changed.

Katrin is right, I couldn't find a general way to parse sql files to
extract/replace strings. There are too many variations.
The only one I'd made is the one used to generate translated frameworks, in
translation server, that has different functions to extract/replace strings
with 1,2,6,15,16 commas (,); and that after massaging EN frameworks sql files
so they are exactly as expected.


(In reply to Martin Renvoize from comment #20)
> What I wasn't fully understanding is why we needed to move from a lots of
> SQL files to one YAML/XML/Whatever file instead of a single SQL file which
> gets translated via the tools.
> 
> Sounds like SQL is just too hard to parse as is for the existing translation
> tools.. that's the answer.

It is hard, at last for me :(

Thank you all!

If you can, please take a look at the second patch.
It uses YAML instead of XML, it's easier to read.
I tried it and works. Do not install the first patch.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list