tt_news

1.7.8. Multilanguage News

Since version 2.0.0 tt_news supports the localization features introduced with TYPO3 3.7.0. Now you can build a true "one-tree-fits-all-languages" site without breaking this concept by using a news-sysfolder for each language.

Note:
If you use TYPO3 3.6.2, tt_news will work as known, because the localization features will be disabled if no TYPO3 3.7.0 or higher is found.

To integrate tt_news in a multilanguage site, follow the steps described below.

Environment for this example: a working multilanguage site for normal content with tt_news 2.0.0 installed and some news articles.

Open the sysfolder where your news are located (in web/list view) and create an "Alternative Page Language" for each desired translation.


Now activate the "localization view":


If you assigned flag-images to your website languages you should see something like this in your browser:



Click on a flag icon (or the language label) to "localize" a news db-record in a certain language. Now the flag-icon is moved to the "localization" column to show that this news record is translated.

Hint:
If you don't want the localized news records to be immediately visible on the website you can enable "Hide new translations" in the extension configuration (see section "Installation").

 


The titles of the news records had been prepended with "[Translate to {language_label}]".

Hint:
Prepending titles with "[Translate to {language_label}]" can be disabled in the extension configuration. If this is disabled "(copy [#])" will be added to the titles of localized records. This can be disabled, too by setting "Prepend at copy" to" 0" (see "Localization mode for text fields" and "Prepend at Copy" in section "Installation").
 

Language = all

if you set the language in a news record to "all" ths record will be displayed in all available languages.


Now let's see what else changed in a "localized" news article:

 


 


 

You see, that some fields are "missing" in the translated version. Those fields are taken from to the original-language (f.e.: type, related news). Categories are always copied from the record in the default language. The localized article shows only which categories are assigned they are not editable in translations. If the record has categories assigned that are not in the list of allowsed categories for the current BE user a warning message will be displayed and saving of the article will be disabled (see section "Categories" for more information).

Hint:  
The image field of a localized news article is excluded by default (images are alwas taken from the record in the default language). If you need localized images (f.e. if the images show texts) you can enable the "image" field for translated news by setting "l10n_mode_imageExclude" to "0" in the extension configuration.

All fields are showing the value of their original-language below the input field.

Sys_language_mode

With the TS-var "sys_language_mode", you can configure the handling of not translated news-articles. The default is to display the article in the default language if there is no translation was found. If you don't want this behaviour you can set "sys_language_mode" to strict  

Example:

 

  plugin.tt_news.sys_language_mode = strict 

 

Let's say you have 10 news articles in your site (in the default  language) and 5 of them are translated to the selected language. In the default "sys_language_mode" a news list will display 10 items. With "sys_language_mode=strict" the same list will show only 5 news articles.

The Language Menu

The example language-menu (/media/scripts/example_languageMenu.php) coming with older TYPO3 packages ("testsite" package) does not support the tt_news GETvars (the parameters in the Adressbar). The HMENU type=language (new in TYPO3 3.7.0) does exactly the same.

I included a new version of this script in the tt_news distribution. See file: EXT:tt_news/res/tt_news_languageMenu.php
This version keeps the link vars from tt_news (and other extensions) and it also works with simulateStaticDocuments and RealUrl.

You can also use the extension: "sr_language_menu" to switch your website's languages. This extension keeps also the linkVars from tt_news.

To top


Valid XHTML 1.0!