Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DataSourceLocalization XML tag question

    Hi Isomorphic,

    it is most likely a silly question, but as the change means much ugly boilerplate work for me, I'll ask it anyway.
    I want to i18n my .ds.xml files using the approach from the docs.

    There you do:
    Code:
    <field name="itemName">
     <title><fmt:message key="itemTitle"/></title>
    </field>
    I'm using the XML short form empty tag <field attr1="..." attr2="..." attr3="..." attr4="..."/> for basically all my fields that do not have a validator.
    Do I have to rewrite these or is there a way I could do i18n with <field title="i18n_me" ... />?

    Best regards
    Blama

    #2
    Sorry, you will need to move the title to a subelement <title>, there is no attribute-based way to use the i18n system for titles.

    Comment


      #3
      But definitely hear you on the boilerplate work - I think it's worth a brief search to see if there's an XML tool that'll turn all attributes into subelements for you - odds are good it exists.

      Comment


        #4
        Hello,

        if anyone is interested, I solved it the following way:
        • Eclipse: Set XML line-length to 999 (was 150)
        • Rightclick ds folder: Source, Format
        • Notepad++ RegEx replace in files for empty tags
          • ^(\t\t<field.*)title="(.*?)"(.*) />
          • \1\3><title>\2</title></field>
        • Notepad++ RegEx replace in files for non-empty tags
          • ^(\t\t<field.*)title="(.*?)"(.*)>
          • \1\3><title>\2</title>
        • Eclipse: Set XML line-length to 150
        • Rightclick ds folder: Source, Format
        For me this works as expected which can be seen the diff.

        Next is to collect a list of used title-contents again with RegExp and Notepad++.

        Best regards
        Blama

        Comment

        Working...
        X