Quantcast
Channel: ProZ.com Translation Forums
Viewing all 822 articles
Browse latest View live

Find/replace thousand separators and decimal points using regex within Transit | groupings

$
0
0
Forum: Transit support
Topic: Find/replace thousand separators and decimal points using regex within Transit
Poster: Extra Consult
Post title: groupings

We normally do this by searching a single digit followed by a group of 3 digits to find thousand separators:
(\d)\.(\d{3}) for dot or (\d)\s(\d{3}) for space. Then replace by $1,$2 or $1.$2 as you need.

If you want to make sure you only get this group, you can single them out by the beginning and end-of line markers (^ and $) as such:
^(\d).(\d{3})$ - this will make sure it only find grouping of a single digit followed by a group of 3 digits that are not started or ended by another character.

Hope this helps;


Find/replace thousand separators and decimal points using regex within Transit | Some progress with thousand separators

$
0
0
Forum: Transit support
Topic: Find/replace thousand separators and decimal points using regex within Transit
Poster: Steveling2
Post title: Some progress with thousand separators

Thank you for your quick reply. I've made some progress on the thousand separators. A small change from

#([0-9]+)0\.#([0-9]+)1
to
#([0-9])0\.#([0-9])1

finds every dot (or comma, as required) between numbers. Using

#0,#1

in Replace changes 1.000.000 to 1,000,000 rather than 1,000.000. However, it will also find and change dates in the xx.xx.xxxx format. Your suggestion of exclusion (or Negation, as Transit calls it) sounded promising. Based on your string I can use

([0-9][0-9]\.[0-9][0-9]\.[0-9]+)

to find the format xx.xx.xxx (I tweaked your code so that it will find any year). But I haven't found a way of using this to exlude dates in this format, e.g.

#([0-9]+)0\.#([0-9])1(![0-9][0-9]\.[0-9][0-9]\.[0-9]+)
or
(![0-9][0-9]\.[0-9][0-9]\.[0-9]+)#([0-9]+)0\.#([0-9])1

And another problem springs to mind – in files where there are both separators and decimal points, the separators will be the same as the source language's decimal point after the conversion. Then a regex will be required that will convert x,x and ignore any variant of x,xxx (and that's assuming there are only one or two digits after the decimal point in the file).

I seem to be spending a whole lot of time chasing my tail here. And I haven't even looked at date conversion, e.g. 12/05/2017 to 12 March 2017 (or March 12, 2017). I can't be the first Transit user to want to do this, so I can only assume that the lack of an existing solution means that this can't be done in Transit, or at least not in single find/replace action. Looks like automating these changes needs to be done pre-import.

Find/replace thousand separators and decimal points using regex within Transit | Flavours of regex

$
0
0
Forum: Transit support
Topic: Find/replace thousand separators and decimal points using regex within Transit
Poster: Steveling2
Post title: Flavours of regex

Thanks for your reply. Unfortunately the flavour of regex that Transit uses doesn't include the {n} quantifier, so the options are to use + (1-n instances) or to actually enter the occurences, in this case

([0-9])\.([0-9][0-9][0-9])

to find 1.000. But this will ignore the second separator in 1.000.000, giving you 1,000.000

And would your string not need to be (\d{1,3})\.(\d{3}) to find 1,000 and/or 10,000 and/or 100,000? Having just typed up this question, I thought of an answer, which is to use alternatives

(\.([0-9][0-9][0-9])|\.([0-9]+)\.|\.([0-9]+)\.([0-9]+)\.)

This will find 1.000 / 1.000.000 / 1.000.000, but the string is getting messy, and how will alternatives work with variables (do they even)? Fortunately, while testing this with variables I hit on the best solution (so far – with regex you never know):

\.([0-9][0-9][0-9])

By leaving out the number(s) before the separator I get around the issue of the second or third (etc.) separator being ignored. And around the fact that my attempt at using alternatives and variables was a fail:

