Number Formats in Studio 2022 - thousand separator

Hello,

How can I set a new number format (for the source language) that includes no thousand separator but a decimal separator only? It could ensure that a long number without any thousand separator is properly localised in the target segment.

Sandor

emoji
Parents
  •  

    This one is possible:

    Trados Studio interface showing a number without a thousand separator, highlighted in yellow with a warning symbol.

    But you have to trick it!  You are forced to add a thousand separator into the settings as well as a decimal, so copy paste a zero-width space.  You can take it from here:

    https://unicode-table.com/en/200B/

    Just click the copy button here:

    Webpage with a button to copy a zero-width space character, indicated by a red arrow pointing to the 'Copy' button.

    And paste straight into here:

    Trados Studio settings window for number formats, with a red arrow pointing to the 'Thousand Separator' input field.

    You obviously won't see anything, but you will now be able to save your new rule and use it.

    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


    Generated Image Alt-Text
    [edited by: Trados AI at 9:26 AM (GMT 0) on 29 Feb 2024]
  • Maybe I was not clear.

    By default, if a number contains no thousand separators in the source segment, the localised number in the target segment will not contain thousand separators either. Just the same way as we use a zero width space.

    So, my question: is it possible to localise a source number without thousand separators like this:

    Screenshot showing a number without thousand separators in Trados Studio source segment: 123456789432.15.

    as a target number with thousand separators like this:

    Screenshot showing the same number with thousand separators in Trados Studio target segment: 123,456,789,432.15.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 9:27 AM (GMT 0) on 29 Feb 2024]
  •  

    ok - understood.  The answer is no and the reason is because Trados Studio doesn't allow for no separator at all.  So you get this:

    Screenshot of Trados Studio showing a number without a thousand separator highlighted in yellow.

    If I trick it I thought that might work but actually it doesn't because you would actually need to have zero width spaces as a thousand separator, like this:

    Screenshot of Trados Studio showing a number with zero width spaces as a thousand separator, highlighted in blue with an error message 'WordprocessingML v. 2'.

    But this obviously won't help you.

    I think you have two workarounds.  The first is simple if you are working interactively, and that would be to use the Regex AutoSuggest Provider.  That is a simple fix, but obviously doesn't help with pre-translation or auto-propagation.

    The second would be to use something like the SDLXLIFF Toolkit and search replace all your numbers in the source and add a thousand separator.  Then you would have what you really want in terms of handling the numbers in the target correctly.

    But the real solution is obviously to raise an enhancement request to support no thousand separators at all.  Do that here:  Trados Studio Ideas 

    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


    Generated Image Alt-Text
    [edited by: Trados AI at 9:27 AM (GMT 0) on 29 Feb 2024]
  • Thank you Paul. I will raise an enhancement request.

    Anyway, in your last example:

    Screenshot showing Trados Studio interface with a number sequence '123456784345,89' highlighted in yellow in the source pane and the same number sequence in the target pane.

    it seems it works. I don't really understand what happens here.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 9:27 AM (GMT 0) on 29 Feb 2024]
  •  

    It works because I added a rule that included zero-width spaces as the thousands separator AND that number actually had zero-width spaces as thousands separators.  Hence me saying this obviously won't help you.

    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
  • By the way, Paul,

    Could you please propose a regex rule for this problem to be used in Regex Match AutoSuggest Proivder?

    emoji
  •  

    I don't know how to do this with one rule.  I'm not sure it can be... so you just simply do this:

    Screenshot of Trados Studio showing a list of rules for adding thousand separators with corresponding outputs.

    Add as many as you think you'll need.  Pain in the neck but once you've done it you have it forever and can reuse as much as you need.

    The toolkit is easier... search for this:

    \d(?=(?:\d{3})+(?!\d))

    Replace with this:

    $0,

    Then you have all your thousand separators in place.

    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


    Generated Image Alt-Text
    [edited by: Trados AI at 9:27 AM (GMT 0) on 29 Feb 2024]
  •  

    If it helps... it's quite quick to just edit this file:

    c:\Users\%username%\AppData\Roaming\Capybara.EditorPlugin.RegexMASProvider\Capybara.EditorPlugin.RegexMASProvider.settings.xml

    Here's the entries I set up in a couple of mins:

          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>1</Description>
            <RegexPattern>\b(\d{1}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1.$2</ReplacePattern>
          </Entry>
          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>2</Description>
            <RegexPattern>\b(\d{2}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1.$2</ReplacePattern>
          </Entry>
          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>3</Description>
            <RegexPattern>\b(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1.$2</ReplacePattern>
          </Entry>
          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>4</Description>
            <RegexPattern>\b(\d{1})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2.$3</ReplacePattern>
          </Entry>
          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>5</Description>
            <RegexPattern>\b(\d{2})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2.$3</ReplacePattern>
          </Entry>
          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>6</Description>
            <RegexPattern>\b(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2.$3</ReplacePattern>
          </Entry>
          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>7</Description>
            <RegexPattern>\b(\d{1})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3.$4</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>8</Description>
            <RegexPattern>\b(\d{2})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3.$4</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>9</Description>
            <RegexPattern>\b(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3.$4</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>10</Description>
            <RegexPattern>\b(\d{1})(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3,$4.$5</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>11</Description>
            <RegexPattern>\b(\d{2})(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3,$4.$5</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>12</Description>
            <RegexPattern>\b(\d{1})(\d{3})(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3,$4,$5.$6</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>13</Description>
            <RegexPattern>\b(\d{2})(\d{3})(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3,$4,$5.$6</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>14</Description>
            <RegexPattern>\b(\d{3})(\d{3})(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3,$4,$5.$6</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>15</Description>
            <RegexPattern>\b(\d{1})(\d{3})(\d{3})(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3,$4,$5,$6.$7</ReplacePattern>
          </Entry>

    Works nicely :-)

    Trados Studio screenshot showing a number pattern in the source text '3456775543566,45' and the corresponding regex replacement result '3,456,775,543,566.45' highlighted in blue.

    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



    Generated Image Alt-Text
    [edited by: Trados AI at 9:27 AM (GMT 0) on 29 Feb 2024]
Reply
  •  

    If it helps... it's quite quick to just edit this file:

    c:\Users\%username%\AppData\Roaming\Capybara.EditorPlugin.RegexMASProvider\Capybara.EditorPlugin.RegexMASProvider.settings.xml

    Here's the entries I set up in a couple of mins:

          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>1</Description>
            <RegexPattern>\b(\d{1}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1.$2</ReplacePattern>
          </Entry>
          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>2</Description>
            <RegexPattern>\b(\d{2}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1.$2</ReplacePattern>
          </Entry>
          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>3</Description>
            <RegexPattern>\b(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1.$2</ReplacePattern>
          </Entry>
          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>4</Description>
            <RegexPattern>\b(\d{1})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2.$3</ReplacePattern>
          </Entry>
          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>5</Description>
            <RegexPattern>\b(\d{2})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2.$3</ReplacePattern>
          </Entry>
          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>6</Description>
            <RegexPattern>\b(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2.$3</ReplacePattern>
          </Entry>
          <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>7</Description>
            <RegexPattern>\b(\d{1})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3.$4</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>8</Description>
            <RegexPattern>\b(\d{2})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3.$4</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>9</Description>
            <RegexPattern>\b(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3.$4</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>10</Description>
            <RegexPattern>\b(\d{1})(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3,$4.$5</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>11</Description>
            <RegexPattern>\b(\d{2})(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3,$4.$5</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>12</Description>
            <RegexPattern>\b(\d{1})(\d{3})(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3,$4,$5.$6</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>13</Description>
            <RegexPattern>\b(\d{2})(\d{3})(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3,$4,$5.$6</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>14</Description>
            <RegexPattern>\b(\d{3})(\d{3})(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3,$4,$5.$6</ReplacePattern>
          </Entry>
                <Entry>
            <IsEnabled>true</IsEnabled>
            <Description>15</Description>
            <RegexPattern>\b(\d{1})(\d{3})(\d{3})(\d{3})(\d{3})(\d{3}),(\d+)\b</RegexPattern>
            <ReplacePattern>$1,$2,$3,$4,$5,$6.$7</ReplacePattern>
          </Entry>

    Works nicely :-)

    Trados Studio screenshot showing a number pattern in the source text '3456775543566,45' and the corresponding regex replacement result '3,456,775,543,566.45' highlighted in blue.

    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



    Generated Image Alt-Text
    [edited by: Trados AI at 9:27 AM (GMT 0) on 29 Feb 2024]
Children