Announcement

Collapse
No announcement yet.

Comparison between 2 language files not working properly

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Comparison between 2 language files not working properly

    Hi, I've been using Beyond Compare 3 and 4 for quite a while, and I'm having a problem. I have two sets of *.property files, one in English and one in Japanese that I compare. My job is to translate English sentences in Japanese, so I only translate 'value' part on each 'key=value' sentence. I use BC to check if I didn't touch anything other than 'value', but BC doesn't always give me clean result.

    Please see the file attached. 7th sentence from the top, it started to show as if the whole sentence has changed when actually only 'value' is changed. I go to the indicated section to see if any difference other than 'value', but there's always no other difference. How can this be avoided? I have this problem for such a long time, but never ever thought of coming to ask on forum, but it looks as though the problem gets worse with upgrade and it's getting a waste of time using BC.

    Thank you for your reply in advance.
    Attached Files

  • #2
    Hello,

    The alignment of two lines is controlled by an algorithm that looks at the characters and tries to determine which lines should line up. There are many factors which control this, including the defined grammar elements and differences. This doesn't "get worse with an upgrade"; do you have a link to this forum thread?

    The first thing I would do is setup BC3/4 to ignore the differences you don't need to compare. I assume this is anything from the "=" to the end of the line. A new grammar element, of type Delimited, starting at "=" (without quotes) and check "Until end of line" should do it. That will make all of the translated text blue. You can then enable Ignore Unimportant Differences in the toolbar to hide all blue text as black, or disable it to find Blue/Unimportant/Translated changes. Show Differences will show Red/Blue text lines, or just Red lines if Ignore Unimportant Differences is enabled.

    For instructions and a video for how to define this, see this KB article:
    http://www.scootersoftware.com/suppo..._unimportantv3


    This would, at the least, allow you to quickly find any lines that didn't match for alignment. It may also help with the alignment algorithm, which can additionally be controlled in the Session menu -> Session Settings, Never Align Differences enabled after the above grammar is defined. This would then only align based on Important (before the =) characters.

    BC3 and BC4 have a wide variety of options and controls that allow it to be customized for a variety of workflows and file sets. It can then be expanded to run these scans on entire folders full of files, and return a summary of results. BC4 is the recommended upgrade, and has a many enhancements, features, and bug fixes, but your BC3 license will not expire and you can continue to use it if you wish. It is encouraged to try BC4 before purchase, and the trial can be installed along side a BC3 install without removing it.
    Aaron P Scooter Software

    Comment


    • #3
      Aaron,

      I'm looking to find/replace just the the "value" attribute in a xml node when comparing files of different languages. I did what you mentioned to ignore text and show only the part of the line I'm interested in. The next step is I would like to replace the Chinese "value" with the English "value" (see image).

      I understand how to ignore differences, but I can seem to figure out how to copy over (or find/replace) just the English value. I'm now wondering if BC has this capability.
      Attached Files

      Comment


      • #4
        Ah, thanks for the clarification. No, the Copy commands will copy the entire line. Assuming the line is entirely equal except for the Value="English", then copying that line will bring over the whole line where the only difference is the new English text.

        The grammar definition example worked with your first screenshot. With the new screenshot, you would probably want to expand the definition to cover =" to " assuming this text only appears after "Value".
        Aaron P Scooter Software

        Comment


        • #5
          Hi Aaron,

          Thank you so much for your quick reply. Wow, that little change in the setting made a HUGE difference! I've been using BC for more than 10 years (not everyday, just once in a while) but never touched the settings. I think the earlier version (BC v2 maybe? don't remember) worked great just with default setting for my purpose, thus my remark of 'the problem gets worse with upgrade'. No offence.

          Thank you so much once again for help, it makes my job a lot easier now.

          Comment


          • #6
            BC2 had similar importance control, so it's entirely possible you configured your blue text and hid it as black 10 years ago, and then didn't need to touch those options again. Similarly, once BC3 or BC4 is setup and the defaults are configured, it'll use those defaults for future comparisons so it doesn't need to be reset every time.

            Defining the Grammar is a new default. To define the Importance (red or blue) of that grammar as a default, go to the Home screen, in the Saved Sessions list expand the New folder, select Text Compare and Edit it, and note the full list of all grammar items in the Importance tab. Uncheck the grammar name here and it will be Unimportant for future Text Compare sessions by default.
            Aaron P Scooter Software

            Comment

            Working...
            X