(\.#([0-9][0-9][0-9])1|\.#([0-9]+)2\.|\.#([0-9]+)3\.#([0-9]+)4\.) is invalid

All I need in the Replace field is \,#1 to change all my thousand separators.
Now I just need to find a way to exclude xx.xx.xxx as I'm now left with xx.xx,xxxx
Using an exclude at the end of my string

\.#([0-9][0-9][0-9])1(![0-9][0-9]\.[0-9][0-9]\.[0-9]+)

excludes nothing, and sticking it at the beginning

(![0-9][0-9]\.[0-9][0-9]\.[0-9]+)\.#([0-9][0-9][0-9])1

finds nothing, which is a bit of a surprise, as the exclusion surely only applies to the string within the same brackets? If I find a way to do it, I will add it to my post.

Adding folder as reference Transit NXT not working

$
0
0
Forum: Transit support
Topic: Adding folder as reference Transit NXT not working
Poster: Yiftah Hellerman-Carmel

I have been trying to add a folder as a reference material for projects under Administration->Settings->Reference material->Add folder..., but transit wouldn't let me. In the selection window transit forces me to click "open" again and again until I reach the file level. Identical to choosing a single file as reference. I am using Transit NXT Freelance.

Am I doing something wrong? Is it due to the version I am using?

Thank you.

Can Transit's panes be moved to a secondary screen? | Try Dual Monitor Tools

$
0
0
Forum: Transit support
Topic: Can Transit's panes be moved to a secondary screen?
Poster: John Taylor
Post title: Try Dual Monitor Tools

I use Dual Monitor Tools on Virtualbox.
dualmonitortool.sourceforge.net/download.html
Lets you set a shortcut to maximise a window over two monitors.
Very useful also for memoQ, DVX etc.

Adding folder as reference Transit NXT not working | You're probably doing it right

$
0
0
Forum: Transit support
Topic: Adding folder as reference Transit NXT not working
Poster: Iris Kleinophorst
Post title: You're probably doing it right

Hi,

for whatever reason, some processes in Transit are a bit confusing. You do indeed have to click on "open" when you reach the single file level. Just make sure not to select one of the shown single files, and your complete folder will be added as reference material.

HTH
Iris

Adding folder as reference Transit NXT not working | Make sure... no longer necessary

$
0
0
Forum: Transit support
Topic: Adding folder as reference Transit NXT not working
Poster: Oiseau noir
Post title: Make sure... no longer necessary

Indeed, some things are strange, but:

Since some Service Packs ago, you no longer need "to make sure not to select one of the shown single files".
If you have selected a single file (by accident) and click "open", Transit will replace your selection in the "file" field by *.*. If you click "open" again, you have successfully selected the folder with all its files.
In other words: Click "open" once or twice until the folder selection windows closes ;-).

Best regards,

O.N.

Adding folder as reference Transit NXT not working | Solved, Thank you

$
0
0
Forum: Transit support
Topic: Adding folder as reference Transit NXT not working
Poster: Yiftah Hellerman-Carmel
Post title: Solved, Thank you

Iris, your suggestion works. It is indeed a strange way of doing things, but as long as it works...
@Oiseau, thank you, your method works well for selecting all files within a sub-folder, it does not let me though choose a folder with its sub-folders (unless the root folder contains also single files, and not only folders).

[Edited at 2017-05-23 07:36 GMT]

[Edited at 2017-05-23 07:36 GMT]

Adding folder as reference Transit NXT not working | Subfolders are included

$
0
0
Forum: Transit support
Topic: Adding folder as reference Transit NXT not working
Poster: Oiseau noir
Post title: Subfolders are included

