[Koha-bugs] [Bug 24975] Refactor database translations

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Sep 14 15:18:07 CEST 2020


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

--- Comment #23 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
I'm coming back around to keying on the original text now rather than a
definitive unique key.

However, I think we should allow for the key to be passed in additional and
perhaps other variables too eventually.

My thinking behind this is all the various options we have now for plural forms
and the likes in the rest of the translation system. It's those cases I could
see requiring additional options to refine which version of a translation to
'pick'.

So.. my thinking is along the lines

db_t($itype->itemtype, $itype->description, { key => $itype->code, count => $x
});

Where the first two params are required, but the hashref or additional
arguments is optional depending on the situation.

This way, we can key on the description text and allow for passing the code as
an option to allow for more specific selection it it exists but fallback to
just description as the key if it does not. Something similar to the way we
allow falling back through rules in the circ rules system.. if the more
specific case doesn't exist we trap the less specific case.

I'll have a little play with the code but I think this could end up flexible
enough to support future expansions and allow for more and less specific cases
in translation as required.

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


More information about the Koha-bugs mailing list