Tools - Edit Localization File

The Edit Localization File console provides a console used by translators who are creating or updating localization files for Manifold products.  It can be used to create and to edit localization files using either Viewer or Manifold.  Please see the Localization topic before using this command.

 

Manifold Viewer is a free version of Release 9 that is generally read-only.  One exception to "read-only" is that the Edit Localization File tool works in Viewer too.  We can use the free Viewer to edit and to update localization files.  Super!

 

Most translators do their first translation using a Windows text editor such as Notepad or Notepad++.    A conventional text editor works great for initial translations, and it provides features like search and replace that are used a lot in the initial translation, for example, searching for over one hundred occurrences of <value> and replacing each with <Wert>, as in the German translation.

 

However, because Manifold adds dozens of new features every two weeks, keeping that file up to date can be tedious using an ordinary text editor.  To make updates to localization files easy, Manifold provides the Edit Localization File console, a tool expressly designed to make updates and file maintenance easy.  After the first translation, most translators will maintain their translation and will update it for newer versions of Manifold using the Edit Localization File console.

 

 Always make a backup copy of the localization file before beginning work, to use as a restore point in case of need.  The Edit Localization File console works directly with and saves changes to the file that is in use.  

 

Updating a localization file:

 

  1. Launch the latest edition of Manifold or Viewer.
  2. In the main menu, choose Tools - Edit Localization File.  The console that pops open may be resized as desired.
  3. In the Edit Localization File console, click the [...] browse button to load the localization file to be edited.  Translations from that file will appear in the rightmost column, automatically matched to each tag.
  4. Click the Filter button and choose Unlocalized to show only those tags that have not been localized.  
  5. Double-click a translation cell to pop it open for editing.
  6. Edit the translation as desired, and then press OK.
  7. When finished editing, press Save to save the localization file.  

 

Other Filter button options provide various useful views.  We can also use the filter box to find specific strings.  Enter text into the filter box and the display will be reduced to only those rows which have the given text in any of the three columns.

 

 

The Edit Localization File console opens with three columns: Tags, Default, and Translation.  The left column provides a list of tags with the middle column providing the default English content for that tag. The left and middle columns are gray because they are read-only, taking their contents from what is built into the program.  Launching the Edit Localization File console from the latest edition of Manifold automatically loads the latest set of tags with their default English values, so there is no need to load a default.ui.txt file.  

 

 When we load a localization file, the right column will be populated with the translations that localization file provides for each tag.

 

For example, in the illustration above the first tag in default English form in the default.ui.txt file would be:

 

BuilderCollate=Collate options  

 

The German translation shown in the illustration in the ui.de.txt file that was loaded has the first tag translated as:

 

BuilderCollate=Sortieroptionen

 

The Edit Localization File console automatically matches the BuilderCollate tag as it is used within the program and as it is found in the ui.de.txt localization file that has been loaded.   The first row in the console thus becomes  

 

BuilderCollate      Collate options     Sortieroptionen

 

This makes it easier to compare the original English, called the Default, to the translation.   Double-clicking into a translation cell allows us to edit that cell.  

Controls

 File

The path to the localization file being edited.

Click the browse button to navigate to and open a localization file.   Choosing a new file when a localization file is already loaded will discard any changes to the prior file.

Filter box

Enter text to be matched in any of the three columns, case not significant.   

 Filter options

Click for a pull-down menu choosing what rows to display:

 

  • All - Show all rows, the default.
  • Localized - Show all rows with non-empty translation column contents different than the Default.
  • Localized as Default - Show all rows with translation column contents the same as the Default.
  • Unlocalized - Show all rows with empty translation column contents, including those previously empty and recently edited, but not yet saved.
  • Edited - Show all rows that have had unsaved edits to them.
  • Unedited - Show all rows that have not been edited.

 

Edited translated cells are shown in blue preview background color until the file is saved.

(left column)

Tags - The left column shows all tags used by the program, listed in English alphabetic order.   Because tags are automatically loaded from the tag table built into the program, the left column provides a definitive list of tags as used by whatever build/version is running.

(middle column)

Default - The middle column shows the default English text used for each tag.

(right column)

Translation - When a translation file has been loaded, the right column shows the text used for each tag.  

Double-click translation cell

Double-click a cell in the Translation column to open it for editing in the Edit Localization String dialog.

Save unlocalized strings as comments

A newer version of Manifold will usually have new tags for new features that earlier versions did not have.  A localization file created for an earlier version therefore will not have strings for those new tags.  This option (checked by default) tells the console when saving to add lines for new tags in alphabetical order, but prefaced with a # character to make them a comment.  That makes them easy to find with an ordinary text editor.  When not checked, the console will not save new, unlocalized  tags to the localization file when saving.

Save

Save the file in standardized form.  Loading a file and then saving it without making any edits may still result in changes:  

 

  • Comments lines are removed.  
  • Any unmatched tags will be moved to the end of the file, after a ###### line to indicate what follows are unmatched tags.

Close

Close the console without saving any changes.

 

Edit Localization String Dialog

Double-clicking a cell in the Translation column opens it for editing in the Edit Localization String dialog:

 

 

The command buttons at the bottom of the dialog provide fast, one-click access to frequently desired commands.  

 

 Tag

The tag for the string being edited.

Default

The default English text for the tag.

Translation

Translated text to use for the tag.

Use Default

Click to use the default, English text for the translation.  Useful when when we want a new tag to use the default English text.  Always enabled, since there is always a default.

Use Existing

Enabled when there are other tags which have exactly the same English default and a translation for that default.  For example, if the English word End has already been translated for other tags, then clicking Use Existing will load that translation from the existing translation.  

 

If the English default has been translated in different ways (sometimes done because the same word might be used in different contexts), then clicking Use Existing will show a pull down menu of the various choices.

Use Unmatched

Enabled if there are unmatched tags in the localization file.  An unmatched tag is a tag in the localization file that is not currently used in the program.  This happens when tags in use in the program have been renamed, or when older features no longer exist in a newer version or have been replaced by newer features.  

 

Clicking Use Unmatched provides a pull down menu of translations used in unmatched tags.  This is a handy way of reusing an earlier translation where the names of the tag has changed but the translation is still useful.

OK

Save changes and close the dialog.

Cancel

Close the dialog without saving any changes.

 

Example

We will edit a version of the German localization file, which is saved in a text file called ui.de_alt.txt.  

 

 

This version of the file has been hacked to add two additional lines, for made-up tags called BuilderConstantNo and BuilderConstantYes.   Those tags do not occur in the default.ui.txt canonical file, and they are not used by Manifold.  We have added them so when this file is loaded into the Edit Localization File console there will be some unmatched tags that can be used to illustrate what the Use Unmatched button does.  There is no harm done if a localization file includes tags that are not used by Manifold.  Unmatched tags are ignored by the program.

 

 

We launch Manifold (or Viewer) and use the [...] browse button to load the ui.de_alt.txt file.   The rightmost column is loaded with translations from the file.   Note that if we scroll down to where the artificial unmatched tags would appear, they are not there.  Manifold, and the Edit Localization File console, list only the current set of tags that are used by the program.  Unmatched tags are not displayed, even though they are available in the pull down menu for the Use Unmatched button.

 

 

 We press the filter options button and choose Unlocalized to see all the tags that do not have translations in the loaded file.  These are typically new tags that have been added in newer versions of Manifold that were published after the localization file was translated.

 

 

The display shows only those tags that have no localizations other than default, so the translation column is blank.  We scroll down to a new tag we want to localize, the ValueLanguageDefault tag, and we double-click into the translation column cell for that row.

 

 

That pops open the Edit Localization String dialog for that tag.  The Default is the English string (none).  

 

 

If we want to use the default as the localization, we press Use Default and that text instantly appears as the Translation.   We might want to do that for some strings.  For example, the German localization file tends to use the default English (auto) in German as well.   

 

 

If we press the Use Unmatched button, it will show a pull down menu of all unmatched tags and their translations that we can choose.   If there was only one unmatched tag, the value for that would have been immediately used.   However, neither of the options look like they would be a good German translation of (none).   

 

 

The Use Existing button is enabled, so that indicates somewhere in the German localization file we are editing the default English (none) has already been translated.  When we press the Use Existing button, the text (keine) is immediately loaded as the Translation.    There was no pull down menu to show more than one option, because in this localization file the English default of (none) was translated only one way, to (keine).

 

We press the OK button to use that translation and to close the dialog.

 

 

Back in the Edit Localization File console, the new translation we have added appears with blue preview background color until the file is saved.   Note that even though the Translation cell for this row is no longer empty, the sting still appears despite the Unlocalized setting for the filter options button.   That cell is still considered to be unlocalized until the file is saved.  

 

We might be curious as to what other tags have a default of (none),  so we can see where else this same translation appears.   To do that, we enter (none) into the filter box.

 

 

The display immediately updates to show only those strings where the text (none) appears in any of the three columns.  

 

 To get the display above, we have also pressed the filter options button and chose All, to show all rows and not just the unlocalized rows.

 

To save the file, we press the Save button.   To close without updating the file, we press Close.   If we press Close with any changes pending, the system will ask if we want to save first.

 

Notes

Viewer can edit localization files - Although Viewer is a read-only program, one exception is that Viewer can read and write localization files using the Edit Localization File console.  That makes it possible to maintain localization files using a completely free package.  Super!

 

Finding typos in tags with unmatched tags - Typographical errors in tags within localization files are unusual, because tags are not edited.  Only what comes after the = sign is edited when translating a localization file.   However, when editing a localization file with Notepad, careless use of search and replace might accidentally edit tags as well as intended text.    

 

For example, in Notepad doing a search for value and replacing it with Wert in a German translation without checking the Match case box will replace text such as <value> with <Wert> as intended, but it also will change CommandEditValueCopy to CommandEditWertCopy.

 

There are two easy ways to see if we have any such errors in tags in our localization file.

 

 

 

There are two ways to repair that problem.

 

 

 

Another useful technique in the Edit Localization File console is if we know specific tags are damaged in the localization file, for example, the CommandEditValueCopy wrongly changed to CommandEditWertCopy, we can enter partial text for the tag such as CommandEditV, into the filter box to quickly see only that tag.  We can then double-click into the translation cell and choose Use Unmatched to copy the translation from the damaged, unmatched tag.

 

Credits:  Manifold expert user KlausDE contributed the German localization file used in this example.  Join in by adding your language and sharing the localization file with others!

 

See Also

Localization