Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-2596

Use Identifier#getTranslationContext() consistently

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0-M5
    • None
    • Core
    • None

    Description

      from https://the-asf.slack.com/archives/CFC42LWBV/p1617614428185000?thread_ts=1617614189.183900&cid=CFC42LWBV

       

      Provide more context to TranslationService for collections.

       
      The VisitorAdapter that handles the translations does not implement visit for FieldSets, rather the translations for FieldSets are picked up during the traversing of properties, but then all the context goes missing for some reason
       
      it would be nice to have more than the class name as context I guess
       
      maybe the MemberOrderFacetXml facet that does the ordering of the members shouldn't also handle translations? There seems to be quite a few cases where it makes more sense to use the ID for ordering, but then the ID is not the text that should be translated I guess

       

      It seems that the context that the MemberOrderFacet is passing to the translation service is a different one than the context passed to the translation service during the metamodel introspection for the same piece of text ... `MemberOrderFacetAbstract` line 72.

       
      Just passing the className is a mismatch with the context that is used by the TranslationFacetFactory 

      final String context = holder.getIdentifier().getTranslationContext();
       
      Question is why the context is computed differently
       
      Andi introduced that method quite recently, I think this is one area which probably always had a bug lurking and we didn't refactor it to the new style ... So,  we should just change it I think.
       
      Consistently using the translation context of the IdentifiedHolder should fix a good number of misaligned cases between the translation facet factory and the member order facet.
       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              danhaywood Daniel Keir Haywood
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: