opengisch / QgisModelBaker

Create QGIS projects from database schemas or Interlis models
https://opengisch.github.io/QgisModelBaker/
GNU Lesser General Public License v3.0
55 stars 17 forks source link

Translation Models: Translate Enumeration Domains #982

Open signedav opened 2 weeks ago

signedav commented 2 weeks ago

Enumerations are not translated. They should be.

    RechtsStatus = (
      inKraft,
      AenderungMitVorwirkung,
      AenderungOhneVorwirkung
    );
    StatutJuridique = (
      enVigueur,
      ModificationAvecEffetAnticipe,
      ModificationSansEffetAnticipe
    );

Creates the table: image

With --nameLang fr it would contain french values...

sjib commented 2 weeks ago

There were some issues on this some time ago: https://github.com/claeis/ili2db/issues/405 https://github.com/claeis/ili2db/issues/439 https://github.com/claeis/ili2db/issues/460

signedav commented 2 weeks ago

The specialty is that those values are data and not structure. Of course Model Baker could update the dispName value of the domain table, but I don't really like it. Since the translation besides that is made in the frontend.

A front end solution would be having this display expression:

CASE 
   WHEN iliCode = 'inKraft' THEN 'enVigueur'
   WHEN iliCode = 'AenderungMitVorwirkung' THEN 'ModificationAvecEffetAnticipe'
   WHEN iliCode = 'AenderungOhneVorwirkung' THEN 'ModificationSansEffetAnticipe'
   ELSE iliCode
END

Any other ideas? E.g. @gacarrillor ?

gacarrillor commented 2 weeks ago

Other ideas here: https://github.com/opengisch/QgisModelBakerLibrary/issues/115

BTW, yours seems like a clean approach.

signedav commented 2 weeks ago

Other ideas here: https://github.com/opengisch/QgisModelBakerLibrary/issues/115

Oh sorry. I've overseen that. Usually I keep issues in this repo and in the library I keep only technical dev stuff.

Thanks for your inputs there. I see the cool aspects on your proposed sollution but I am a little Bit concerned about performance.

BTW, yours seems like a clean approach.

Thanks. Yes I have to overthink it but it's straight foreward and simple (and performant)...

gacarrillor commented 2 weeks ago

Thanks. Yes I have to overthink it but it's straight foreward and simple (and performant)...

Definitely. I guess it also answers what I was trying to mention in the linked issue by saying: there should be a cache mechanism. Let's see if there are other ideas coming. However, if we find it covers the required use cases, then I'd vote to go for it.