AFAIK all subfolders are included automatically.
At least that is the case with my Transit SP9: When I choose and confirm a parent folder, all its sub- and subsub- and subsubsub...-folders are listed in the "reference material" tab of the project settings (i.e. can be seen by clicking on the plus sign beside the parent folder name.

Adding folder as reference Transit NXT not working | Order of reference material

$
0
0
Forum: Transit support
Topic: Adding folder as reference Transit NXT not working
Poster: Iris Kleinophorst
Post title: Order of reference material

Hi,
Oiseau noir is right AFAIK.

As I once learned in one of STAR's webinars, you can also set search preferences through the order of your reference material: The one on top has the most important priority, will be searched first, and its results will be displayed first. For this, it might also make sense to choose a subfolder with higher priority as first order reference materal, and then set another folder containing this subfolder as another reference material folder underneath. Thus, the subfolder will be searched first, before searching the more extensive reference material, and the results will be displayed first without being displayed a second time as results of the rest of the reference material (does this explanation make sense?).

HTH
Iris

Find/replace thousand separators and decimal points using regex within Transit | A solution, if far from perfect

$
0
0
Forum: Transit support
Topic: Find/replace thousand separators and decimal points using regex within Transit
Poster: Steveling2
Post title: A solution, if far from perfect

So, having decided that we don't care about changing dates, solving the problem becomes a little easier. Proceed as follows:

1. Open Find/Replace and copy/paste the following regular expressions:

Find field: #(.)1\,#([0-9]+)2
Replace field: #1\*#2

This changes a comma decimal to an Asterisk (you can use different character, just replace the asterisk in the second regex with the character of your choice). This step is needed, otherwise you will end up with commas for both the DE decimal marker and the EN thousand separator.

Save the regex with a useful name, e.g. 1_Comma2Asterisk_Decimal

2. Now copy/paste

Find field: \.#([0-9][0-9][0-9])1
Replace field: \,#1

Find/replace thousand separators and decimal points using regex within Transit | External regex

$
0
0
Forum: Transit support
Topic: Find/replace thousand separators and decimal points using regex within Transit
Poster: Dan Lucas
Post title: External regex

[quote]Steveling2 wrote:
Proceed as follows:[/quote]
I realize this comes too late to help Steve, who has already sunk quite a bit of time in this, but in the hope of being useful to others following in his footsteps, I use a stand-alone grep utility (specifically PowerGREP 5) to "preprocess" Transit NXT files (*.ENG).

It works without any apparent problems - but don't process angle brackets! - saves me a lot of time, and allows me to avoid Transit's own, rather clunky, regex implementation.

Dan

Find/replace thousand separators and decimal points using regex within Transit | A solution, if far from perfect - the missing steps

$
0
0
Forum: Transit support
Topic: Find/replace thousand separators and decimal points using regex within Transit
Poster: Steveling2
Post title: A solution, if far from perfect - the missing steps

OK, so the last steps were missed off :x

2. ...concluded

This converts all instances of comma followed by three numbers (most likely to be a thousand separator). It's also at this point that step 1 makes sense. If you had already converted the comma decimal marker to a dot (e.g. 1,5% > 1.5%) rather than to an asterisk, you would now have both 1.5% (EN decimal marker) and 1.000.000 (DE thousand separator) in the same text. Instead you should have 1*5% and 1.000.000

Now that you have pasted the regexes in step two, save them with a meaningful name, e.g.

2_Dot2Comma_Separator

3. In the final step, copy/paste

Find field: #(.)1\*#([0-9]+)2
Replace field: #1\.#2

to convert the asterisks (or you chosen character). Again, save this regex with a meaningful name, e.g.

3_Asterisk2Dot_Decimal

Adding the number of the step to the regex name makes easier it to remember the sequence in which to run them. Simply load and run each regex in order (remembering to tick the "Regular expression" box) - you can try it using the Replace button first, and once you're confident it works for you, you can use Replace all.

I did have a quick look into creating a macro to run these steps with a keyboard shortcut, but it was a bit flaky and you have to manually add the macro for each user, it is not available centrally, unlike the saved regexes, which every user can see.

There are some things to note:
1. If the comma or dot is between markup tags, then the markup will be broken
2. Superscript numbers are treated as normal numbers
3. Dates in the xx.xx.xxxx format become xx.xx,xxxx
4. Pretranslated segments will be changed unless you filter them out using the segment filter options on the View tab before running the regexes

Find/replace thousand separators and decimal points using regex within Transit | STAR should fix this

$
0
0
Forum: Transit support
Topic: Find/replace thousand separators and decimal points using regex within Transit
Poster: CafeTran Training
Post title: STAR should fix this

1 and 2 are really killing. Actually, 3 isn't nice either (dates should be recognised and protected). 4 is more of less the responsibility of the user.

Naming the regex by steps is what I did too. However, I saved them in MacroToolworks. For better updating and more flexibility.

[Edited at 2017-05-31 16:53 GMT]

Find/replace thousand separators and decimal points using regex within Transit | External regex

$
0
0
Forum: Transit support
Topic: Find/replace thousand separators and decimal points using regex within Transit
Poster: Steveling2
Post title: External regex

@Dan

Thanks for your recommendation. I'll see how my users get on with the regexes I've set up in Transit. If it really becomes a problem, we might consider a non-Transit solution.

Out of curiosity, if you're manipulating the text post-import, i.e. the *.ENG file, how do you deal with pretranslated segments where the decimal markers and separators are already in the correct format?

Find/replace thousand separators and decimal points using regex within Transit | Not an issue

$
0
0
Forum: Transit support
Topic: Find/replace thousand separators and decimal points using regex within Transit
Poster: Dan Lucas
Post title: Not an issue

[quote]Steveling2 wrote:
Out of curiosity, if you're manipulating the text post-import, i.e. the *.ENG file, how do you deal with pretranslated segments where the decimal markers and separators are already in the correct format? [/quote]
Steve, in my case I am mostly replacing double-byte Japanese characters (such as "wide" digits) with their "narrow" Latin character set equivalents. Pre-translated segments are already in a western character set, so there is no match, and no replacement is made.

Also, the client assures me that it doesn't matter what I do to a pre-translated segment, because any changes to such segments are junked when the project goes back into their system. I've been doing this for quite some time now, and no problems have been reported and no complaints have been made.

Regards,
Dan

Transit NXT Editor: Shortcut key ALT + insert not working

$
0
0
Forum: Transit support
Topic: Transit NXT Editor: Shortcut key ALT + insert not working
Poster: Barbara Santos

Dear all,

I am having an issue with my Transit NXT (Freelance Pro, SP9, working on Windows 10 64 bit), which wasn't solved with the uninstallation and new installation of the program.
The issue is I can't confirm a translated segment with the shortcut key Alt+Insert as usual, and am forced to confirm the segment by hand with the "confirm" button.

Has anyone ever experienced this? Do you have any idea on how to solve the problem?
Uninstalling doesn't seem to do the trick, at least by me.

Thank you for your help!

Best
Bárbara

Transit NXT Editor: Shortcut key ALT + insert not working | "Windows Ease of Access" and how to solve it

$
0
0
Forum: Transit support
Topic: Transit NXT Editor: Shortcut key ALT + insert not working
Poster: Oiseau noir
Post title:"Windows Ease of Access" and how to solve it

Hi Barbara,

this may result from a Windows "Ease of Access" setting.
You can try to fix it by turning off the "Use mouse keys when Num Lock is on“ option (Windows START Button, "Settings", "Ease of Access", "Mouse").
Here you can find helpful screenshots: [url removed]

Or maybe the NUMLOCK was activated by accident?

Regards,

O.N.

Transit NXT Editor: Shortcut key ALT + insert not working | Thank you, but...

$
0
0
Forum: Transit support
Topic: Transit NXT Editor: Shortcut key ALT + insert not working
Poster: Barbara Santos
Post title: Thank you, but...

Hi Oiseau,
thank you for your help, I have tried it and it still doesn't work :(
I'll try and check with Star directly.

Best
Bárbara

Using the same mark up twice in a segment (in target) even though its used once in source.

$
0
0
Forum: Transit support
Topic: Using the same mark up twice in a segment (in target) even though its used once in source.
Poster: jjdelaney

Hi guys,

I am fairly new to Transit, but on my last piece of work I had allot of trouble doing something which seems like it should be fairly simple. I translate Irish Gaeilge which requires very different word placing than English. In this project, one segment contained lets say 7 markups, and although in the English this was 1-7 in order, in Irish it was very different. So different, that the translation actually would have required 2 of mark up (1) for example used in different place, contrary to the source. Whenever I tried to add the markup to a second phrase, it would 'jump' from the first one, effectively being deleted from the first phrase needing the markup. In other words, it would not allow me to use the same mark up on two words in the segment. I have found that other segments DID allow me to do this and I cannot seem to find out why this was. Can anyone help me find out how to control this or make it so the settings allow me to use as many of any given mark up as I need?

Thank you kindly

Viewing all 822 articles
Browse latest View live