When trados studio translate bilingual excel, trados can not deal with the date in the excel

Hi

When I try to use trados studio to translate bilingual excel, There is the date in the excel cell

Excel screenshot showing a date formatted cell '2024 3 3 ' highlighted in red.

But when I try to add the bilingual excel into trados studio after I set the file type only for bilingual excel. Trados will demonstrate the date as numbers, which is not correct, and I need the date can still be shown here.

Beside, before I add the bilingual excel to trados, I have set two column of excel as text mode.

Trados Studio screenshot with an error where the same date is displayed as '6.45385' in red, with a red cross indicating incorrect format.



Generated Image Alt-Text
[edited by: Trados AI at 7:42 AM (GMT 1) on 6 Apr 2024]
emoji
Parents Reply Children
  • Dear Mr. Paul.

    Thank you very much, you are always so professional and helpful.

    I tested your sample and it worked, and I also found the reason.

    I copied the bilingual content from Microsoft word document to excel and caused the problem.

    In addition, my intention is to use a bilingual table in the Microsoft word document to quickly convert into the sdltm.

    Screenshot of a bilingual table in a Microsoft Word document with Chinese text on the left and Portuguese text on the right.

    The current process is still very complicated and time-consuming.

    1, I copied the bilingual table in word document to a bilingual excel and then import the bilingual excel to trados to create the sdltm; it will word but it also will cause the font of the word to change which will affect the 100% matching in the future.

    2, I tried to split the bilingual table to paste it separately into two Microsoft documents to align in trados studio, but trados studio will make the alignment worse

    Screenshot of Trados Studio software showing an error message with a red 'X' icon indicating a problem with aligning the bilingual table from the Word document.

    Is it possible that you could make trados studio to align this kind of bilingual word document quickly, better just within one word document, so that I can convert this kind of bilingual table in the word document quickly into sdltm?

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 12:52 AM (GMT 1) on 7 Apr 2024]
  •   

    Perhaps you could make two copies of the Word file. Then hide the source in one and the target in the other, then align them?

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji
  • Dear Mr pual, 

    My previous method is similar to your suggestion, "2, I tried to split the bilingual table to paste it separately into two Microsoft documents to align in trados studio, but trados studio will make the alignment worse"

    Besides,during this time, I tried your method to make two copies and hide the source in one and the target in the other, then align them The following is the result: 

    Screenshot of Trados Studio interface showing a document with bilingual table alignment issues. The navigation pane on the right highlights several misaligned segments.

    The word document was already aligned perfectly in the bilingual table of a  mircrosoft word file. I just want to use trados studio to quickly convert it to trados translation memory sdltm file. It seems that we might need to add the capability or function of trados studio to to this. 

    Best regards

    Jack

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 7:46 AM (GMT 1) on 7 Apr 2024]
  •  

    It seems that we might need to add the capability or function of trados studio to to this. 

    I don't think this is something we need to make part of the core product, but I'm not the product manager so if you still think so feel free to create an idea for this in the ideas site.

    I think you could solve this problem, based on everything you've shared so far (and ignoring anything that might be possible to improve the alignment since what you have shown doesn't mean it's not possible to get a better alignment than you have), by using a powershell script to move the rows in the table as they are already 1:1 into an XLIFF file.  So I created the following:

    # Ask for the Word document path
    $docFullPath = Read-Host "Please enter the full path to the DOCX file"
    if (-Not (Test-Path -Path $docFullPath)) {
        Write-Host "The file path you entered does not exist. Please check the path and try again."
        exit
    }
    
    # Prompt for source and target language codes
    $sourceLangCode = Read-Host "Enter the source language code (e.g., 'zh-TW')"
    $targetLangCode = Read-Host "Enter the target language code (e.g., 'pt-PT')"
    
    # Create the XLIFF file name by changing the DOCX extension to .xliff
    $xliffFile = [IO.Path]::ChangeExtension($docFullPath, ".xliff")
    
    # Create a new invisible Word Application object
    $wordApp = New-Object -ComObject Word.Application
    $wordApp.Visible = $false
    
    function Escape-Xml ($string) {
        $string -replace '&', '&' -replace '<', '<' -replace '>', '>' -replace '"', '"' -replace "'", '''
    }
    
    try {
        # Open the Word document
        $document = $wordApp.Documents.Open($docFullPath)
        $table = $document.Tables.Item(1)
    
        # Start building the XLIFF content
        $xliffContent = @"
    <xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="$sourceLangCode" trgLang="$targetLangCode">
    <file id="f1" original="word-document">
    "@
    
    # Iterate over each row in the table, skipping the header row
    for ($i = 2; $i -le $table.Rows.Count; $i++) {
        $sourceText = Escape-Xml ($table.Cell($i, 1).Range.Text -replace "`r`n", "" -replace "`a", "").Trim()
        $targetText = Escape-Xml ($table.Cell($i, 2).Range.Text -replace "`r`n", "" -replace "`a", "").Trim()
        $unitId = "u" + $i
        $xliffContent += "<unit id=`"$unitId`">`r`n  <segment>`r`n    <source>$sourceText</source>`r`n    <target>$targetText</target>`r`n  </segment>`r`n</unit>`r`n"
    }
    
        # Close the XLIFF content
        $xliffContent += @"
    </file>
    </xliff>
    "@
    
        # Save the XLIFF content to the file
        $xliffContent | Set-Content -Path $xliffFile -Encoding UTF8
    
        Write-Host "XLIFF 2.0 file has been created at $xliffFile"
    }
    catch {
        Write-Host "An error occurred: $_"
    }
    finally {
        # Close the Word document and quit the application
        if ($document) {
            $document.Close($false)
        }
        $wordApp.Quit()
    
        # Clean up COM objects
        [System.Runtime.Interopservices.Marshal]::ReleaseComObject($document) | Out-Null
        [System.Runtime.Interopservices.Marshal]::ReleaseComObject($wordApp) | Out-Null
        [System.GC]::Collect()
        [System.GC]::WaitForPendingFinalizers()
    }
    

    And this table:

    Which seems to do the trick like this:

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji