Body Text for Translation

From TNG_Wiki
Jump to navigation Jump to search
Obsolete Body Text for Translation mod is obsolete with TNG V10, since an equivalent capability was added to TNG.
It is only valid for TNG 9.2.2 and prior
TNG version: 9.2.2
TNG version: 7.1

TNG V10 action required

  • if you upgraded over existing environment -- Clean up and then Delete the mod, DO NOT attempt to Install. Remove any language version of the mod.
  • if you did a full install -- Delete the mod, DO NOT attempt to Install
Obsolete


Body Text for Translation
Summary Uses the Body Text input field for translation of the text on images
Validation Latest mod is XHTML compliant.Valid-xhtml10.png
Mod Updated {{{mod_last_update}}}
Download link media-3_body_text_v9.0.0.0.zip
French language file
for
TNG 9.0

media-3_body_text_v8.1.3.zip
for
TNG 8.1

media-3_body_text_v8.1.2.zip
for
TNG 8.0

For
TNG 7.0

* if you are NOT using Bret Rumsey's Image Viewer
media-3_body_text_v1.2.zip
* if you ARE using Bret Rumsey's Image Viewer
media-3_body_text_w_viewer_v1.2.zip
Download stats View download statistics
View Media mods statistics
Author(s) Ken Roy
Homepage Body Text for Translation (This page)
Mod Support TNG Community Forums
Contact Developer Ken Roy
Latest Mod 9.0.0.0 for TNG V9
8.1.3 for TNG V8.1.0
8.1.1 for TNG V8
1.2 for TNG V7
Min TNG V 7.0.0
Max TNG V 9.2.2
Files modified
Related Mods
Notes
If using Bret Rumsey's Image Viewer Mod you must install media-3_body_text_w_viewer_v1.0.zip
If you also install the ShowTable Mod, it should be installed before this mod.
Please update your additional language cust_text.php files with translations based upon the Custom Text Additions for this mod.


Purpose of the mod

This mod was designed to use the Body Text input box for media records in the

  • TNG Histories collection
  • User collections that use the Same setup as: Histories

to contain the translation text for the image and to display both the image and the translation text. It displays the translation text in the table below the image.

This mod applies to TNG 7.0 and above. The mod will work with TNG version 6, but the line numbers will be different and an additional change is required to admin/mediautil.js to make other media types behave like histories so they will have the Body Text input box on the Admin Media screen.

V8.1.3 and after of the mod allows you to edit the mod after installation to specify which mediatypeIDs are used to display both the Body Text and the image in media collections that behave like histories. You can also specify a mediatypeID that you want to use the Image Viewer for displaying the image, which can be viewed as an override to the Setup >> General Settings >> Media >> Enable image viewer: Documents Only


Developer

Ken Roy developed this mod so that English translations could be provided for original documents in a different language, such as French that are often lengthy without having to use the Description text box for that translation.


Advantages

Using the body text input box and displaying both the body text and the image

  • eliminates the need to put translations in the Description
  • avoids cluttering the media collection list with extra information
  • displays the translations in a separate row in the table below the image


Requirements


Revision History

TNG version: 7.0

Note that there are two different flavors of this mod for TNG V7:

  • one to be installed when not using Bret Rumsey's Image Viewer Mod
  • other to be install when using Bret Rumsey's Image Viewer

The version numbers are kept the same, but the config file name is different.


TNG version: 8.0

Starting with TNG V8, there is only one version of the mod.

Version Date Contents
v9.0.0.0 2 February 2012 updated for TNG V9
v8.1.3 9 February 2011 updated for XHTML compliance and added Edit capability to select Media Types that will display both Body Text and Image
v8.1.2 2 January 2011 updated to support mytngstyle.css coming from templates/templateN/css in TNG V8.1
v8.1.1 29 August 2010 updated to honor the Convert line breaks to HTML on display flag in TNG V8
v8.1.0 24 May 2010 updated for TNG V8
v1.2 23 December 2009 updated to add its own global line to eliminate a conflict with Auto Email Original mod
v1.1 15 December 2009 updated to add missing $mediatypeID in global statement which prevented the mod from working correctly
v1.0 14 Jun 2009 initial config file release


Automated Install

For TNG V8 and above

TNG version: 8.0
  1. Remove the previous version of the mod
  2. Download the appropriate mod version from the Mod Summary in the upper right corner
  3. Unzip the appropriate config file into your mods folder
  4. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files to install the appropriate config file.
  5. Edit the mediatypes selected to display both the Body Text and the image in the media record

For TNG V7

TNG version: 7.0
  1. Download the media-3_body_text_v1.2.zip if you are NOT using Bret Rumsey's Image Viewer
  2. Download the media-3_body_text_w_viewer_v1.2.zip if you ARE using Bret Rumsey's Image Viewer
  3. Unzip the appropriate config file into your admin/mod_folder
  4. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files to install the appropriate config file.


Note that the media-3_body_text_v1.0.cfg or media-3_body_text_w_viewer_v1.0.cfg file is part of a series of media display mods where the n in media-n designates the install order of the mods. If you use Bret Rumsey's Image Viewer it must be installed before this mod. Also if you are using the ShowTable Mod it must be installed before this mod.

Note that for TNG V8 there is only one version of this mod, since the Image Viewer is now part of TNG.

Post Install Action

TNG version: 8.0

After installing the Body Text for Translation mod, you need to edit the mediatypes you want to display both the Body Text and the image. See Edit MediatypeIDs Used

Custom Text Additions

Note that config file only includes the English language changes, so if you support multiple languages you will need to modify the config file to add the custom text for those other languages.

The following custom text will be added to your English/cust_text.php file by this mod. If you are using other languages, you must add these lines to each of your language cust_text.php files with appropriate translations of course.


//Body Text for Translation - Ken Roy's mod
$text['mediatranslation'] = "Translation"; 

For example, you would add to the French/cust_text.php

//Body Text for Translation - Ken Roy's mod
$text['mediatranslation'] = "Traduction";

Note that for TNG V8, the $text variables are within single-quotes, and the English/cust_text.php changes were provided for both the languages/English/cust_text.php and languages/English-UTF8/cust_text.php files.

Edit MediatypeIDs Used

Latest version of the mod now allows editing the mediatypeIDs that will display both the Body Text in media collections that behave like histories and the Image. The default mediatypeIDs (or Media Collection IDs) provided by the mod are those used on my site:

  • scan used for my Original Records collection
  • funeral used for my Funeral Cards collection
  • certificate used for my B-M-D Certificates collection
  • histories is provided as a 4th mediatype

You need to use the Mod Manager Edit capability to change the mediatypeID (or Media CollectionID) to the ones for your site where you want both the Body Text and Image to be displayed. You can blank out or erase the 4th mediatype of histories for example, and it will not be selected to display both the Body Text and the image portion of the media record.

You can also specify one mediatypeID (or Media Collection ID) where you want to use the Image Viewer to display the image, if you specified Documents Only for the Image Viewer setting. If you don't want to use this option, then you should blank out or erase the Image Viewer mediatypeID. Note that this option can be viewed as an override to the General Settings, Media, Image Viewer setting if the Document Only option is specified and does not apply if you set the Image Viewer option to Always.

Body Text translation edit mediatypes.jpg

Visualization of this mod

Without Mod

Without this mod, the media record Body Text content is displayed without the image as shown in the image on the right.

Body Text translation no-image.jpg

Without this mod, if the user wants to display both the image and the translation of the text from the image, they typically have to enter the translation text in the Description field, as shown on the right.

Body Text translation in description field.jpg
Putting the translation text in the Description field results in the Media List containing more information than the description of the image and it also results in the Description field being truncated, unless you change the truncation value.
Body Text translation in description media list.jpg

With Mod Installed

With the Body Text for Translation Mod, the Body Text field and the image are both displayed. The Body Text is shown in the table below the image as shown in the image on the right.

Body Text translation below image.jpg

With ShowTable Also Installed

Note that if you are also installing the ShowTable_Mod, it should be installed before the Body Text for Translation Mod, so the table fields will display in a more logical order after the media as shown in the image on the right.

The example on the right shows the original text of the document and a French and English translation.

Body Text Translation ShowTable.jpg


TNG version: 8.1.3
Note that you can use the html formatting codes (<strong> <b>) within the Body Text in order to provide some formatting.

You can also check the Convert line breaks to HTML on display box so that you do not have to enter <p> or <br />.

You can also provide more than one language translation within the Body Text input box as shown in the image on the right.

Body Text translation input example.jpg


TNG version: 9.0

The Body Text in TNG V9 and above uses the NicEdit for providing the HTML formatting.

NicEdit Body Text example


Sites using this mod

If you download and install this mod, please add your TNG site to the table below

URL User Note Mod-Version TNG-Version User-language
Our Roy and Boucher Family Ken Roy I use this TNG mod for my Original Documents, Certificates, and Funeral Cards media collections. 9.0.0.0 9.0.3 EN, FR
Kleinmann Family Tree John Kleinmann Not a public site. Please email me for access. 9.0.0.0 9.1.2 EN
... ... ... ... ... ...

Related Mods

The following Media mods may be related. The number indicates the install order if you install more than one of these mods:

TNG Modules Involved

In TNG V8, the following modules are updated:

  • showmedialib.php
  • languages/English/cust_text.php
  • languages/English-UTF8/cust_text.php

and the following module is created:

  • extensions/bodytext_imageviewer.php

In TNG V7, the following modules are updated:

  • showmedialib.php
  • English/cust_text.php

and the following modules are created:

  • extensions/bodytext_imageviewer.php for use with Image Viewer Mod
  • extensions/bodytext.php when not using the Image Viewer in TNG V7