Welcome / Bienvenue / Benvinguts / Bienvenidos
For information about my translation services, please visit the main site.
Pour des informations sur mes services, merci de regarder le site principal.
Para información sobre mis servicios de traducción, visite el web principal.

Writing special characters in Khoekhoegowab

Writing in Namibia’s indigenous languages can be difficult, since the keyboards we use in Namibia are not designed for typing the special characters used in our country’s languages.

That’s why I created tools to make these special characters more accessible: one for Khoekhoegowab (also known as Nama/Damara) and one for Otjiherero.

Download the Khoekhoegowab tool.

How to use the tool

Continue reading

Share:

Macros to replace apostrophes and quotation marks before and after using a CAT tool

To ensure that concordance searches in translation memories work properly and to increase fuzzy matches, many translators systematically replace curly apostrophes and quotation marks with straight ones before importing a document into their CAT tool, then revert them back to the curly variety before delivering the final document to the client.

Until recently, I used a very simple find/replace macro to achieve this, but then I realized that the macro didn’t replace apostrophes and quotation marks situated. I searched online and found a solution that works not only in the main document but also in footnotes and text boxes. Thanks to Doug Robbins and Greg Maxey, whose work I drew on to create one of the macros below.

Copy the following code into a single module in your normal.dotm template, then run the ReplaceQuotes macro before importing your document into your CAT tool and the ReinstateQuotes macro after you have exported from your CAT tool to Word.

I’ve included extensive comments so that you can understand what each line is doing and adapt it as necessary.

Sub ReplaceQuotes() ‘ Replace curly quotation marks and apostrophes with straight ones.
Options.AutoFormatAsYouTypeReplaceQuotes = False ‘ Sets autoformat option not to replace curly quotes with straight ones. This is reset in the final like of the QuotesReplacementBothWays macro.
QuotesReplacementBothWays
End Sub

Sub ReinstateQuotes() ‘ Replace straight quotation marks and apostrophes with curly ones.
Options.AutoFormatAsYouTypeReplaceQuotes = True ‘ Sets autoformat option to replace curly quotes with straight ones, in case the user has manually set the option to false before running the macro.
QuotesReplacementBothWays
End Sub

Sub QuotesReplacementBothWays()
pFindTxtFromOtherMacro = “‘”
pReplaceTxtFromOtherMacro = “‘”
FindReplaceAnywhere
pFindTxtFromOtherMacro = “””” ‘ Find all quotation marks (smart or curly). Four quotation marks are needed because the ” symbol has a special meaning that must be cancelled.
pReplaceTxtFromOtherMacro = “””” ‘ Replaces with smart or curly, depending on whether ReplaceQuotes or ReinstateQuotes was run.
FindReplaceAnywhere

‘ Remove the apostrophes from the start of each line in this section to replace French guillemets with English-style straight quotation marks.
‘ pFindTxtFromOtherMacro = “« ” ‘ Find all opening guillemets followed by a space (incl. non-breaking spaces).
‘ FindReplaceAnywhere
‘ pFindTxtFromOtherMacro = “«” ‘ Find remaining opening guillemets with no space after.
‘ FindReplaceAnywhere
‘ pFindTxtFromOtherMacro = ” »” ‘ Find all closing guillemets preceded by a space (incl. non-breaking spaces).
‘ FindReplaceAnywhere
‘ pFindTxtFromOtherMacro = “»” ‘ Find remaining closing guillemets with no space before.
‘ FindReplaceAnywhere

pFindTxtFromOtherMacro = “” ‘ Makes the variable empty again
pReplaceTxtFromOtherMacro = “” ‘ Makes the variable empty again
Options.AutoFormatAsYouTypeReplaceQuotes = True ‘ Reverts to Word’s default setting. Change this to “False” if you prefer Word not to replace straight quotes with curly ones as you type.
End Sub

Public Sub FindReplaceAnywhere()
‘Performs a find/replace on all parts of a text, including footnotes, text boxes, etc.
‘Found on various webpages, but seems to have been originally created by Doug Robbins and Greg Maxey (https://wordmvp.com/FAQs/Customization/ReplaceAnywhere.htm).
‘Adapted so that it can be run with the find and replace strings pre-defined by other macros.

Dim rngStory As Word.Range
Dim pFindTxt As String
Dim pReplaceTxt As String
Dim lngJunk As Long
Dim oShp As Shape

If pFindTxtFromOtherMacro = “” Then
‘ This macro can be used on its own, in which case the user is asked what Word should find.
pFindTxt = InputBox(“Enter the text that you want to find.” _
, “FIND”)

If pFindTxt = “” Then
MsgBox “Cancelled by User”
Exit Sub
End If

Else
pFindTxt = pFindTxtFromOtherMacro
End If

TryAgain:
If pReplaceTxtFromOtherMacro = “” Then
‘ This macro can be used on its own, in which case the user is asked what Word should replace the found string with.
pReplaceTxt = InputBox(“Enter the replacement.”, “REPLACE”)

If pReplaceTxt = “” Then
If MsgBox(“Do you just want to delete the found text?”, _
vbYesNoCancel) = vbNo Then
GoTo TryAgain
ElseIf vbCancel Then
MsgBox “Cancelled by User.”
Exit Sub
End If
End If

Else
pReplaceTxt = pReplaceTxtFromOtherMacro
End If

lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryType ‘Fix the skipped blank Header/Footer problem

For Each rngStory In ActiveDocument.StoryRanges ‘Iterate through all story types in the current document

Do
SearchAndReplaceInStory rngStory, pFindTxt, pReplaceTxt
On Error Resume Next

Select Case rngStory.StoryType

Case 6, 7, 8, 9, 10, 11
If rngStory.ShapeRange.Count > 0 Then
For Each oShp In rngStory.ShapeRange
If oShp.TextFrame.HasText Then
SearchAndReplaceInStory oShp.TextFrame.TextRange, _
pFindTxt, pReplaceTxt
End If
Next
End If
Case Else

End Select

On Error GoTo 0

Set rngStory = rngStory.NextStoryRange ‘Get next linked story (if any)

Loop Until rngStory Is Nothing ‘ Loops back to the “Do”

Next ‘ Loops back to “For Each rngStory”

End Sub

Public Sub SearchAndReplaceInStory(ByVal rngStory As Word.Range, _
ByVal strSearch As String, ByVal strReplace As String)

With rngStory.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = strSearch
.Replacement.Text = strReplace
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With

End Sub

Share:

Use old-style Excel and Word menus in new versions of Office

A common complaint people make when they install Word 2007 (or Excel 2007) or later is that they don’t like the ribbon and prefer the menus used in Word 2003 (or Excel 2003) and earlier. Microsoft insist that things are easier to find in the new version, but many of us beg to differ. For me, my main qualm with the new version is that it takes me longer to browse through all the options than it did with the old system.

Also, certain options are in illogical places. For example, if you want to insert a row or column in Excel you’ll probably look in the “Insert” tab. But you won’t find it. It’s in the “Home” tab. Why on earth is an “insert” option not in the “Insert” tab?

The Swiss company UBit has produced an add-on that creates a ribbon tab called “Menu”, which contains old-style menus. The add-on can be downloaded from here.

Unfortunately it doesn’t allow you to open the menus with the keyboard. And that’s where I come in! I’ve produced a script to be used with UBitMenu that allows you to open up the menus using the keyboard (i.e. alt+f opens the file menu, etc.) and browse through with the cursor keys. Click here to download the script.

Once you have installed UBitMenu and my script, you can browse through the menus almost as easily as in the old version of Word and Excel.

Please note it currently only works with the English menu shortcuts, and it may not work with certain screen resolutions, as it relies on clicks on the correct part of the screen.

If you test it, please report back whether it works for you.

If you would like a version for your own language, please tell me the shortcut letters for the different menus (File, Edit, View, Format, Tools, Table and Window) in your language.

Share:

AHK scripts to change status in MemoQ

These Autohotkey scripts allow MemoQ users to switch between the Confirmed, Reviewed and Proofread user statuses using the keyboard. The shortcuts are shift-ctrl-z, shift-ctrl-x and shift-ctrl-c. Users of keyboards that don’t have the z, x and c next to each other may wish to change the shortcuts in the code.

; Set "Confirmed"
SetTitleMatchMode, 2
#IfWinActive, memoQ
+^z::
setkeydelay, 20
send, !v{down 6}

sleep 100
send {Enter}
sleep 100
send, +{TAB 6}
send, c

;return to document
send +^{tab}
sleep 100
return

; Set "Reviewer"
SetTitleMatchMode, 2
#IfWinActive, memoQ
+^x::

;from Translations pane
setkeydelay, 10
send, !v{down 6}

sleep 100
send {Enter}
sleep 100
send, +{TAB 6}
send, r

;return to document
send +^{tab}
sleep 100
return

; Set "Proofreader"
SetTitleMatchMode, 2
#IfWinActive, memoQ
+^c::

;from Translations pane
setkeydelay, 10
send, !v{down 6}

sleep 100
send {Enter}
sleep 100
send, +{TAB 6}
send, p

;return to document
send +^{tab}
sleep 100
return

Share:

Key changer for OpenSong using the Do, Re, Mi system

Update on 5 November 2013

The original file I uploaded didn’t work properly. Please use this updated file.

If you want to see how it works, open up this demonstration file in a text editor, then run the exe file and play with the shortcut keys. Remember to release shift-ctrl before pressing each shortcut.

____________________________________

Various tools for projecting song words allow users to add chords to be used by musicians. Such tools are often used by Evangelical churches to project the words of a song for the congregation. In OpenSong files, lines starting with a dot are ignored by the software when projecting the words on a screen but are shown in exports used by the musicians, so a typical section of an OpenSong file might read something like this:

.Do Fa La Fa
These are some words to a song, shoop shoop

OpenSong has a tool to enable the user to change key, but since the program was designed by people in an English-speaking country that uses the “C, D, E,…” system, it is not designed to work with chords written using the “Do, Re, Mi,…” system.

I have designed a tool that will convert chords written in the “Do, Re, Mi,…” system used in Spain, among other places. You can download it here.

It has been tested with OpenSong. If you have files in a different format (i.e. chord lines don’t start with a dot), let me know and I’ll try to adapt it for you.

For this to work you must be using the scale Do, Re, Mi, Fa, Sol, La, Si, Do. If you live in a country that uses a slight variation, let me know and I’ll try to adapt it.

To use the tool, run the exe file, read the shortcuts in the dialogue box, then place your cursor in the text file (download a demo file here) containing the words and chords and press the appropriate shortcut. You can use it in the song editor in OpenSong or by opening the song source files in a text editor.

Share: